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

x
?
Solved

Dsquery User | Dsget User II

Posted on 2009-05-11
2
Medium Priority
?
3,384 Views
Last Modified: 2012-05-06
I need to output from AD to excel all my users in this format.

LASTNAME, FIRSTNAME MI ( with the comma after the lastname )

0
Comment
Question by:CMILLER
[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
  • 2
2 Comments
 
LVL 9

Expert Comment

by:vsg375
ID: 24360302
Hi,

Try this :

    dsquery user -name *  | dsget user -ln -fn >
    users.txt

You don't care about the kind of separator, since Excel will be able to deal with it, whether comma, tab or other.

If you absolutely need a comma for presentation purposes, you can add it afterwards in your Excel sheet.

Hope this helps
Cheers
0
 
LVL 9

Accepted Solution

by:
vsg375 earned 2000 total points
ID: 24360312
Sorry, I added a carriage return. Of course the whole query stands in one line...

dsquery user -name *  | dsget user -ln -fn  > users.txt
0

Featured Post

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.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

688 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