I found a fix that I am trying to run but having issues. When I enter the second line in Powershell I get the error below. I have a number of contact records that sync via sf.com in outlook, not sure if that is the issue. If you can help me fix the command, so I can change these records from "Other" to a phone field that iphone(Activesynce) will sync, like mobile or pager. I don't want it to replace the current mobile telephone number just categorize it. Thanks!
$outlook = new-object -com outlook.application
$contacts = $outlook.Session.GetDefaultFolder(10)
$contacts.Items | % { if($_.MobileTelephoneNumber -eq "") { $_.MobileTelephoneNumber = $_.OtherTelephoneNumber; $_.OtherTelephoneNumber = ""; $_.save() } }
ERROR
You cannot call a method on a null-valued expression. At line:1 char:1 + $OutlookContacts = $Outlook.session.GetDefaultFolder(10).items + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull