I hope this is the right forum for this question. If not, could someone
point me to the proper one. I would like to determine the AD groups that
a user logging in is a member of. So far I have written the following code:

Dim ADSysInfo, CurrentUser, strGroups
Dim mem,i,grp,tmp


Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)

for each mem in CurrentUser.MemberOf
if instr(mem,"CN=WCVM")>0 then
wscript.echo "Checking: "+mem
Set grp =GetObject("LDAP://" & mem)
end if
next

All my groups of interest start with WCVM so I can weed out the others.
This mostly works except in the case where a group is a member of another
group. One would think that if the user is a member of a group and the group
is a member of another group then the user would automatically show up as
a member of another group. But this is not the case. Is there a simple
way to recursively check which groups are members of other groups?

Thanks.

Brian.
--

Brian Buydens
Veterinary Electronic Data Specialist
Computing Services, University of Saskatchewan
email: Brian.Buydens@usask.ca
http://duke.usask.ca/~buydens
VE5RDV

--------------------------------------------------------------------------
I am a proud citizen of "Soviet Canuckistan"