I need a script to display first names, last names and logon names of active directory users.

Posted on 2008-09-29
Medium Priority
Last Modified: 2011-08-18
I need to produce a report in excel that will give a sortable list of first names, last names and logon names of active directory users.
Question by:automaton64
LVL 33

Expert Comment

ID: 22598351
From a DC, run this command:
dsquery user domainroot -limit 0 | dsget user -dn -fn -ln   >c:\list.txt

That will create the output in a textfile that can be brought into XLS.
LVL 22

Accepted Solution

Paka earned 800 total points
ID: 22598411
Mike almost had it:
dsquery user -limit 0 | dsget user -samid -fn -ln > c:\list.txt

Author Closing Comment

ID: 31501252
Thank you.

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The Windows Firewall provides an important layer of protection and a rich interface to configure it. Unfortunately, it lacks item level filtering. This article details my process of implementing firewall-as-code to reduce GPO bloat.
In this article, we will discuss how you can secure Active Directory using free tools, and how you can choose a safe and secure Active Directory security auditing tool.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

622 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