Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2009-04-22
Medium Priority
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

Expert Comment

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

Accepted Solution

Mike Kline earned 2000 total points
ID: 24204665
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
Scripts are great for performing batch jobs against users, however sometimes the GUI is all you need.
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

580 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