Powershell / QuestCommandlets script that would extract user account information to a .CSV File

Powershell / QuestCommandlets script that would extract user account information to a .CSV File.

These are the items:

"Job Title" for the system administrators only
"phone"    for the system administrators only
mjm21Asked:
Who is Participating?
 
Will SzymkowskiSenior Solution ArchitectCommented:
Use the below command to accomplish this...

import-module activedirectory
Get-ADUser -Filter * -Properties * | ? {$_.Title -like "*System*Administrators*"} | select Name, sAMAccountName, Title, OfficePhone, MobilePhone | out-file "c:\users.csv"

Open in new window


Will.
0
 
JobgeorCommented:
Get-ADUser -Filter * -SearchBase 'DC=aaaaaaa, DC=com' -Properties DisplayName | Export-CSV "ADUsers.csv"
0
 
Adam BrownSr Solutions ArchitectCommented:
This depends on how you're assigning system administrators. If you want to get info from Domain Admins, you would run a check against the domain admins group to see which users are in it, then pull data from those user accounts. Something like this should do it:

get-qadgroupmember "domain admins" | get-qaduser | select displayname,phonenumber,title | export-csv <location to save CSV file>

Open in new window

0
 
mjm21Author Commented:
Thanks Will ---- that did it....perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.