I am attempting to write a script to import and keep up to date contacts from our CRM system in O365 contacts databases (primarily so that the iPhone contacts contact up to date copies of our business contacts).
I have scripted connecting to O365 as an admin user and confirmed that it works. The problem comes when I try to import a test CSV file.
When I run
Import-ContactList -CSV -CSVData ([System.IO.File]::ReadAllBytes("C:\tmp\contacts.csv")) -Identity <userid>
I get this error
An error occurred while saving a contact to the mailbox. Please contact your email admin. The failure
occurred while importing contact number 1 from the file. Contacts imported: 0.
+ CategoryInfo : NotSpecified: (Rob Butterworth:ADUser) [Import-ContactList], InternalErrorSa
vingContactException
+ FullyQualifiedErrorId : [Server=DB3PR02MB234,RequestId=0697ccc1-e30f-4437-8c43-7888834b72cb,TimeStam
p=09/02/2015 10:01:28] [FailureCategory=Cmdlet-InternalErrorSavingContactException] 869DAEC2,Microsoft
.Exchange.Management.Aggregation.ImportContactList
+ PSComputerName : outlook.office365.com
I have no idea where to look to debug this. I have tried both as an admin user with delegated access to the mailbox in question and as the user of this mailbox itself.
Rob