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.

“Before joining NATO, each country had to establish civilian control of its army. Before joining the European Union, each adopted laws on trade, judiciary, human rights. As a result, they became democracies” ~ Anne Applebaum

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-2026 SS64.com
Some rights reserved