Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with a script

Posted on 2011-03-01
4
Medium Priority
?
297 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article will help you understand what HashTables are and how to use them in PowerShell.
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

721 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