Microsoft
Software
Hardware
Network
Question : Printing Active Directory
Is there a way to print out the groups and/or users from active directory? Is there a file with a list maybe?
Answer : Printing Active Directory
Copy all AD users to a text file
From
http://www.experts-exchang
e.com/Oper
ating_Syst
ems/
Q_2069
8009.html#
9073544
Being a scripting nut, I tend to approach these kind of problems from a scripting standpoint.
copy and paste the code below into "Mattisastud.vbs" and then run it.
Then open the GroupMembership.txt file and it should have everything you need.
If you want to view the machine accounts also, uncomment the commmented line...
-=-=-=-=-=-=-=-=-=-=-=-=-=
- Code Below -=-=-=-=-=-=-=-=-=-=-=-=-=
-
Dim myNetwork
Set myNetwork = CreateObject("Wscript.Netw
ork")
strDomain = myNetwork.UserDomain
Set objDomain = getobject("WinNT://" & strDomain) 'Grab the domain object
objDomain.filter = Array("Group") 'Filter for just computers.
Dim myFSO
Set myFSO = CreateObject("Scripting.Fi
leSystemOb
ject")
Set myFile = myFSO.CreateTextFile("Grou
pMembershi
p.txt",1)
myOutput = ""
For each objGroup in objDomain
myOutput = myOutput & objGroup.Name & vbcrlf
For Each objUser in objGroup.Members
' myOutput = myOutput & vbtab & objUser.Name & vbcrlf
If right(objUser.name,1) <> "$" Then
myOutput = myOutput & vbtab & objUser.Name & vbcrlf
End if
Next
Next
WScript.Echo myOutput
myfile.writeline myOutput
-=-=-=-=-=-=-=-=-=-=-=-=-=
- End Code -=-=-=-=-=-=-=-=-=-=-=-=-=
-
CREDIT To :MAT
*****Other Links*****
How can I create a file containing all the user names in my domain?
http://www.jsiinc.com/subl
/tip5500/r
h5531.htm
How can I produce a list of the user logon names in my domain?
http://www.jsiinc.com/subi
/tip4400/r
h4490.htm
Run a Group/User or User/Group report.
http://www.jsiinc.com/SUBB
/tip0700/r
h0748.htm
Random Solutions
How do I expand wireless coverage, beyond a single access point's range, to encompass a large house (or office).
CISCO 678 and Linksys WRT54G (WAP/router) Port Forwarding Help
Why are my agents behaving differently since we migrated our Notes server from Windows 2003 to an AS/400?
How to Connect two or more computers wirlessly !!
adptec, HP dlt vs80 nw4.2
Router - Best bang for your buck
Using Netware Server to host home directories on other OS's.
how much difference in speed between cable and dsl?
Heap size on tomcat 6
Mobile Broadband disconnects using Windows 7, Windows Live mail with GMail - why