Avatar of jduclosjduclos
jduclosjduclos
Flag for United States of America asked on

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

Avatar of undefined
Last Comment
jduclosjduclos

8/22/2022 - Mon
KenMcF

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

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

Using the native 2008 R2 AD cmdlets:

get-aduser -identity "xxxxxxx" -properties * | Select-Object samAccountName,givenname,surname | Export-CSV c:\temp\userid.csv
Leon Fester

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)(objectClass=User)(givenname=*))" -l "cn, sAMAccountName"

ldifde -f Exportuser.ldf -d "dc=Export,dc=com" -p subtree -r "(&(objectCategory=person)(objectClass=User)(givenname=*))" -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

ASKER
Thank you!!