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-exchange.com/Operating_Systems/Q_20698009.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.Network")

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.FileSystemObject")
Set myFile = myFSO.CreateTextFile("GroupMembership.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/rh5531.htm

How can I produce a list of the user logon names in my domain?
http://www.jsiinc.com/subi/tip4400/rh4490.htm

Run a Group/User or User/Group report.
http://www.jsiinc.com/SUBB/tip0700/rh0748.htm
Random Solutions  
 
programming4us programming4us