I've been trying to create a script to find a missing "Member of" Group in a Group. Can someone help me write the Where-Object cmdlet because I really don't know how this works.
This is what I already have:
$MissingGroup = "gg-s-MissingGroup"
$Group = Get-ADGroup -Filter 'Name -like "gg-s-*-Group"' -SearchBase "OU=xxxxxxx,DC=xxxxxxxxx,DC=xx" | Format-Table Name
I need the a list of the $Group where the $MissingGroup is NOT a "Member of" it.
You don't need
Where-Objectfor this, you can and should do it with the Active Directory Filter: