?
Solved

Dsquery User | Dsget User

Posted on 2009-05-11
6
Medium Priority
?
4,748 Views
Last Modified: 2012-05-06
I need a script that will output in a xls file the -LN, -FN -MI

I am using this but it will not output -LN, -FN -MI

C:\> dsquery user -limit 0 "OU=XXX,DC=XX,DC=XXX" | dsget user -ln -fn -mi -c

It outputs -FN -MI -LN, How do I get it in the order that I need it in?
0
Comment
Question by:CMILLER
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:Miele102
ID: 24357831
Hi
Try the sort.
C:\> dsquery user -limit 0 "OU=XXX,DC=XX,DC=XXX" | sort | dsget user -ln -fn -mi -c
0
 

Author Comment

by:CMILLER
ID: 24357888
Nope, didnt work.
0
 
LVL 57

Accepted Solution

by:
Mike Kline earned 2000 total points
ID: 24357901
another good tool for this is adfind by Joe Richards
http://www.joeware.net/freetools/tools/adfind/index.htm
adfind -b "OU=xxx,dc=xxx,dc=xxx" -f  "&(objectcategory=person)(objectclass=user)"  sn givenname initials -csv -nodn > c:\users.csv
That will create a csv file on your c drive
Thanks
Mike
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:CMILLER
ID: 24357969
That worked, Thanks.

Do you know if it would also output this way.

LASTNAME, FIRSTNAME MI

All in one cell with the comma after the lastname.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 24358110
interesting followup  not sure, you can add an extra comma

adfind -b "OU=xxx,dc=xxx,dc=xxx" -f  "&(objectcategory=person)(objectclass=user)"  sn %,% givenname initials -csv -nodn > c:\users.csv
 ...but I'm not sure about all in one cell
0
 

Author Comment

by:CMILLER
ID: 24358254
All it did was create a %,% column.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
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 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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

864 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