Notification

Icon
Error

View users membersof - view AD groups user is memberof

Posted: Thursday, November 4, 2021 3:46:45 PM(UTC)
Don

Don

Member Original PosterPosts: 33
0
Like
User Action for "View MemberOf":

Code:

{actionpath}AD_List_Groups.vbs "{cn}"


AD_List_Groups.vbs content:

Code:

' 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"

Active Discussions

Lansweeper Clearing Thermal State Warning
by  calmed-anodises   Go to last post Go to first unread
Last post: 5/20/2022 6:28:27 PM(UTC)
Lansweeper Quality problems with Lansweeper
by  Hendrik.VE  
Go to last post Go to first unread
Last post: 5/20/2022 3:43:44 PM(UTC)
Lansweeper Bitlocker keys
by  SWResearch   Go to last post Go to first unread
Last post: 5/20/2022 1:34:18 PM(UTC)
Lansweeper Lansweeper Helpdesk instructional webinar
by  Erik.T  
Go to last post Go to first unread
Last post: 5/20/2022 10:40:30 AM(UTC)
Lansweeper Outlook task and calendar
by  ITVTECH   Go to last post Go to first unread
Last post: 5/20/2022 8:26:51 AM(UTC)
Lansweeper SCCM scanning incorrectly reporting last seen results
by  SWResearch  
Go to last post Go to first unread
Last post: 5/20/2022 12:34:52 AM(UTC)
Lansweeper Scanning certificates
by  EagleEyeJoe   Go to last post Go to first unread
Last post: 5/19/2022 7:39:24 PM(UTC)
Lansweeper Lansweeper Cloud Location
by  FrankSc  
Go to last post Go to first unread
Last post: 5/19/2022 7:07:49 PM(UTC)