cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
drobertson
Engaged Sweeper III
User Action for "View MemberOf":


{actionpath}AD_List_Groups.vbs "{cn}"


AD_List_Groups.vbs content:


' List the Active Directory Groups a User Belongs To

On Error Resume Next
Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D

struser = WScript.Arguments(0)
Set objUser = GetObject("LDAP://" & struser)

intPrimaryGroupID = objUser.Get("primaryGroupID")
arrMemberOf = objUser.GetEx("memberOf")

If Err.Number = E_ADS_PROPERTY_NOT_FOUND Then
strMsg = strMsg & "The memberOf attribute is not set."
Else
For Each Group in arrMemberOf
Group2 = Mid(Group, 4)
a=Split(Group2,",")
strMsg = strMsg & a(0) & VbCrLf
Next
End If

msgbox strMsg,0,"Member OF"
0 REPLIES 0