AD Query - Getting Usernames , Emails , Etc with DSQUERY | DSGet

Posted on 2009-04-22
Last Modified: 2012-05-06
Hi !
Our forestroot has around 15k or more users...
im trying to create a simple dsquery in order to get a full list of all the users , including first name , last name , email , pager , employee id...

im trying

dsquery user forestroot -limit 0 | dsget user -fn -ln -email -empid -pager >> emp.txt

however - the file keeps empty , if ill do it on a certain user using the search scope i.e *mark* - i will get all users who contain Mark , however - i cant do it on "all users"
is there a limitation? is there a way i can do it on all my 15k users?

Question by:m0tek
    LVL 6

    Expert Comment

    What if you set the limit to 1000? Does the file fill? (15k users might just take longer then expected?)
    LVL 57

    Accepted Solution

    Have to test out the dsquery/dsget
    Can you give adfind a try  - great tool by Joe Richards
    adfind -default -f  "&(objectcategory=person)(objectclass=user)" samaccountname givenname sn mail pager  -nodn -csv > c:\Allusers.csv
    that will produce a csv of all your users on the C drive

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I know all systems administrator at some time or another has had to create a script to copy file from a server share to a desktop. Well now there is an easy way to do this in Group Policy. Using Group policy preferences is not hard. The first thing …
    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    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…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now