Set new Primary SMTP-addresses from csv file

Exchange Server administration forum
Post Reply
ManU
Founder
Founder
Posts: 98
Joined: Sat Sep 26, 2009 9:57 am
Location: India
Contact:

Set new Primary SMTP-addresses from csv file

Post by ManU » Wed Dec 09, 2009 5:26 pm

Here is a simple script that sets new Primary SMTP-addresses for existing users from a csv file

$file = $Args[0]
cls
write-host 'This script sets primarySMTP-address on a mailbox in
Exchange'-foregroundcolor "yellow"
write-host 'File to be imported: ' $file -foregroundcolor "yellow"
write-host $file
$Csv = Import-Csv $file
$Csv | ForEach-Object -Process {set-Mailbox -identity $_.TargetAddress
-EmailAddressPolicyEnabled $false -Primarysmtpaddress $_.targetAddress}
Thanks
MANU PHILIP
Microsoft MVP(Exchange Server)
| MCITP | MCTS | MCSA | ITIL V3 |
TechNet Forums Profile: ManU

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest