User Reporting

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Is there anything in AD that will allow me to printout or
export a report of what users are in AD. I know about the
export on each OU and the whole domain but that gives me
computers as well. I only want to a specific report that
only lists users within the domain.
 
Steve,

You might want to take a look at ldifde or csvde or the newer ds tools.

With ldifde you can enter the following line at a command prompt and you
will be given an .ldf file which will contain only what you want:

c:\>ldifde -f users.ldf -s yourDC.yourdomain.com -t 389 -d
"DC=yourdomain,DC=com" -p subtree -r
"(&(objectCategory=person)(objectClass=user))"

This will create an .ldf file called 'users.ldf' located at c:\ and will
take all of the user accounts ( including some that you might not want, such
as Administrator and the like. To avoid this simply enter the -m switch
before the initial -f switch ) from your entire domain. It is going to bind
to the Domain Controller specified by the -s switch and will use the port
specified by the -t switch ( please note that both the -s and -t switches
are optional. If you do not specify them ldifde will default to the DC on
which you are running it and to port 389, the default ldap port ). The -d
switch tells ldifde where to start/what to include ( in layman's terms ).
The -d switch tells it to include the entire domain ( signified by the
"DC=yourdomain,DC=com". If you wanted only a specific OU, for example, you
would have entered -d "OU=yourOU,DC=yourdomain,DC=com" ). Finally, the -r
switch is the filter that ldifde uses. Since you wanted only the user
accounts and nothing else you use the -r
"(&(objectCategory=person)(objectClass=user))" filter. Had you wanted only
the computer accounts then you would use the filter -r
"(&(objectCategory=computer)(objectClass=user))". If you wanted only your
group accounts then you would enter the filter -r "(objectClass=group)".

Using csvde can give you the same results only that information can be taken
to an excel spreadsheet. If you prefer that rather than the .ldf files (
BTW - open the .ldf files with Notepad ) then csvde is your friend.

The newer ds tools are really neat. I have not played with them too much
but have recently taken a look t them and they are pretty neat.

HTH,

Cary
 
Is there anything in AD that will allow me to printout or
export a report of what users are in AD. I know about the
export on each OU and the whole domain but that gives me
computers as well. I only want to a specific report that
only lists users within the domain.

See tip 7980 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
You can use csvde to export to a comma-separated file and then import
to excel

To export all user and computer accounts
csvde -m -f user-and-computer-list.csv -r "(objectClass=user)" -p
Subtree -l samAccountName

To export all only user accounts
csvde -m -f user-list.csv -r
"(&(objectClass=user)(objectCategory=person))" -p Subtree -l
samAccountName

You can limit your search to a specific OU or Domain using -d

Example:
-d "ou=Sales,dc=lcab,dc=net"

regards
Johan Arwidmark

Windows User Group - Nordic
http://www.wug-nordic.net
 
Back
Top