Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1361
  • 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 PytkoSenior Active 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 PytkoSenior Active 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
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.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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