How-to: Test if a user is a member of an AD group in VBScript [isMember]

Some functions to determine group membership.

You can find an excellent, tried and tested VBScript program to enumerate members of a group
over at hilltop labs - https://www.rlmueller.net/Programs/EnumGroup2.txt

Examples

List all members of group64

cscript //nologo EnumGroup2.vbs "group64"

IsMember

There are several approaches for checking group membership in VBScript - consider if you need to check Local or Domain groups, and to include or not include nested permissions.

There are also some gotchas to consider - when enumerating the members of a group it is possible that nothing will be returned, one member is returned or multiple members returned. Test your code with all these possibilities.

Richard mueller has a number of IsMember scripts

Test group membership for a single user.

Test group membership (including nested groups) for a single user or computer.

“If I had to live my life again, I'd make the same mistakes, only sooner” ~ Tallulah Bankhead.

Related VBScript commands

IFMEMBER - Is the current user a member of a group.
Equivalent PowerShell: Get-adGroupMember -Recursive - Get the members of an AD group.


 
Copyright © 1999-2024 SS64.com
Some rights reserved