Advertisement

11.01.2005 at 02:45AM PST, ID: 21614887
[x]
Attachment Details

Export Active Directory Group Membership to a text file

Asked by stefanjoc in Windows NT Networking

Tags: , , , ,

I have found a script here on Experts-Exchange which was kindly posted by BlueDevilFan.

I have made some very minor changes to it, but what I want it to do is prompt the user to enter the Domain and Group fields via a prompt input box.

the fields are

strDomain
strGroup

Can anyone help me out.  I have given it 500 points because it is quite urgent.

'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"
Start Free Trial
[+][-]11.01.2005 at 03:53AM PST, ID: 15199281

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows NT Networking
Tags: group, export, directory, active, members
Sign Up Now!
Solution Provided By: sirbounty
Participating Experts: 6
Solution Grade: A
 
 
[+][-]11.01.2005 at 05:47AM PST, ID: 15199853

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.01.2005 at 06:12AM PST, ID: 15200048

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32