Solved

Help with a script

Posted on 2011-03-01
4
287 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
Comment Utility
0
 
LVL 27

Expert Comment

by:KenMcF
Comment Utility
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
Comment Utility
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
Comment Utility
My solution was simple and was what I needed.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Hi all.   The other day I had to change the passwords for a bunch of users on the fly. Because they were so many, I decided to do it in an automated way and I would like to share it with you all.   If you are not doing it directly in a Domain Co…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

14 Experts available now in Live!

Get 1:1 Help Now