Solved

Powershell script to export SAMaccount name based on input file containing primary SMTP address

Posted on 2013-10-29
2
890 Views
Last Modified: 2013-10-29
Hi All

I have been given a csv file that contains primary SMTP addresses for users on our Exchange 2010 servers.

I need a way to use that csv file as an input and export the samaccountname too.

Thanks
0
Comment
Question by:ncomper
[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 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39608571
Try..
Import-Csv C:\input.csv | Select SMTP,@{N="SamAccountName";e={(Get-Mailbox $_.SMTP).SamAccountName}} | Export-Csv C:\report.csv -NTI

Open in new window

input.csv format..
smtp
subsun@ee.com
ncomper@ee.com

Open in new window

0
 
LVL 5

Author Closing Comment

by:ncomper
ID: 39608772
Excellent, Thanks again
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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