Trace Id is missing

Unlock your potential with Microsoft Copilot

Get things done faster and unleash your creativity with the power of AI anywhere you go.
Microsoft Copilot app being utilized to generate pictures of a singing dog, assisting to identify a flower, and helping to generate an email to congratulate a coworker on a promotion.

Mail-enabled Public Folders - directory sync script

Script to syncronize mail public folder objects from source AD during public folder migration and hybrid access.

Important! Selecting a language below will dynamically change the complete page content to that language.

  • Version:

    15.01.0136.000

    Date Published:

    10/26/2022

    File Name:

    Sync-MailPublicFolders.ps1

    SyncMailPublicFolders.strings.psd1

    File Size:

    52.2 KB

    12.2 KB

      Use this script if you need to do one of the following -
    • Initial creation of mail enabled public folder objects in the destination Active Directory for public folder migration from Exchange 2007 or 2010 to Exchange Online.
    • Synchronization of mail enabled public folder objects from on-premise to Exchange Online Active Directory
      This script mail-enabled public folder objects from the local Exchange deployment into O365. It uses the local Exchange deployment as master to determine what changes need to be applied to O365. The script will create, update or delete mail-enabled public folder objects on O365 Active Directory based on what exists in the local Exchange deployment.
      The script must be executed from local Exchange Management Shell window providing access to mail public folders in the local Exchange deployment. Then, using the credentials provided the script will create a session against Exchange Online, which will be used to manipulate O365 Active Directory objects remotely.
      NOTE - Before running the script, copy the Sync-MailPublicFolders.strings.psd1 file in the same directory as the Sync-MailPublicFolders.ps1 script file.
  • Supported Operating Systems

    Windows Server 2008, Windows Server 2008 Service Pack 2, Windows Server 2003 Service Pack 2, Windows Server 2008 R2 SP1, Windows Server 2008 R2

    • Review the Technical Documentation for detailed instructions on performing Public Folder Migration
    • Review the Technical Documentation for detailed instructions on configuring Public Folder cross-premise access
    • Exchange Server should be installed on the server where the script will be run. See Instructions for details on Exchange Server versions.
    • PowerShell 2.0 or later
    • Script usage examples:

      Example 1: .\Sync-MailPublicFolders.ps1 -Credential (Get-Credential) -CsvSummaryFile:sync_summary.csv

      This example shows how to sync mail-public folders from your local deployment to Exchange Online. Note that the script outputs a CSV file listing all operations executed, and possibly errors encountered, during sync.

      Example 2: .\Sync-MailPublicFolders.ps1 -Credential (Get-Credential) -CsvSummaryFile:sync_summary.csv -ConnectionUri:"https://partner.outlook.cn/PowerShell"

      This example shows how to use the script with a different URI to connect to Exchange Online and sync mail-public folders from your local deployment.

      Required parameters:
    • Credential - Exchange Online user name and password
    • CsvSummaryFile - The file path where sync operations and errors will be logged in a CSV format
      Optional parameters:
    • ConnectionUri - The Exchange Online remote PowerShell connection uri. If you are an Office 365 operated by 21Vianet customer in China, use "https://partner.outlook.cn/PowerShell".
    • Confirm - The Confirm switch causes the script to pause processing and requires you to acknowledge what the script will do before processing continues.
    • Force - Force the script execution and bypass validation warnings.
    • WhatIf - The WhatIf switch instructs the script to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes.
Follow Microsoft