Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to export users from active directory 2003??

Posted on 2008-10-14
13
Medium Priority
?
5,865 Views
Last Modified: 2008-10-14
I have about 1600 users and i need to get a copy of their usernames and full names from active directory.  how can i export a list like this??
0
Comment
Question by:amoos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 11

Expert Comment

by:Bertling
ID: 22711734
CSVDE is what you are after for this, this is a good link to work with http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Export.htm
0
 
LVL 13

Expert Comment

by:martin_babarik
ID: 22711755
Hello, you can use a command like the following one:
DSQUERY USER DC=YOURDOMAIN,DC=COM -SCOPE SUBTREE | DSGET USER -FN -LN -DISPLAY

You can find more of the options that can be displayed by entering the command DSGET USER /?
There is a list of attributes like -UPN, -SAMID, -OFFICE etc.

Don't forget to replace the string DC=YOURDOMAIN,DC=COM with the real name of your domain.
Also if you want to get a textual output, you can redirect it to a text file like that:

DSQUERY USER DC=YOURDOMAIN,DC=COM -SCOPE SUBTREE | DSGET USER -FN -LN -DISPLAY > C:\my_users_list.txt
HTH

Regards
Martin
0
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22712894
1.You can install the Windows 2003 support tools (free download from Microsoft Website) and use DSQUERY USER  OU=Test,dc=TEST,dc=LOCAL  -O UPN

2.If you have powershell you can install the quest tools for free http://www.quest.com/powershell/

Command would be
Get-QADGroup "Group Name" | %{$_.Members}

3.Check out here:
http://www.computerperformance.co.uk/Logon/CSVDE_LDIFDE.htm
http://support.microsoft.com/kb/555634
http://support.microsoft.com/kb/555637

4.Use LDIFDE or CSVDE.

c:\>ldifde -d "BASE DN" -r "(objectClass=user)" -f export.ldf
c:\>ldifde -i -f inport.ldf

c:\>csvde -d "BASE DN" -r "(objectClass=user)" -f export.csv
c:\>csvde -i -f inport.csv
You can also use dsquery,dsget,dsadd,dsmod for scripting.
ref the help url for CSVDE

http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Export.htm

This will be a simple export
CSVDE -d "OU=Newport,DC=cp,dc=com" -f file.csv.
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 

Author Comment

by:amoos
ID: 22715996
all-right it seems to work fine and is giving me the results that i am looking for but since i have 1600 users i need this information for it is giving me a limit error.  below is the error i am getting

Dsquery has reached the default limit of 100 results to display; use the -limit option to display more results

so i add at the end of the query -limit 2000 and then it gives me the error again.  how do i fix this???  awesome help
0
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22716074
1.I think their a limitation on number of objects that you can query from the DC in a single go.This has been done purposefully keeping mind about the performance of the DC.Below article is somewhat similar to your situation.But I wouldn't recommend you to change the registry
http://support.microsoft.com/kb/262848

but you can try this,
DSQUERY USER  OU=Test,dc=TEST,dc=LOCAL  -limit 2000 >C:\UsersCN.txt

0
 

Author Comment

by:amoos
ID: 22716085
also how would i write a query to get members in a particular OU??  awesome help
0
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22716095
or try this,
DSQUERY USER  OU=Test,dc=TEST,dc=LOCAL  -limit 0 >C:\UsersCN.txt

You have to use the limit option with 0 (zero):

-limit <NumObjects>         Specifies the number of objects matching the
                            given criteria to be returned, where <NumObjects>
                            is the number of objects to be returned.
                            If the value of <NumObjects> is 0, all
                            matching objects are returned. If this parameter
                            is not specified, by default the first
                            100 results are displayed.
0
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22716121
You can probably user CSVDE command,
 For example, suppose you only wish to export one OU and not the whole Active Directory domain.  

Command: CSVDE -d "OU=ou name,DC=cp,dc=com" -f Newport.csv.
What the -d filter does is focus the export on one particular area.
If you try this filter, make sure you substitute your OU for ou name and your domain for dc=cp.  Observe carefully the syntax with those speech marks and commas between the elements.  Avoid the trap of being so concerned with the -d switch that you forget the -f filename.csv.

Ref the below links for more options,
http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Export.htm
http://www.computerperformance.co.uk/Logon/Logon_LDIFDE_Export.htm

0
 

Author Comment

by:amoos
ID: 22716166
awesome.  i used the query DSQUERY USER  OU=Test,dc=TEST,dc=LOCAL  -limit 0 >C:\UsersCN.txt  and it worked fine but the results that were displayed were in the format of cn=username,ou=ou name,dc=etc...  how do i get it to display the same results as if i used the dsget user command??
0
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22716262
press Ctrl-a and copy all the contents from the text file and paste in a excel file....there you can edit the required information (if you are good in excel)
0
 

Author Comment

by:amoos
ID: 22716405
awesome it all works.  now the last question is when i run these queries do any of the queries delete or mess up anything in active directory??  meaning if i run these queries on the live DC is it going to delete my AD??
0
 
LVL 18

Accepted Solution

by:
sk_raja_raja earned 2000 total points
ID: 22716655
No not at all.....all these queries are safe ro run, but please make sure you understand the query syntax and its switches and then executed any commands against AD...its a good practice to follow
0
 

Author Comment

by:amoos
ID: 22716755
awesome thank you so much for your help
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question