Export or delete your Outlook Customer Manager data

Outlook Customer Manager will be retired in June 2020. You won't be able to use Outlook Customer Manager after June 2020, but you'll be able to export or delete your Outlook Customer Manager data by following the steps in this article.​

Export your Outlook Customer Manager data

Use the Windows or Mac PowerShell app - You will use a script that will export all your data from Outlook Customer Manager.

Export your Outlook Customer Manager data using PowerShell

Follow the steps below to export your user data in Outlook Customer Manager using a PowerShell script. The script can be run on a Windows or Mac computer.

Use the OCM-Script.ps1 PowerShell script to export your data.

Export Outlook Customer Manager data using Windows PowerShell app

  1. Get the script from this location: Outlook Customer Manager Data Export.

  2. Download the script and save it to a location on your computer. You'll need to remember where you saved this file as you'll need it again later.

  3. From Windows desktop, choose Start, and type PowerShell.

  4. Right-click on Windows PowerShell app and select Run as administrator. Select Yes to allow this app to make changes to your device.

  5. On the Windows PowerShell app page, you should be at a command prompt.

    Screenshot: PowerShell commmand prompt at C:\Windows\System32

    Navigate to the OCM-Script.ps1 file location. For example if you saved the file in your user folder, you would type the following commands:

    • cd\ and choose Enter.

    • cd \Users\your name and choose Enter.

  6. Type the following command and choose Enter.

    Unblock-File .\OCM-Script.ps1

    Type the following command and choose Enter.

    .\OCM-Script.ps1 export-all-data
  7. On the Windows PowerShell credential page, enter your Microsoft 365 email address and password and choose OK. You should see the script running.

  8. Your exported Outlook Customer Manager data files will be saved in the same file location your saved the OCM-Script.ps1 file. They will be saved in a sub-folder whose name will consist of your email address and the date and time the script ran: youremailaddress@contoso.com_20191108T1124287436. The files will be in CSV format. You can use a CSV file reader like Microsoft Excel to check out your data.

Read Import contacts from an Excel spreadsheet to Outlook, if you want to import your contacts into Outlook.

Get help with the script

You can find help on the commands in the script by running the command below in the PowerShell app. Follow the steps above to run the PowerShell app.

get-help .\OCM-Script.ps1 -online

And choose Enter.

Export Outlook Customer Manager data using Mac PowerShell

Follow the steps below to export your user data in Outlook Customer Manager using a Mac PowerShell script. Run this script on a Mac computer. Use the OCM-Script.ps1 PowerShell script to export your data.

Before you can run this script, you need to install Homebrew.

  1. Get the script from this location: Outlook Customer Manager Data Export.

  2. Download the script and save it to your computer.

  3. On your Mac computer, open Terminal. Copy and paste the command below to install Homebrew:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
  4. Copy and paste the command below in Terminal to install PowerShell for Mac.

    brew cask install powershell
  5. Type:

     pwsh

    And choose Enter.

  6. Copy and paste the command below, and enter your Microsoft 365 email address and password.

     $cred=get-credentials
  7. From your Terminal window, navigate to the OCM-Script.ps1 file location.

  8. Type the following command and choose Enter.

    Unblock-File .\OCM-Script.ps1

    Type the following command and choose Enter.

    .\OCM-Script.ps1 export-all-data 
  9. Your exported Outlook Customer Manager data files will be saved in the same file location your saved the OCM-Script.ps1 file. They will be saved in a sub-folder whose name will consist of your email address and the date and time the script ran: youremailaddress@contoso.com_20191108T1124287436. The files will be in CSV format. You can use a CSV file reader like Microsoft Excel to check out your data.

Read Import contacts from an Excel spreadsheet to Outlook, if you want to import your contacts into Outlook.

Delete your Outlook Customer Manager data

There are multiple Outlook Customer Manager data types and multiple tools that can be used to delete them. 

Data Type

Outlook

Powershell

Deals (Private and Shared)

No

Yes

Companies (Private and Shared)

No

Yes

Contacts (Shared)

No

Yes

Activities / Posts

No

Yes

Insights

No

Yes

Tasks

Yes

No

Contacts (Private)

Yes

No

  • Outlook, via the People app and Tasks app allows for deletion of private contacts and tasks.

  • PowerShell app - You use a script that will delete all Outlook Customer Manager data except for Tasks and Private Contacts.  This is the recommended method due to it's speed.

Delete Outlook Customer Manager data using Windows PowerShell app

Use this script to remove Outlook Customer Manager data.

Note: Shared Outlook Customer Manager data resides in a Microsoft 365 group mailbox while Private Outlook Customer Manager data resides in a User's mailbox. 
We recommend that this script is run on each Outlook Customer Manager Users' mailbox and on the Microsoft 365 group mailbox. 

  1. Get the script from this location: Outlook Customer Manager Data Export.

  2. Download script from this location and save it to your computer: Outlook Customer Manager Data Export

  3. From Windows desktop, choose Start, and type PowerShell.

  4. Right-click on Windows PowerShell app and select Run as administrator. Select Yes to allow this app to make changes to your device.

  5. On the Windows PowerShell app page, you should be at a command prompt.

    Screenshot: PowerShell commmand prompt at C:\Windows\System32

    Navigate to the OCM-Script.ps1 file location. For example if you saved the file in your user folder, you would type the following commands:

    • cd\ and choose Enter.

    • cd \Users\your name and choose Enter.

  6. Type the following command and choose Enter.

    Unblock-File .\OCM-Script.ps1

    Type the following command and choose Enter.

    .\OCM-Script.ps1 purge-all-data <email address of the Microsoft 365 group mailbox>
  7. To find the email address of the Microsoft 365 group mailbox, sign in to Outlook Web app, go to the group mailbox, right-click to select the group mailbox, and select "Copy email address". You can then paste the email address name into the PowerShell command above.

  8. On the Windows PowerShell credential page, enter your Microsoft 365 email address and password and choose OK. You should see the script running.

  9. The Microsoft 365 group Outlook Customer Manager data will be removed.

Run the following command to remove data for a single user:

Note the email address of the user is optional. If there's no email address, the PowerShell app will prompt you for the email address and password of the user who's data you want to remove.

.\OCM-Script.ps1 purge-all-data <email address of the user>

Run the following command to remove contact data for a user or Microsoft 365 group mailbox:

.\OCM-Script.ps1 purge-contacts-data <email address of the user or Microsoft 365 group mailbox>

Remove data from a user's mailbox using the global admin account

Follow these steps to allow a global admin access to a user's mailbox so the admin can delete the user's Outlook Customer Manager data.

Before you can follow these you need to make sure that your computer allows basic authentication. It's on by default, but you'll need to verify that basic authentication is on. To verify that it's on:

  1. On your Windows computer, click the Windows icon and type:

    cmd
  2. From the command prompt window, type:

    winrm get winrm/config/client/auth

    You should see the value, Basic = True. If you don't see the value, type the following to turn on basic authentication for WinRM:

    winrm set winrm/config/client/auth @{Basic="true"}
  3. From Windows desktop, choose Start, and type PowerShell.

  4. Click on Windows PowerShell app to open.

  5. Type the following command and choose Enter.

    $UserCredential = Get-Credential
  6. On the Windows PowerShell credential page, enter your Microsoft 365 global admin email address and password and choose OK.

  7. Type the following command and choose Enter.

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  8. If the above command runs correctly, you should be back at the command line. Type the following command and choose Enter.

    Import-PSSession $Session -DisableNameChecking

    Note: Be sure to disconnect the remote PowerShell session when you're finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire.

    To disconnect the remote PowerShell session, type the following command and choose Enter.

    Remove-PSSession $Session

    If you don't receive any errors, you connected successfully. A quick test is to run an Exchange Online cmdlet, for example, Get-Mailbox, and see the results. For more info on running Exchange Online cmdlets, check out Connect to Exchange Online PowerShell.

Provide global admin user access to a user’s mailbox

You'll need to run these commands to access the user's mailbox that you want to delete Outlook Customer Manager data from.

  1. Type the following command to give an admin user access to another user's mailbox:

    Add-MailboxPermission -Identity user-SMTP-address -User admin-SMTP-address -AccessRights FullAccess -InheritanceType All

    This example gives user admin full access rights to user1’s mailbox.

    Add-MailboxPermission -Identity user1@contoso.com -User admin@contoso.com -AccessRights FullAccess -InheritanceType All
  2. Type the following command to get mailbox permissions admin user has to another user’s mailbox:

    Get-MailboxPermission -Identity user-SMTP-address -User admin-SMTP-address

    This example retrieves access right user admin has to user1’s mailbox.

    Get-MailboxPermission -Identity user1@contoso.com -User admin@contoso.com

  3. After you've run the purge, run the following command to remove the admin's access to the user's mailbox. Type the following to remove access:

    Remove-MailboxPermission -Identity user-SMTP-address -User admin-SMTP-address -AccessRights FullAccess -InheritanceType All

    This example removes access right user admin has to user1’s mailbox.

    Remove-MailboxPermission -Identity user1@ contoso.com -User admin@ contoso.com -AccessRights FullAccess -InheritanceType All
  4. Type the following command to validate full access permission is removed. If the permission is removed the below command won't show full access to user mailbox.

    Get-MailboxPermission -Identity user-SMTP-address -User admin-SMTP-address

Running the script to purge data for a user’s mailbox

Once the global admin user has full access to user’s mailbox, follow the steps below to purge the data for the user’s mailbox.

  1. Get the script from this location: Outlook Customer Manager Data Export.

  2. Download the script and save it to a location on your computer. You'll need to remember where you saved this file as you'll need it again later.

  3. From Windows desktop, choose Start, and type PowerShell.

  4. Right-click on Windows PowerShell app and select Run as administrator. Select Yes to allow this app to make changes to your device.

  5. On the Windows PowerShell app page, you should be at a command prompt.

    Screenshot: PowerShell commmand prompt at C:\Windows\System32

    Navigate to the OCM-Script.ps1 file location. For example if you saved the file in your user folder, you would type the following commands:

    • cd\ and choose Enter.

    • cd \Users\your name and choose Enter.

  6. Type the following command and choose Enter.

    Unblock-File .\OCM-Script.ps1

    Type the following command and choose Enter.

    .\ OCM-Script.ps1 purge-all-data user-SMTP-address
  7. On the Windows PowerShell credential page, enter your Microsoft 365 admin email address and password and choose OK. That's it, that user's Outlook Customer data will be removed.

Remove Outlook Customer Manager licenses

You may want to remove the licenses to clean up Outlook Customer Manager for your users.

  1. In the Microsoft admin center, go to Users > Active users page.

  2. On the Active Users page, select the row of the user you want to unassign a license for.

  3. In the right pane, select Licenses and Apps.

  4. Expand the Licenses section, clear the check box for the Outlook Customer Manager license, then select Save changes.

Remove the Outlook Customer Manager add-in from Outlook

  1. In a browser, type, https://outlook.office365.com/mail/inclientstore

  2. Select My add-ins.

  3. On the My add-ins page, find Outlook Customer Manager, select (...) and choose Remove.

General Data Protection Regulation (GDPR)

General Data Protection Regulation (GDPR) regulates the collection, storage, processing, and sharing of personal data. Personal data is defined very broadly under the GDPR as any data that relates to an identified or identifiable natural person that is a resident of the European Union (EU). After Outlook Customer Manager is retired (June 2020), if user data is still there, being GDPR compliant is more challenging. We recommend that you delete Outlook Customer Manager data using the methods above. For more info, check out the Microsoft GDRP overview page.

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×