Chris Miller
asked on
Dsquery User | Dsget User
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?
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?
ASKER
Nope, didnt work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Do you know if it would also output this way.
LASTNAME, FIRSTNAME MI
All in one cell with the comma after the lastname.
interesting followup not sure, you can add an extra comma
adfind -b "OU=xxx,dc=xxx,dc=xxx" -f "&(objectcategory=person)( objectclas s=user)" sn %,% givenname initials -csv -nodn > c:\users.csv
...but I'm not sure about all in one cell
adfind -b "OU=xxx,dc=xxx,dc=xxx" -f "&(objectcategory=person)(
...but I'm not sure about all in one cell
ASKER
All it did was create a %,% column.
Try the sort.
C:\> dsquery user -limit 0 "OU=XXX,DC=XX,DC=XXX" | sort | dsget user -ln -fn -mi -c