Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print list of Users

Status
Not open for further replies.

Mickeyncube

Technical User
May 29, 2003
91
0
0
GB
Hi Guys

How do I automatically print a list of users in an OU? We have 4 OU's each with about 200+ users. I've been tasked with producing a list of users from one of these Ou

so what's the best way to do this?

Thanks in advance
 
You can simply right click on the OU and choose export, This will export it to a txt file which you can then print
 
Script it. Here is an example of one that I did.

Dim objList,ObjUser,strUserName
strGroup = "Your OU"
Set objRootDSE = GetObject("LDAP://RootDSE")
strDomain = objRootDSE.Get("defaultNamingContext")
Set objList = GetObject("LDAP://OU=" & strGroup &","& strDomain)
Set ObjUserName = objList.Members
For Each ObjMember In ObjUserName
Wscript.Echo ObjMember.cn
Next

MsgBox "done!"

I would run it in cscript (command line) and pipe it out to a .txt file

(ex. cscript groups.vbs >users.txt)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top