Hiya folks, I previously posted a function written in PowerShell that will derive if a user account in Active Directory is a member of a particular group.
Both the user account and the group are passed to the function as parameters – which will return either 1 or 0.
I have noticed a small error in the function (nothing major) where it might return no result at all if the group does not exist in AD, therefore I have updated the script that was part of the original post – and it can be downloaded from here:

You should probably call it Test-GroupMembership since it is actually checking to see if a person is a member of a group and not getting a list of members in a group.
By: SQL_Guru on March 6, 2008
at 8:07 pm
Good point, especially as it could be confused with the “get-member” cmdlet – I will review it.
But, at the time I wrote it the name made sense as I trying to confirm that an account was a member of the stated group.
Cheers
A
By: Andy Grogan on March 6, 2008
at 8:12 pm