0
votes

I would like to batch import contacts from a CSV file to a public folder located on an Office 365 / Exchange Online server.

There is a wonderful PowerShell script from Microsoft that does the same in an on premises environment using EWS (Exchange Web Services): http://gallery.technet.microsoft.com/office/Import-Contacts-to-a-08e6ffd7

Is there a way to get this to work with Office 365?

What I tried

This is how I tried to connect to the Webservice, resulting in an error:

$cred = get-credential
Connect-MsolService -Credential $cred

Import-Module .\ImportOSCEXPFContact.psm1
Connect-OSCEXWebService -Credential $cred -Force

Error returned (translated from German):

Connect-OSCEXWebService : Error calling "AutodiscoverUrl" with 2 arguments:  "The Autodiscover service couldn't be located."
On Line:1 Character:24
+ Connect-OSCEXWebService <<<<  -Credential $cred -Force
+ CategoryInfo          : NotSpecified: (:) [Connect-OSCEXWebService], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException,Connect-OSCEXWebService

Anyone might help out or knows if that could work at all?

Thanks for help! Aaron

1

1 Answers

0
votes

Made it!

I modified a Script by Steve Goodman to do so. Here is the code if you need to do the same:

https://web.archive.org/web/20160730070630/http://pastie.org/8489637