Solved

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

Posted on 2014-01-10
4
491 Views
Last Modified: 2014-01-10
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
0
Comment
Question by:mjm21
4 Comments
 
LVL 1

Expert Comment

by:Jobgeor
ID: 39771838
Get-ADUser -Filter * -SearchBase 'DC=aaaaaaa, DC=com' -Properties DisplayName | Export-CSV "ADUsers.csv"
0
 
LVL 38

Expert Comment

by:Adam Brown
ID: 39771871
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
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 39771872
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
 

Author Comment

by:mjm21
ID: 39771914
Thanks Will ---- that did it....perfect!
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

OfficeMate Freezes on login or does not load after login credentials are input.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

947 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now