3 replies
by isla23 Accepted solution
by fred123456 Accepted solution
As far as I know your going to have write a VB script that will enumerate through the groups container and then list each memeber of the group.
For example:
Option Explicit
Dim objRootLDAP, objGroup, objUser, objOU, objmemberOf
Dim strOU, strUser, strDNSDomain, strLDAP, strList
' Commands to bind to AD and extract domain name
Set objRootLDAP = GetObject("LDAP://RootDSE")
strDNSDomain = objRootLDAP.Get("DefaultNamingContext")
' Build the LDAP DN from strUser, strOU and strDNSDomain
strUser ="cn=Administrator,"
strOU ="CN=Users,"
strLDAP ="LDAP://" & strUser & strOU & strDNSDomain
Set objUser = GetObject(strLDAP)
' Heart of the script, extract a list of Groups from memberOf
objmemberOf = objUser.GetEx("memberOf")
For Each objGroup in objmemberOf
strList = strList & objGroup & vbcr
Next
WScript.Echo "Groups for " & strUser & vbCr & strList
WScript.Quit
' End of Sample User memberOf VBScript
by fred123456 Accepted solution
This discussion is closed to new replies.
Trending Security posts
Sort by Trending