I have a get-Adcomputer call that is working and I am wondering if there is a better/cleaner way to filter out multiple OU's than what I am currently doing..
Get-ADComputer -Filter * -SearchBase "OU=TC Workstations,DC=ad,DC=TC,DC=org" `
-Properties Description,Enabled,MemberOf,CanonicalName,OperatingSystem | `
Where {($_.CanonicalName -notlike "*/vdi*") -and ($_.CanonicalName -notlike "*/saf*") -and ($_.CanonicalName -notlike "*/atic*") `
-and ($_.CanonicalName -notlike "*/visix*") -and ($_.CanonicalName -notlike "*/DeletePending*")} | Sort-Object -Property Name
I have been searching but haven't found anything yet.
Thanks.