[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

AD quarry

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.

0
Jey_P
Asked:
Jey_P
  • 3
  • 3
1 Solution
 
KenMcFCommented:
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.
0
 
Jey_PAuthor Commented:
Thanks for the quick response. Does this script  quarry the full name ( first and last name)  and email.?

0
 
KenMcFCommented:
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
0
 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

 
Jey_PAuthor Commented:
Thanks again .I have an error message, when I use the script. Please help us to make success
0
 
KenMcFCommented:
it would help to post the error.
0
 
gs121Commented:
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.
0
 
Jey_PAuthor Commented:
there were not fully resolved.
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now