Go Back   Computer Forums > General Computing > Server Administration
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-24-2006, 02:36 PM   #1
Solid State Member
 
Join Date: May 2006
Posts: 14
Default How to get a list of users in Active Directory?

Hello all, I am trying to get a list of all the users and the groups they belong to within our OU...

I recall a long while back when I was using Server 2000 that I had to do some type of text file creation through the command prompt to get the list, but I am hoping that within Server 2003 that there is an easier way to print the list of users.

Is there a simple way in 2003 to get a list of users and their group memberships in the AD? Or if the manual command prompt way is the only way to do it, can someone tell me the steps? Thanks.
__________________

Gorilla Pound is offline   Reply With Quote
Old 05-24-2006, 03:18 PM   #2
Daemon Poster
 
uid=[0]'s Avatar
 
Join Date: Apr 2006
Posts: 906
Send a message via Yahoo to uid=[0]
Default Re: How to get a list of users in Active Directory?

Try this, and see if that works.

Quote:
Option Explicit

Dim objDSE, strDefaultDN, strDN, objContainer, objChild

Set objDSE = GetObject("LDAP://rootDSE")
strDefaultDN = "CN=Users," & objDSE.Get("defaultNamingContext")

strDN = InputBox("Enter the distinguished name of a container" & _
vbCrLf & "(e.g. " & strDefaultDN & ")", , strDefaultDN)

If strDN = "" Then WScript.Quit(1) 'user clicked Cancel

Set objContainer = GetObject("LDAP://" & strDN)

objContainer.Filter = Array("user")
For Each objChild In objContainer
WScript.Echo objChild.Name & vbTab & objChild.Description
Next
That will list all the users in one container.
__________________

__________________
"Security is nothing more than a thought that makes you sleep well at night." - Me
MCSE/MCSA
Security+/Network+
Wireless Network Security Spec.
uid=[0] is offline   Reply With Quote
Old 05-24-2006, 03:33 PM   #3
Solid State Member
 
Join Date: May 2006
Posts: 14
Default Re: How to get a list of users in Active Directory?

I'm sorry for sounding amateurish on this particular issue, but what do I do with that?
Gorilla Pound is offline   Reply With Quote
Old 05-24-2006, 04:28 PM   #4
Daemon Poster
 
uid=[0]'s Avatar
 
Join Date: Apr 2006
Posts: 906
Send a message via Yahoo to uid=[0]
Default Re: How to get a list of users in Active Directory?

Its a VBScript. Copy paste that into a txt document. then Save As blah.vbs but make sure you edit that script to fit your needs(Domain etc..)
__________________
"Security is nothing more than a thought that makes you sleep well at night." - Me
MCSE/MCSA
Security+/Network+
Wireless Network Security Spec.
uid=[0] is offline   Reply With Quote
Old 05-25-2006, 12:44 PM   #5
Solid State Member
 
Join Date: May 2006
Posts: 14
Default Re: How to get a list of users in Active Directory?

Quote:
Originally Posted by uid=[0]
Its a VBScript. Copy paste that into a txt document. then Save As blah.vbs but make sure you edit that script to fit your needs(Domain etc..)
Gotcha. Thank you very much for your help, I will try that. Now where exactly would I save it...and once saved as a txt file, how would it run or be executed?
Gorilla Pound is offline   Reply With Quote
Old 05-25-2006, 01:45 PM   #6
Daemon Poster
 
uid=[0]'s Avatar
 
Join Date: Apr 2006
Posts: 906
Send a message via Yahoo to uid=[0]
Default Re: How to get a list of users in Active Directory?

save the text to a .txt file. then Save As blah file type "All files" then type it in the save dialog as blah.vbs Once you do that, just double click on it, and it will run it.
__________________
"Security is nothing more than a thought that makes you sleep well at night." - Me
MCSE/MCSA
Security+/Network+
Wireless Network Security Spec.
uid=[0] is offline   Reply With Quote
Old 05-28-2006, 11:35 AM   #7
Golden Master
 
DJ-CHRIS's Avatar
 
Join Date: Apr 2006
Posts: 5,203
Send a message via AIM to DJ-CHRIS Send a message via MSN to DJ-CHRIS Send a message via Yahoo to DJ-CHRIS
Default Re: How to get a list of users in Active Directory?

Quote:
Originally Posted by Gorilla Pound
Hello all, I am trying to get a list of all the users and the groups they belong to within our OU...

I recall a long while back when I was using Server 2000 that I had to do some type of text file creation through the command prompt to get the list, but I am hoping that within Server 2003 that there is an easier way to print the list of users.

Is there a simple way in 2003 to get a list of users and their group memberships in the AD? Or if the manual command prompt way is the only way to do it, can someone tell me the steps? Thanks.
Running usrmgmt should give you a list, but it will not givetell you what their permissions are.
__________________

DJ-CHRIS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:12 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0