I NEED A SCRIPT IN POWERSHELL TO MOVE INACTIVE COMPUTERS TO ANOTHER OU
Posted on 2014-11-19
I'm trying to complete an AD cleanup. I have already the list of all inactive computers and users that should be moved to another OU, let's call it "DISABLED COMPUTERS" and "DISABLED USERS". This can't be done using GPO and I have no previous experience in scripting, so I will greatly appreciate if anyone of you can provide me a script or the steps to create one that can achieve that purpose. In summary this is what I need:
1. Check for the destination OU if not present create it.
2. Check for the users who meet the criteria if found move to that OU.
3. Check users in the destination OU and if more than x days then delete.