VBscript to find members and memberOf from a group

VBscript to find members and memberOf from a group

' List All the 'Members' and 'Member Of' of a Group
' Test_group points to the group which you need the output

On Error Resume Next

Set objGroup = GetObject ("LDAP://cn=Test_Group,ou=TestOU,dc=home,dc=com")
objGroup.GetInfo

arrMember = objGroup.GetEx("member")

WScript.Echo "Members:"
For Each strMember in arrMember
    WScript.echo strMember
Next
'------------------------------

arrMemberOf = objGroup.GetEx("memberof")
WScript.Echo "MemberOf:"
For Each strMemberOf in arrMemberOf
    WScript.echo strMemberOf
Next
'------------------------------


***Share your comments about this post***

No comments:

Post a Comment