Solved

Help with a script

Posted on 2011-03-01
4
293 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
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…

713 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