I\'m working on a script that will build a new group if it doesn\'t exist. I\'m using Get-ADGroup to make sure the group doesn\'t exist using the following command:
I realize this is old, but I also had this problem and solved it like this:
If (Get-ADObject -Filter {objectClass -eq "Group -and samAccountName -eq "groupname"}) { //do stuff// }