Cut Over Migration and DirSync with Office 365

DragonsInstalling DirSync is not fun, easy or short. Do not make any assumptions about how long it will take to setup. I say this because I spent several wasted hours trying to use the default install and let it install SQL Express automatically and it failed with a whole host of different errors each time I uninstalled, cleaned up and tried again.

Official documentation was either out-dated or used methods which didn’t work, blogs were a mixed bag as well. This post tries to tie the various pieces of correct information together.

Environment

Server Platform: Windows Server 2012 R2
SQL DB: SQL 2012 Express
Server Role: Domain member, not a DC
Exchange version: Exchange 2003 (Small Business Server)

Dirsync Installation process summary

For the benefit of overview, here is the DirSync install process that worked.

1. Uninstall MS online sign in assistant if it is already installed on the server.
2. Manually install SQL 2012 Express with the default instance name.
3. Install “DirSync.exe /fullsql”
4. Manually configure the connection to SQL.
5. Configure the sync credentials and run the sync.

Detailed step by step

1. On premise application server SMPT relay

Your remaining on premise application servers and printers (for scan to email) will need something to send through once your on premise Exchange server goes away.

To configure Office 365 as your anonymous relay for these services, follow the steps outlined here for the SMPT relay section.

You could create a local SMTP server which O365 trusts, or create an individual inbound rules for each one depending on your network setup.

2. Finalising your migration batch when using cut over migration

Stop SMPT on your source Exchange server.

Once your cut over migration is fully synced up, click on Stop. It can take a while to come out of the stopping status, just hang in there.

When that is done, select the batch migration job and then click on the delete button.

2. Download and install SQL Express 2012 x64

http://www.microsoft.com/en-gb/download/details.aspx?id=29062

3. Activate Directory Synchronisation

Activate Directory Synchronisation in the Office 365 Admin Centre. This makes your onprem directory authoritative for User Accounts, Security Group and Distribution groups.

image

4. Installing DirSync (Windows Azure Active Directory Sync)

Download Dir Sync from the link in step 4 in the admin centre.

image

https://bposast.vo.msecnd.net/dirsync/6198.0037/amd64/dirsync.exe (make sure you use the download button, this link could be invalid some day soon)

image

Launch an administrator command prompt, navigate to where you downloaded the installer and run: DirSync.exe /fullsql.

Follow the installation wizard as below:

Click on Next.

image

Accept the licence terms.

image

Choose the installation folder.

image

Click on Finish

image

This will install the binaries onto the server but the Sync tool has no backend database to store its data in.

5. Configure DirSync’s database connection

Launch PowerShell and type in the following:

Import-Module DirSync

Install-OnlineCoexistenceTool –UseSQLServer -Verbose

image

6. Configure DirSync and run the first sync.

Run the dirsync configuration GUI from the start menu.

Click on Next.

image

Enter the admin credentials.

image

Enter a domain admin account.

image

Leave Hybrid Deployment unchecked.

image

Check the box for Enable Password Sync

image

image

Click on Next.

image

Leave Synchronise your directories now checked and click on finish.

image

image

Installation Issues

If you just launch dirsync without the /fullsql switch, it will attempt to install SQL Express itself. In all my install attempts, this failed. See the process summary that worked at the top of this post.

image

SQL Express Install returned FAIL. See the event logs for more detailed information.

Unable to uninstall the Windows Azure Active Directory Sync Tool. The the Control Panel to remove the Directory Sync tool.

The Fix

1. Uninstall all SQL components from the control panel installed by the DirSync tool.

2. Uninstall the sync tool (if it fails to uninstall with the error below, follow step 2a)

image

The current user is not a member of the Synchronization Engine FIMSyncAdmins group. If you have recently installed the Windows Azure Active Directory Sync tool, you may need to log off and then log on again.

2a. i. Add your current account to the FIMSSyncAdmin local groups (not a domain group).

image

ii. In control panel, uninstall DirSync.

image

image

3. Delete the folder “MSSQL11.MSONLINE” in C:\Program Files\Microsoft SQL Server

4. Uninstall the sign in assistant and reboot (if it appears).

image

5. Follow the process for installing .

Some more tips

MX record and SMTP traffic cut over

If you find yourself with unforeseen parties directly addressing your SMTP service IP address and you have already changed your MX records, you can do a simple port redirect from your old server which hosted SMTP to Office 365.

We deployed DoorPointer which is open source and did what we needed. The only downside was that it isn’t a service there therefore you can’t reboot the server without re-launching the redirect app. That wasn’t an issue for us since it was resolved in 24 hours but still, user be warned.

Once you have done that, you will need to configure the inbound mail connector that I mentioned at the top of this post.

Manually running a sync

Launch PowerShell and type in the following:

Import-Module DirSync

Start-OnlineCoexistenceSync

Creating a shortcut to run the DirSync manually after a change.

Create a shortcut to PowerShell.

Edit the shortcut and paste the below in –

image“%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe Import-Module DirSync, Start-OnlineCoexistenceSync”

Rename the shortcut it to something meaningful.

 

References

Manage Migration Batches in Exchange Online

dirsync Failed to install SQL Express installer returned FAIL

DirSync Installation Fails Product: Microsoft Online Services Sign-in Assistant — Newer version already installed.

Directory Synchronisation

Office 365 – DirSync Password Sync: Did You Know?

How to Allow a Multi-function Device or Application to Send E-mail through Office 365 Using SMTP