About
Pricing
Community
Teams
Start Free Trial
Log in
jduclosjduclos
asked on
3/13/2012
Active Directory Query
I need to run a query in Active Directory that will retrieve user's first name, last name and their account login name and export it to a csv file.
Active Directory
5
1
Last Comment
jduclosjduclos
8/22/2022 - Mon
KenMcF
3/13/2012
I would use powershell and the free Quest cmdlets
get-qaduser -sl 0 | Select FirstNAme, LastName, Samaccountname | Export-csv c:\temp\users.csv -notype
ASKER CERTIFIED SOLUTION
Mike Kline
3/13/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
dave_it
3/13/2012
Using the native 2008 R2 AD cmdlets:
get-aduser -identity "xxxxxxx" -properties * | Select-Object samAccountName,givenname,s
urname | Export-CSV c:\temp\userid.csv
Leon Fester
3/13/2012
I'm a ldifde and csvde man myself, both are tools from Microsoft and available in the Windows resource kit
ldifde -f Exportuser.ldf -d "dc=Export,dc=com" -p subtree -r "(&(objectCategory=person)
(objectCla
ss=User)(g
ivenname=*
))" -l "cn, sAMAccountName"
ldifde -f Exportuser.ldf -d "dc=Export,dc=com" -p subtree -r "(&(objectCategory=person)
(objectCla
ss=User)(g
ivenname=*
))" -l "givenName, sn, sAMAccountName"
http://support.microsoft.com/kb/237677
CSVDE -f export3.csv -l "cn, samAccountName"
CSVDE -f export3.csv -l "givenName, sn, samAccountName"
http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Export.htm
Your help has saved me hundreds of hours of internet surfing.
fblack61
jduclosjduclos
3/13/2012
ASKER
Thank you!!
get-qaduser -sl 0 | Select FirstNAme, LastName, Samaccountname | Export-csv c:\temp\users.csv -notype