‎11-04-2021 03:46 PM - last edited on ‎04-01-2024 04:13 PM by Mercedes_O
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"
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now