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