msidnam
asked on
Export Contacts Exchange Online Powershell
I have a need to be able to export contacts for specific users using powershell. I've tried the scripts here but the don't seem to work:
https://community.spiceworks.com/topic/2155223-powershell-office-365-export-user-s-contacts-to-csv
https://gallery.technet.microsoft.com/office/How-to-export-a-mailboxs-2dd7247a
The one from spiceworks doesnt give me any errors, but the csv it creates has no data.
The one from the technet gallery gives me an autodiscovery error and I'm not sure how to fix that.
Does anyone else have a tried and true way of exporting contacts using powershell and exchange online?
Thank you.
https://community.spiceworks.com/topic/2155223-powershell-office-365-export-user-s-contacts-to-csv
https://gallery.technet.microsoft.com/office/How-to-export-a-mailboxs-2dd7247a
The one from spiceworks doesnt give me any errors, but the csv it creates has no data.
The one from the technet gallery gives me an autodiscovery error and I'm not sure how to fix that.
Does anyone else have a tried and true way of exporting contacts using powershell and exchange online?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You dont need their password, but you need to run the script as a person with sufficient permissions. Which reads: either having a Full Access permissions over the mailbox from which you want to export contacts, or having the EWS impersonation impersonation role granted on the account. Here's an article on the latter: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-configure-impersonation
ASKER
This worked. I added the ApplicationImpersonation to a user and I am able to get the contacts. now to find a way to export all of them at once to a file instead of one by one.
thank you.
thank you.
ASKER
From what I can gather, I will need the passwords for any user that I want to export the contacts? If so, does anyway exist to export contacts for users by putting in a global admin or exchange admin account thats connected to O365/Exchange online?