I am getting NDR due to contact being synced with my organization that are not compatible with Exchange 2010. I figured out that it is a version mismatch. So my idea was to write a script and run it weekly to locate incompatible contacts and upgrade them.
This is the command I wrote to locate the contact:
get-mailcontact -resultsize unlimited | where {$_.ExchangeVersion -eq "0.0 (6.5.6500.0)"} >C:\NDR.CSV
This is my fix for a single user account
get-mailcontact myemail@help.com | set-mailcontact -customattribute1 "Always" -ForceUpgrade -Confirm:$False
get-mailcontact myemail@help.com | set-mailcontact -customattribute1 $null
Of course that does not work for bulk. So this is what I came up with but I am not for sure. Unfortunately I am at a point where I am stuck.
$CorruptContact = get-mailcontact -resultsize unlimited | where {$_.ExchangeVersion -eq "0.0 (6.5.6500.0)"}
$CorruptContact | ForEach-Object {set-mailcontact -customattribute1 "Always" -ForceUpgrade -Confirm:$False}
$CorruptContact | ForEach-Object {set-mailcontact -customattribute1 $null}
Any help would be greatly appreciated,
Dennis