Get-ADOrganizationalUnit -Filter * -SearchBase “DC=test,DC=me,DC=com” | Where-Object {-not ( Get-ADObject -Filter * -SearchBase $_.Distinguishedname -SearchScope OneLevel -ResultSetSize 1 )} | Select Name,DistinguishedName
Get-ADOrganizationalUnit -Filter * -SearchBase “DC=test,DC=me,DC=com” | Where-Object {-not ( Get-ADObject -Filter * -SearchBase $_.Distinguishedname -SearchScope OneLevel -ResultSetSize 1 )} | Select Name,DistinguishedName
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Leave a comment