Part III : Move all Disabled computers to Standard Disabled OU [ http://ande.in ]
Here we move all Disabled computers from OUs to a standard OU.
Note : Chenge the following names in the script.
Standard Disabled OU : “OU=Disabled,DC=ande,DC=in”
Standard Disabled OU : "ande.in/Disabled"
$log [Default : C:\Log_310310.log]
add-pssnapin Quest.ActiveRoles.ADManagement
$Log = Get-Date -uformat "C:\Log_%d%m%Y.log"
######################
$Date_Move2Disabled = Get-Date
echo "$Date_Move2Disabled : Moving all Disabled computers to Standard Disabled OU....." | Out-File -Append -FilePath $Log
######################
##### Move All Disabled Computers to Standard Disabled OU
Get-QADComputer -SizeLimit 0 -ldap "(userAccountControl:1.2.840.113556.1.4.803:=2)" `
| where {$_.dn -notmatch "OU=Disabled,DC=ande,DC=in"} `
| Move-QADObject -NewParentContainer "ande.in/Disabled"