Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, June 12, 2018 10:48 PM
Hello,
We have a need to automate some contact synchronization for our CEO. We would like to be able to export the contacts via powershell or command line (so it can be automated on a schedule) and then do the reverse and import contacts using powershell or command line.
Can anybody assist with this process?
- Chris
All replies (11)
Tuesday, June 26, 2018 2:51 AM âś…Answered
Hi,
The format of .CSV file only suitable for importing from GUI(Outlook client). If you want to import contact from powershell, the only format is .PST.
If you want to use a . CSV file, I'm sorry to say that it's cannot automated. Thank you for your understanding.
Regards,
Kyle Xu
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.
Wednesday, June 13, 2018 2:40 AM
Hi Chris,
Thank you for visiting Outlook Forum.
As here we mainly focus on issues regarding Outlook client, I'm not familiar with powershell or command line. I'll help move this thread to Exchange forum to get a better response.
Thank you for your understanding and support.
Regards,
Perry
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.
Thursday, June 14, 2018 9:49 AM
Hi ChrisWhi,
There are may be the command that you want to use: New-MailboxExportRequest and New-MailboxImportRequest
Here are the detail testing:
1. Create a contact in users 6a's Contacts list:
2. Use commands export and import to other mailbox:
3. Then this contact will appear in user 3a's Contacts list:
Please note: Before run those two commands, you should give Mailbox Import Export permission to the user who run those commands:
By the way, when you create a schedule, you should set some delay between export and import, because it need consume some time to export contacts to PST file.
Regards,
Kyle Xu
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.
Tuesday, June 19, 2018 7:22 AM
Hi ChrisWhi,
Any update now?
If the above suggestion helps, please be free to mark it as answer for helping more people.
Regards,
Kyle Xu
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.
Tuesday, June 19, 2018 10:11 PM
We have largely abandoned the effort to try to do this using powershell. We are trying to import contacts from our mobile phone management provider into Outlook.
We only wanted to use powershell to automate it. We have since found it easier to just use a screen recorder to accomplish the import/export.
However we are having trouble moving data back and forth from SQL to the CSV in the proper formats that Outlook wants.
- Chris
Wednesday, June 20, 2018 1:40 AM
Hi ChrisWhi,
We cannot achieve convert file between SQL and CSV directly, so, it cannot be automation. I think use EMS to export and import is the most convenient way.
Regards,
Kyle Xu
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.
Friday, June 22, 2018 4:27 PM
That is awesome thank you.
Question: This is an Exchange Powershell command? So I need to run it from the exchange server, correct?
Is there a switch I can use in that command to deal with the duplicate options? Similar to when you do a manual import from outlook you get the option to overwrite, discard, or leave dups.
- Chris
Friday, June 22, 2018 4:44 PM
What we are doing is creating a CSV from SQL. The data in the SQL DB is being combined with employee data from our JDE system and Mobile phone data from our mobile phone vendor and AD information. That part is already automated.
Now we just need a method to import the CSV automatically in to our CEO's contact list. So if the mailbox import will allow us to do that without affecting his existing contacts, and give us the option to deal with duplicates then we are good to go.
- Chris
Monday, June 25, 2018 2:37 AM
Hi,
The CSV is not a format used for Outlook client data, if you want to export contacts to Outlook client, the format of this file must be PST.
As I said before, you can create a Schedule Task on Exchange server, run script automatically.
First script:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
New-MailboxExportRequest -Mailbox xxxx -IncludeFolders "#Contacts#" -excludedumpster -FilePath "\\xx\x\x.pst"
Second script:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
New-MailboxImportRequest -Mailbox xxxx -FilePath "\\xx\x\x.pst" -IncludeFolders "#Contacts#"
The function of "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn": a add-in for running Exchange command in PowerShell.
Regards,
Kyle Xu
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.
Monday, June 25, 2018 5:15 PM
Importing and exporting files via CSV is absolutely an option within the Outlook client.
Because not all of our employees are in AD, we are unable to simply do all of this with Exchange.
We are combining data from multiple sources that are not all AD to create this contact list.
- Chris
Tuesday, June 26, 2018 3:54 PM
I don't like it, but at least its an answer I have to live with. Thank you for all your help and suggestions. We are currently using a screen recorder to complete this but that process has a lot of variables.
- Chris