return to tranceaddict TranceAddict Forums Archive > Main Forums > Chill Out Room

 
Active Directory help
View this Thread in Original format
DJ Mikey Mike
Does anyone know how I can export all the security groups plus its members to a text file or csv file?
Joss Weatherby
Start by slitting your wrists, now wait till you are dead.

Are you in hell yet? Ok now lets get started...


Actually Im full of , I never worked on AD that far, but a friend at my old work did and it sounded like a bitch to get policies and groups out in any sort of constructive manner.
Rinster
Hm interesting question actually.. i work with AD all day.. ill have a look into it.. and post it as soon as i find out. ;)
DJ Mikey Mike
The most common method appears to be using vb scripts. However, I know nowhere near enough about scripts to tailor people's code to my own requirements. I can't believe there isn't a more user friendly way to do it.
DJ Mikey Mike
Going back to this again, I found the following script, but I don't know anything about VB scripting. Can anyone tell me what bit of the code I need to replace with my own company information? And where I need to run it from?

code:
'Script begins here Dim objGroup, objUser, objFSO, objFile, strDomain, strGroup, Domain, Group 'Change DomainName to the name of the domain the group is in strDomain = "Domain" 'Change GroupName to the name of the group whose members you want to export strGroup = "Group" Set objFSO = CreateObject("Scripting.FileSystemObject") 'On the next line change the name and path of the file that export data will be written to. Set objFile = objFSO.CreateTextFile("C:\stefan\final" & strGroup & " - Members.txt") Set objGroup = GetObject("WinNT://" & strDomain & "/" & strGroup & ",group") For Each objUser In objGroup.Members objFile.WriteLine objUser.Name & " - " & objUser.Class Next objFile.Close Set objFile = Nothing Set objFSO = Nothing Set objUser = Nothing Set objGroup = Nothing Wscript.Echo "Done" Wscript.Echo "Please check your destination folder for the output file"
CLICK TO RETURN TO TOP OF PAGE
 
Privacy Statement