# Script for to search multiple OUs looking for inactive computers and moving them

**URL:** <https://forums.powershell.org/t/script-for-to-search-multiple-ous-looking-for-inactive-computers-and-moving-them/14155>\
**Category:** PowerShell Help\
**Created:** [April 14, 2020, 11:55am UTC](https://forums.powershell.org/t/script-for-to-search-multiple-ous-looking-for-inactive-computers-and-moving-them/14155 "2020-04-14T11:55:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![foozgrind](https://avatars.discourse-cdn.com/v4/letter/f/b5a626/32.png) [@foozgrind](https://forums.powershell.org/u/foozgrind)\
**Post date:** [April 14, 2020, 11:55am UTC](https://forums.powershell.org/t/script-for-to-search-multiple-ous-looking-for-inactive-computers-and-moving-them/14155/1 "2020-04-14T11:55:02Z")

</div>

Hi guys, was hoping I could get some help. I am a really not very good with powershell and recently I was asked to provide a script that will scan AD and disable any computer X last logged in, move them to an OU. Yes I found a handful of these on the web, but half of them dont work also I realized I need to scan by specific OU (multiple ou’s) as I dont want this to run against my servers just workstations. Could anyone help or point me in the right direction?

Script

Scan multiple OU’s in AD  
Disable workstaions last log on date X  
Move to OU

Thanks!

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [April 14, 2020, 1:49pm UTC](https://forums.powershell.org/t/script-for-to-search-multiple-ous-looking-for-inactive-computers-and-moving-them/14155/2 "2020-04-14T13:49:55Z")

</div>

Michael, welcome to [Powershell.org](http://Powershell.org). Please take a moment and read the very first post on top of the list of this forum: [Read Me Before Posting! You’ll be Glad You Did!](https://powershell.org/forums/topic/read-me-before-posting-youll-be-glad-you-did/).

This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/script-for-to-search-multiple-ous-looking-for-inactive-computers-and-moving-them/14155/3 "2024-05-16T20:30:12Z")

</div>


