Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help with Listing Members of Multiple Groups

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61616
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with Listing Members of Multiple Groups
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help with Listing Members of Multiple Groups - 6/19/2008 1:31:39 AM   
  D.Amos

 

Posts: 1
Score: 0
Joined: 6/19/2008
Status: offline
Greetings all,

I am somewhat of a novice for writing scripts.  I am learning slowly though.  The project I am on is to write a script that will list all the members of a group in an OU...then add those members names to the name of the security group.

For instance:  Security Group Name = POST 1234    Member of Group = joe.smith

End result being Security Group Name = POST 1234 (joe.smith)

After a lot of trial and error I have been able to list a single group with its members.  My question is there a wildcard i can use to list all the groups with their members.  I will put what I have so far for the script below.

strContainer = "OU=Administrator Groups, Ou=Lower Admins"
strName = "POST*"
On Error Resume Next

Set objRootDSE = GetObject("LDAP://rootDSE")
If strContainer = "" Then
Set objItem = GetObject("LDAP://" & _
   objRootDSE.Get("defaultNamingContext"))
Else
Set objItem = GetObject("LDAP://cn=" & strName & "," & strContainer & "," & _
   objRootDSE.Get("defaultNamingContext"))
End If

strsamAccountName = objItem.Get("samAccountName")
WScript.Echo "samAccountName: " & strsamAccountName
strmember = objItem.GetEx("member")
WScript.Echo "member:"


Thank you all very much for your help in advance.

Daniel
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with Listing Members of Multiple Groups Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts