Monday, 5 November 2012

Modify Exchange 2010 Mail Contact Address With Powershell

Say you've imported a CSV of 100+ addresses using a supplied list then it turns out they've got the domain name wrong.  Look no further.

Save this to a ps1 and use EMS as an admin and bosh!


$contacts = Get-MailContact -Filter {ExternalEmailAddress -like '*WRONGDOMAIN.com*'} </i><br />
<i>$contacts | foreach-object {$_ | set-mailcontact -externalemailaddress ($_.externalemailaddress.proxyaddressstring -replace "WRONGDOMAIN","RIGHTDOMAIN")}

No comments:

Post a Comment