Solved

Help with a script

Posted on 2011-03-01
4
295 Views
Last Modified: 2012-05-11
Need help writing a powershell script that will list smtp and alias of users in an OU
0
Comment
Question by:imy2000
[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
4 Comments
 
LVL 29

Expert Comment

by:QPR
ID: 35013474
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 35013547
You can use the Quest AD cmdlets and do this, not sure the format you need.


$u = get-qaduser -searchroot "OU=UsersOOU,DC=Domain,DC=Local" 
$u | %{
"$($_.name)"
"`t $($_.mail)"
Foreach ($add in ($_).proxyaddresses){
If ($add -match "smtp:"){
$add = $add -replace "smtp:", ""
"`t $($add)"
}}}

Open in new window

0
 

Accepted Solution

by:
imy2000 earned 0 total points
ID: 35322578
I wrote the script myself:
import-Csv -path 'c:\temp\xxxx.txt' | %{get-QADUser -Identity $_.ID -IncludedProperties mail,mailnickname } | Select name,dn,mail,mailnickname | export-CSV -notype -path c:\temp\results.csv
0
 

Author Closing Comment

by:imy2000
ID: 35360774
My solution was simple and was what I needed.
0

Featured Post

Ready to trade in that old firewall?

Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 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