VBScript program demonstrating the use of an efficient IsMember function to test for
group membership for a single user. The function does not reveal membership in
groups. However, it does reveal membership in the "Primary Group". The IsMember
function uses a dictionary object, so that group memberships only have to be enumerated
once, no matter how many times the function is called.
This program uses the WinNT provider to bind to the user or computer object in Active Directory. The same IsMember function could also be used if the user object is bound with the LDAP provider.
The WinNT provider does not support computer object group membership. If the WinNT provider is used, you cannot test for computer group membership.
This program should work on any 32-bit Windows client that can log onto the domain. Windows NT and Windows 98/95 clients should have DSClient installed. If DSClient is not installed, they need WSH and ADSI installed.
Typically, this IsMember function would be used in a logon script to map drives to network shares according to user group membership.
IsMember1.txt <<-- Click here to view or download the program