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,341 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
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:KenMcF
Comment Utility
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
Comment Utility
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
Comment Utility
@Ken: this time I see that I also have good PowerShell syntax ;)
0
 

Author Comment

by:mjm21
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I'm sure that every Windows systems administrator has written, or at least used, a batch or VBS login script at some point in their career, whether it is to map network drives, install printers, or set some user preferences.  No more! With Window…
Do you have users whose passwords are expiring and they are constantly calling you?  Well I sure did and needed a way to put an end to this.  We have a lot of remote users which would not be notified that their passwords were expiring since they wer…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now