Solved

Dsquery User | Dsget User II

Posted on 2009-05-11
2
3,344 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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 …

751 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