Bulk correcting of proxyAddresses for contacts

by Calis at 2013-03-17 22:28:47

Hi Guys, We we are using the old GALSYNC method of transporting approx 7000 contacts between exch orgs and some of the contacts come across with a blank SMTP proxyaddresses. Im having to go in and update these manually at the moment when a contact is found to be broken.

The “mail” and “targetAddress” attributes are being filled ok with all contacts.

What Im wanting to do is to be able to run a script against the contacts which will take the email address present in the “mail” attribute and add/modify it to “proxyAddresses” and set as the Primary email address.

Is this possible?

by IfiokM at 2013-03-18 13:01:41
Set-Mailbox userID -EmailAddresses SMTP:PrimaryEmailAddress,ProxyAddress1,ProxyAddress1, … -emailadresspolicyenabled $false
eg. Set-Mailbox ade.woodhead@exchangelab.local -EmailAddresses SMTP:ade.woodhead4@exchangelab.local,ade.head@exchangelab.local,ade.ibuoteto@exchangelab.local -emailaddresspolicyenabled $false

note that you must disable email address policy for it to work.
Also you can put the names in a csv file, import and pipe to the set-mailbox command for bulk update.

Import-CSV “C:\My Documents\users.csv” | ForEach {Set-Mailbox $.UserID -EmailAddress $.NewAddress,$.UserID,$.Proxyaddress1, $_.proxyaddress2, …}
by Calis at 2013-03-18 16:37:07
thanks mate, however these are contacts not mail box users.
should I be using the Set/Get- Mailcontact instead of Mailbox?
by IfiokM at 2013-03-18 21:36:49
Sure try it with set-mailcontact. It also has the -EmailAddresses parameter.
by Calis at 2013-03-19 21:58:44
thanks IfiokM that worked a treat. Still getting my head around PS.

I did run into a little problem however. The contacts im updating are sync’d to us from our parent company. When I run the scrip against them to make the changes I get the standard upgrade message:

"To save changes on object “contacts name”, the object must be upgraded to the current Exchange version."

Is there a way to bulk upgrade these contacts?

I tried another mentioned method of changing an attribute and then changing it back to upgrade but because these contacts dont have primary smtp addresses (hence this post) it gives an error that they are corrupted!

Seems im in a bit of a loose loose at the moment lol.