I have this code that works to move old computer accounts to an inactive OU.
$Inactive_computer_OU = 'OU=InactiveComputers,DC=Acme,DC=com'
$sourceOU = 'Acme.com/WorkstationComputers'
Set-QADPSSnapinSettings -DefaultSizeLimit 0
$old = (Get-Date).AddDays(-45).ToFileTime()
$ldapFilter = '(pwdLastSet<={0})' -f $old
Get-QADComputer -LdapFilter $ldapFilter -SearchRoot $sourceOU -IncludedProperties pwdLastSet -SizeLimit 9000 | Move-QADObject -NewParentContainer $Inactive_computer_OU
But under $sourceOU = 'Acme.com/WorkstationComputers' I have a sub-OU located here:
'Acme.com/WorkstationComputers/XenDesktops'
I need to exclude this 1 OU from what this script does. How do you handle that?