Solved

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

Posted on 2011-02-23
5
1,351 Views
Last Modified: 2012-05-11
Powershell script / Quest commandlets that will pull all user email addresses from an active directory OU and export to .csv??
0
Comment
Question by:mjm21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:KenMcF
ID: 34960696
You can use this

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

Assisted Solution

by:Krzysztof Pytko
Krzysztof Pytko earned 40 total points
ID: 34960701
Try this

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

Regards,
Krzysztof
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 34960704
@Ken: this time I see that I also have good PowerShell syntax ;)
0
 

Author Comment

by:mjm21
ID: 34961534
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
 
LVL 27

Accepted Solution

by:
KenMcF earned 460 total points
ID: 34961669
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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
A hard and fast method for reducing Active Directory Administrators members.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

729 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