How to edit multiple mail contact with EMS
Hi, I need to change few hundred mail contact(external e-mail address) because their provider has changed domain name. I have this situation: example01@domain.com example02@domain.com example03@domain.com ... and I need change to: example01@something.com example02@something.com example03@something.com .... I tried with command Set-MailContact but only for single edit. Windows Server 2008R2 SP1 and Exchange 2010 SP1 is my configuration. I have solution with other tools, but with EMS I get stuck.
May 30th, 2011 3:58am

The easiest and probably fastest way would be to (1) Export your Contacts from the EMC (or from the EMS if you have experience with Export-Csv) (2) Do a search and replace in Notepad (3) Delete the Contacts with the EMC (4) Import the Contacts with the EMS (PowerShell) How to Import CSV Contacts to Exchange 2010 http://msgsense.com/2011/01/20/how-to-import-csv-contacts-to-exchange-2010/ The alternative would be to use sting manipulation in PowerShell within a loop. The String’s the Thing http://technet.microsoft.com/en-us/library/ee692804.aspxMCTS: Messaging | MCSE: S+M
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 4:23am

I was thinking about this idea, but if I delete all contacts how to know which contact was in which distribution group? Thank you for link, I will check this tip.
May 30th, 2011 4:32am

Sorry for being immodest ... you could use my script: PowerShell command to list all distribution groups and members of those groups http://social.technet.microsoft.com/Forums/en/exchangesvradmin/thread/63ad55d1-1393-4533-8065-1d7cbd8657fa But perhaps sting manipulation would be a better idea in that case.MCTS: Messaging | MCSE: S+M
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 5:22am

Hi, Can we do it in EMC? Thanks.
May 31st, 2011 2:50am

Hi, Can we do it in EMC? Thanks.
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 9:48am

Thank you John for replay and excellent link. I am away this week and on Monday I will test this script and inform you about results.
May 31st, 2011 5:59pm

I think this will work: $contacts = get-mailcontact | where-object {$_.externalemailadderss.addressstring -match "domain\.com"} $contacts | foreach-object { $_ | set-mailcontact -externalemailaddress ($_.externalemailaddress.proxyaddressstring -replace "domain\.com","something.com") }[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 7:27pm

Thank you mjolinor, you helped me alot, but your script doesnt work for me without litle edit(first I tried to correct typing errors but anyway first part of script isn't working). This is tested and working script: $contacts = Get-MailContact -Filter {ExternalEmailAddress -like '*domain.com*'} $contacts | foreach-object {$_ | set-mailcontact -externalemailaddress ($_.externalemailaddress.proxyaddressstring -replace "domain.com","something.com")}
June 10th, 2011 11:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics