|
This vbscript is what I use to get group membership in
a csv file. I modified it from code I found on the
internet.
It will prompt you for domain name, group name, and file name then generate your list. Hope you find it helpful.
Just save everything below the line in a .vbs file
-----------------------------------------------------------------------------------------
' enumgroup.vbs
' Gets input on the domain name, group name, and file name ' Then outputs the NT login ID and the Users full name ' to the specified file name in a csv format. Do strDomain = inputbox( "Enter the netbios domain name.", "Input" ) Loop until strDomain <> "" Do
strGroup = inputbox( "Enter the name of the group you want to check (for instance: Domain Admins).", "Input"
)
Loop until strGroup <> "" Do
strFile = inputbox( "Please enter the name of the file you want to save this as. (for instance: C:\list.csv).",
"Input" )
Loop until strGroup <> "" Set objGroup =
GetObject("WinNT://" & strDomain & "/" & strGroup &
",group")
Dim fso,
textfile
Set fso = CreateObject("Scripting.FileSystemObject") Set textfile = fso.CreateTextextfileile(strFile, True) textfile.Writeline
("Membership list of " & chr(39) & strGroup &
chr(39))
textfile.WriteBlankLines(1) textfile.Writeline (chr(34) & "NT Login ID" & chr(34) & chr(44) & chr(34) & "Full Name" & chr(34)) For Each objUser
In objGroup.Members
textfile.Writeline (chr(34) & objUser.Name & chr(34) & chr(44) & chr(34) & objuser.FullName & chr(34)) Next textfile.close WScript.Echo
strfile & " has been generated."
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Harding, Devon Sent: Friday, September 17, 2004 2:47 PM To: [EMAIL PROTECTED] Subject: RE: [ActiveDir] AD Group Export GUI? How would I specify a
particular child domain to search? This message is confidential, intended only for the named recipient(s) and may contain information that is privileged or exempt from disclosure under applicable law. Any patient health information must be delivered immediately to intended recipient(s). If you are not the intended recipient(s), you are notified that the dissemination, distribution or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at either the e-mail address or telephone number above and discard this e-mail. Thank you. |
- Re: [ActiveDir] AD Group Export GUI? Steve Schofield
- RE: [ActiveDir] AD Group Export GUI? Mulnick, Al
- RE: [ActiveDir] AD Group Export GUI? Harding, Devon
- RE: [ActiveDir] AD Group Export GUI? Bernard, Aric
- RE: [ActiveDir] AD Group Export GUI? Bernard, Aric
- RE: [ActiveDir] AD Group Export GUI? Bernard, Aric
- RE: [ActiveDir] AD Group Export GUI? Harding, Devon
- RE: [ActiveDir] AD Group Export GUI? Harding, Devon
- RE: [ActiveDir] AD Group Export GUI? Bernard, Aric
- RE: [ActiveDir] AD Group Export GUI? Harding, Devon
- RE: [ActiveDir] AD Group Export GUI? Burns, Clyde
- RE: [ActiveDir] AD Group Export GUI? Bernard, Aric
- RE: [ActiveDir] AD Group Export GUI? deji
- RE: [ActiveDir] AD Group Export GUI? Harding, Devon
- RE: [ActiveDir] AD Group Export GUI? Tony Murray
