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

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

Powershell script / Quest commandlets that will pull all user email addresses from an active directory OU and export to .csv?

Powershell script / Quest commandlets that will pull all user email addresses from an active directory OU and export to .csv??
0
mjm21
Asked:
mjm21
  • 2
  • 2
2 Solutions
 
KenMcFCommented:
You can use this

get-qaduser -searchroot "OU=USERS_OU,DC=Domain,DC=Local" | Select mail | Export-csv c:\email.csv
0
 
Krzysztof PytkoActive Directory EngineerCommented:
Try this

Get-QADuser -SearchRoot "ou=OULevel,dc=Yourdomain,dc=local" -sizelimit 0 | Select sAMAccountName,mail | Export-Csv c:\export.csv

Regards,
Krzysztof
0
 
Krzysztof PytkoActive Directory EngineerCommented:
@Ken: this time I see that I also have good PowerShell syntax ;)
0
 
mjm21Author Commented:
Great this works, but how do I get a web page as well?  This is located on the general tab of the properties of a user account. Will this work?
0
 
KenMcFCommented:
You can add wwwHomePage to either example that iSiek or mayself posted.

get-qaduser -searchroot "OU=USERS_OU,DC=Domain,DC=Local" | Select mail,wwwhomepage | Export-csv c:\email.csv

Get-QADuser -SearchRoot "ou=OULevel,dc=Yourdomain,dc=local" -sizelimit 0 | Select sAMAccountName,mail, wwwHomePage | Export-Csv c:\export.csv
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

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