RSS

No Import Contacts to Office 365 OWA Shared-Mailbox — Use Powershell

07 Aug

I was wanting to import a CSV file of contacts into the contacts folder of a Shared Mailbox and using OWA (Outlook Web App) to do so. Normally one goes to wheel->Import-Contacts, supply the file name, and success…

OWA Import-Contacts menu     OWA Import-Contact window

In OWA it’s possible to open a Shared Mailbox if you have the rights to do so (use the menu with your name and select “Open another mailbox…”). However if you try this it fails with a 403 error. Shame.

OWA Import-Contact fails if opened Shared Mailbox
(Failing URL is https://outlook.office365.com/ecp/tmp-contact-import1@example.com/PersonalSettings/ImportContactList.aspx)

Of course PowerShell comes to the rescue. Office 365 has a cmdlet Import-ContactList (help). Connect PowerShell to Office 365 in the normal way and call that cmdlet specifying the user to import to and the CSV and it does the job.

PS C:\temp> Import-ContactList -Identity tmp-contact-import1@example.com -CSV -CSVData ([System.IO.File]::ReadAllBytes(‘Antony_no_groups.csv’)) -Verbose
VERBOSE: Importing contacts to mailbox “tmp-contact-import1@luma-it.com”.RunspaceId       : bdf8902b-e858-44ba-a8ee-368fc809f6c2
ContactsImported : 136
Identity         : tmp-contact-import1
IsValid          : True
ObjectState      : New

PS C:\temp>

The Contact folder for the Shared Mailbox is now full:

OWA contacts

Advertisements
 
Leave a comment

Posted by on August 7, 2014 in Office 365

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: