Clicky

Hi Experts
I am looking the PowerShell script to quarry the user list and email address from our AD in CVS format. We have multiple users OU in our environment.  
Please advise me how to quarry from Hyena v7.1 tools as well or what the best resource to review the quarry in AD.
Thanks in advance.

asked 10/24/2011 11:12

Jey_P's gravatar image

Jey_P ♦♦


7 Answers:
I would use powershell and the free quest adcmdlets


get-qaduser -sizelimit 0 | Select Name, Samaccountname, mail | export-csv c:\temp\userlist.csv

Or if you want to target a single OU


get-qaduser -searchroot "OU=All_Users,DC=Domain,DC=Local" -sizelimit 0 | Select Name, Samaccountname, mail | export-csv c:\temp\userlist.csv

You only need -sizelimit 0 if you have more than 1000 users.
link

answered

KenMcF's gravatar image

KenMcF

Thanks for the quick response. Does this script  quarry the full name ( first and last name)  and email.?

link

answered 2011-10-24 at 19:18:10

Jey_P's gravatar image

Jey_P

Yes, Name will get the display name of each user. If you want first and last seperate you can do this

get-qaduser -sizelimit 0 | Select FirstName, LastName, mail | export-csv c:\temp\userlist.csv -notype
link

answered 2011-10-24 at 19:31:05

KenMcF's gravatar image

KenMcF

Thanks again .I have an error message, when I use the script. Please help us to make success
link

answered 2011-10-24 at 19:35:18

Jey_P's gravatar image

Jey_P

it would help to post the error.
link

answered 2011-10-25 at 09:15:07

KenMcF's gravatar image

KenMcF

get-qaduser -sizelimit 0 | Select-Object sAMAccountName, FirstName, LastName, mail | export-csv c:\temp\userlist.csv -notype


I usually do a select-object and include the user login name (samccountname).
The above worked for me, when I tested.
link

answered 2011-10-25 at 09:17:58

gs121's gravatar image

gs121

there were not fully resolved.
link

answered 2011-11-28 at 13:44:30

Jey_P's gravatar image

Jey_P

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 10/24/2011 11:12

Seen: 198 times

Last updated: 12/15/2011 05:50

Related questions