changing contacts domain
Hi,
I maintain a lot of email contacts for partner companies. One of those has just changed their email domain.
So their email address go from user@company.com to user@newcompany.com.
I'm using Exchange 2007.
Does anyone have a script that would allow me to change just these contacts email domain whilst leaving the 'user' part intact.
I have looked at using admodify, but that appears to leave the externalemailaddress field set to the original domain.
Thanks for any help
March 1st, 2011 7:09am
You definitely need a PowerShell script to do so.
What you could try to do is the following
$contacts = Get-MailContact | Where {$_.PrimarySmtpAddress -like
*@olddomain}
foreach($contact in $contacts){
$newmail = $contact.primarysmtpaddress.tostring()
$newmail = $newmail -replace "olddomain","newdomain"
Get-MailContact $contact | Set-MailContact -primarysmtpaddress $newmail -externalemailaddress $newmail
}
Free Windows Admin Tool Kit Click here and download it now
March 1st, 2011 8:07am
Hi Jim,
Above gave some good suggestion, please make some tests, if you still have some issue, please tell us.
Regards!
Gavin
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
tngfb@microsoft.com
Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
March 2nd, 2011 4:53am