Skip to content

Support
Please use the Drop Us A Line tab in the top right corner for free email support.

Paid support with Zoom screen sharing is also available.

Pre-Requisites

Ensure the following:

  • Administrator’s account has access to move and modify computers in Active Directory
  • Computer has ability to run unsigned Powershell scripts
  • Computer has network access with visibility to Active Directory

Instructions

Download and extract Essentials Package files. Open the newly created folder and drill down to the CleanAD folder.

Right click on config.ps1 and open with Notepad or a similar text editor.

Specify values for the 3 variables located in config.ps1.

  • $DaysInactive – determine how many days should have passed since a computer was last logged into before filtering it out. EG 365 would be 1 year.
  • $SearchOU – specify the OU and domain you wish to find the old devices. EG if the path is test.yourdomain.com/Computer-Accounts/labs, set this variable to “OU=labs,OU=Computer-Accounts,DC=test,DC=yourdomain,DC=com”
  • FilteredOU – specify the OU and domain you wish to move the old devices to so they can be deleted or disabled. EG if the path is test.yourdomain.com/Computer-Accounts/filtered, set this variable to “OU=filtered,OU=Computer-Accounts,DC=test,DC=yourdomain,DC=com”

Save the config.ps1 file when ready.

Finally, running “document_old_pcs.ps1” will generate a list of computers in an xls file that will be affected but will not move them. You can use this to verify the targeted OU generates the expected results.

Running “filter_old_pcs.ps1” will generate the same xls file while also moving the computers in Active Directory.