Check for membership

  • Thread starter Thread starter Gert De Vleeschouwer
  • Start date Start date
G

Gert De Vleeschouwer

Hi,

I want to check if a user is member of specific group.
I can use the following example:

***************************************
Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")

WScript.Echo "Distinguished Name: " & VbCrLf & _
objUser.Get("distinguishedName")

objMemberOf = objUser.GetEx("MemberOf")
WScript.Echo VbCrLf & "The user is a member of:"
For Each Group in objMemberOf
.... check specific group ...
Next
****************************************

But, if the user is member via another subgroup, I'll
miss that.
Is there a way to check the membership of a group,
inclusive via subgroups ?

Regards,
Gert
 
Hi,

I want to check if a user is member of specific group.
I can use the following example:

***************************************
Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")

WScript.Echo "Distinguished Name: " & VbCrLf & _
objUser.Get("distinguishedName")

objMemberOf = objUser.GetEx("MemberOf")
WScript.Echo VbCrLf & "The user is a member of:"
For Each Group in objMemberOf
.... check specific group ...
Next
****************************************

But, if the user is member via another subgroup, I'll
miss that.
Is there a way to check the membership of a group,
inclusive via subgroups ?

Regards,
Gert

See tip 7225 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top