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
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,348 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In-place Upgrading Dirsync to Azure AD Connect
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

839 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