Microsoft Exchange 2013 Site Mailbox Directory Sync Support Scripts

    Site Mailbox Directory Sync Support Scripts enable synchronizing site mailbox objects from Office 365 cloud into on-premise Active Directory to support access for on-premise users.
    • Note:There are multiple files available for this download.Once you click on the "Download" button, you will be prompted to select the files you need.


      File Name:

      SM Scripts\SyncSiteMailbox.ps1

      SM Scripts\Export-SyncSiteMailbox.ps1

      SM Scripts\Import-SyncSiteMailbox.ps1

      SM Scripts\SyncSiteMailboxLibrary.ps1

      Date Published:


      File Size:

      24 KB

      14 KB

      20 KB

      42 KB

        Site Mailbox Directory Sync Support Scripts are used to support on-premise users accessing Office 365 site mailboxes. It pulls any changes to the site mailbox objects including property changes, permissions etc. from Office 365 and merges them into the on-premise Active Directory.
    • Supported Operating System

      Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

        • Review the Technical Documentation prior to installation of Microsoft Exchange Site Mailbox Directory Sync Support Scripts.
        • Exchange Server 2013
        • Exchange Online (Office 365) subscription
        • PowerShell 3.0 or later
      • For synchronizing site mailboxes, we recommend running the SyncSiteMailbox.ps1 script daily as part of a scheduled task to ensure seamless experience with site mailboxes when they are created in Office 365. Prerequisties 1. An Exchange 2013 server on-premise 2. An account with read-write permission to On-Premise Active Directory. 3. Microsoft Online Service Module is installed on that server. It could be installed from "" 4. An account with organization and recipient read-only permissions to Exchange Online and read-only permission to Microsoft Online Service. Setting up the scheduled task: 1. Download the following scripts to a folder like "C:\Program Files\Microsoft\Exchange Server\V15\Scripts": SyncSiteMailbox.ps1, Export-SyncSiteMailbox.ps1, Import-SyncSiteMailbox.ps1, SyncSiteMailboxLibrary.ps1 2. Use Windows account to logon to the Exchange 2013 server on premise. 3. Create a folder on that machine to host log files and cached site mailbox csv file. 4. Go to Control panel, find Credential Manager; Add a generic credential for Exchange Online account, you could use your tenant name as key, like contoso. 5. Go to Control panel, create a basic task. 6. Input the name, like "sync site mailbox" and choose daily schedule; In Program/Script box find the PowerShell.exe, like C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe; In arguments box, type in .\SyncSiteMailbox.ps1 -WorkingFolder <folder> -TenantCredentialKey <contoso> In start in box, type the path where the script is located, like C:\Program Files\Microsoft\Exchange Server\V15\Scripts Site Mailbox Scripts SyncSiteMailbox.ps1 Description This script is used for hybrid to support site mailbox created in Office 365 gets synced into on-premise environment. It runs two steps to pull changes from Office 365 to on-premise environment. Step 1: run Import-SyncSiteMailbox.ps1 to pull changes from Office 365 to a local cache csv file. Step 2: run Export-SyncSiteMailbox.ps1 to export site mailbox changes to on-premise active directory. Parameters WorkingFolder - Specify where to keep exporting logs and load sync site mailboxes. TenantCredentialKey - Specify the key to retrieve credential from windows generic credential manager. You need manually add the credential into credential manager first. Usage SyncSiteMailbox –WorkingFolder -TenantCredentialKey ---------------------------------------------------------------------------------------------------------------------------------------------------------------- Export-SyncSiteMailbox.ps1 Description This script will export sync site mailboxes in cached file into local on-premise active directory. This script will base on the local cache file to export delta changes into local active directory. It will use Exchange local PowerShell to commit the changes. Please ensure you're running from Exchange 2013 server with the user with active directory write permission. Parameters - WorkingFolder - Specify where to keep exporting logs and load sync site mailboxes. Usage - Export-SyncSiteMailbox -WorkingFolder ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Import-SyncSiteMailbox.ps1 Description This script is used to support hybrid scenario that site mailbox is created in Office 365 directly. It pulls delta changes from Office 365 and merge into a local cache file in the working folder. This script will base on the local cache file to pull delta changes from Exchange online. Parameters WorkingFolder - Specify where to keep exporting logs and load sync site mailboxes. TenantCredential - Specify Office 365 tenant credential for pulling site mailboxes changes. The account must have read only permission to Get-AcceptedDomain, Get-SiteMailbox and Get-Recipient; it also must have read only permission to pull data from MSO online by Get-MsolUser. Usage Import-SyncSiteMailbox –WorkingFolder -TenantCredential -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- SyncSiteMailboxLibrary.ps1 Description This script provides methods for import and export sync site mailbox script. This script provides methods for import and export sync site mailbox script. It is used by Import-SyncSiteMailbox.ps1, Export-SyncSiteMailbox.ps1 and SyncSiteMailbox.ps1. Parameters $ExchangeOnlineUrl - Office 365 to connect with e.g. "" $LastSyncSiteMailboxCacheFile - Sync site mailbox cache file name e.g. "SyncSiteMailboxes.csv" $DeletionCheckInterval - Interval in days to check if a site mailbox has been deleted in Office 365. Larger interval will gain better performance since deletion is not happening often. e.g. 10 $CloudUserDNToEmailsCache - A cache to map Office 365 user's distinguished name with its primary smtp address on-premise cannot understand Office 365 user's distinguished name, it has be convert into primary smtp address Distingulish Name -> primary smtp address e.g. @{} $CoexistentDomainsTemplate - This format of accept domain is also coexistent domain e.g. "" $SyncSiteMailboxProperties - Switch to decide if syncing site mailbox properties e.g. $true $OnPremEmailsExistenceCache - A cache to indicate if the email address exists in on-premise Email address -> $true or $false e.g. @{} Usage SyncSiteMailboxLibrary –ExchangeOnlineUrl -LastSyncSiteMailboxCacheFile –DeletionCheckInterval – CloudUserDNToEmailsCache – CoexistentDomainsTemplate – SyncSiteMailboxProperties - OnPremEmailsExistenceCache

    Popular downloads

    Loading your results, please wait...

    Free PC updates

    • Security patches
    • Software updates
    • Service packs
    • Hardware drivers

    Microsoft suggests

    Download a free trial of Windows Server 2012 R2.
    Windows Server 2012 R2 free trial
    Experience the new and enhanced capabilities.
    Free trial