How To Sync Local Active Directory To Office 365 With DirSync
How To Sync Local Active Directory To Office 365 With DirSync
When moving to the Office 365 environment quite commonly the old on-premises structure must
be preserved. Sometimes it is because the migration process can take quite a bit of time to finish,
sometimes because the company wants to follow the hybrid scenario, when both environments
are used.
No matter the reason, one of the important aspects of the coexistence setup is synchronization of
Active Directory between local and Cloud Exchange. The article below describes steps required
to achieve such a sync.
The program syncs all accounts, with their access passwords up to Office 365. However, it does
not provide Single Sign-On (SSO) capability. To achieve SSO AD Federation Services (ADFS)
needs to be configured.
Microsoft recommends installing Dirsync on a server within a domain, however, it should not be
a domain controller. More specific system requirements are available on this Microsoft Technet
website: http://technet.microsoft.com/en-
us/library/jj151831.aspx#BKMK_ComputerRequirements.
Installation
NOTE: all actions below are performed on a test Office 365 environment.
6. On the machine, where you are installing the tool make sure that the .net
3.5 sp1 and .net 4.0 libraries are installed. Otherwise the Dirsync tool
setup will return the following error:
In Windows Server 2008 R2 SP1 the .net 3.5 SP1 library is available for
installation via the Server Manager program, in the Features tab, while
the .net 4.0 needs to be downloaded from the following location:
http://www.microsoft.com/en-US/download/details.aspx?id=17718.In
Windows Server 2012 and 2012 R2 both libraries can be installed using
the Server Manager console.
7. Follow the installation wizard until finish. The process might take a couple
of minutes.
8. Once the installation is complete select Start Configuration Wizard now
and click Finish.
10. In the next step enter administrative user credentials of the on-premises
AD. Opposite to step 9., these credentials are not stored, and there is no
need to reconfigure the program if e.g. the password changes.
11. Next step shows the Exchange settings for the hybrid deployment. Leave
them unchecked, as they are not covered in this article. Click Next.
12. In the following step, mark the Enable Password Sync checkbox. Click
the Next button.
13. Wait for the program to finish configuration. Once it’s done – click the
Finish button. Leave the Synchronize your directories now option
marked:
Synchronization monitoring
After Dirsync is installed, you need to verify that the process works as expected. To do so use the
Synchronization Service Manager console:
In the upper part of the window, there is a list of all current sync cycles. In lower left all current
modifications to AD are listed.
By default, the sync cycles are launched in 3-hour intervals. To reduce the time between syncs
(e.g. for testing purposes) do the following:
1. On the server, where the Dirsync tool is installed go to the C:\Program
Files\Windows Azure Active Directory Sync folder.
2. Open the Microsoft.Online.DirSync.Scheduler.exe.Config file with the
Notepad.
3. Locate the following string:<add key=”SyncTimeInterval”
value=”3:0:0″ />and change the “3:0:0” value to e.g. “0:5:0”. This
changes the sync interval from 3 hours to 5 minutes.
4. Save changes in the file and restart the Windows Azure Active Directory
Sync Service in system services.
In situations, when the on-premises organization is large, and only some users or groups are
using Office 365 it is useful to limit the sync to specific Organizational Units (OU) only.
11. You should already notice the effect of above settings in the main program
window, in the Operations tab:
That’s it – you have now a fully synced AD with Office 365. Every change to any Active
Directory object is now synchronized to the Cloud.
The next step is usually the mailbox migration. To perform it you can use a third party tool, such
as CodeTwo Office 365 Migration. What is even more interesting – you can get it completely
free of charge.
Tweet
105 thoughts on “How to sync local Active Directory to Office 365 with DirSync”
1. henrie
Dear Adam,
Currently our company email has already used Office 365 for 1 year and it has been
working fine and all are cloud users. we are creating office 365 mailbox from the portal
directly.
Now my current situation is: my new company has already completed the migration and
currently all are cloud users. is it feasible to do sync windows login password and
office365 mailbox password and currently we are on different domain between windows
login and office 365. Windows login is using cpy.net domain whereby office 365 is using
company.com.
Many thanks
Regards,
H
Reply
2. Mohamed Faizal
Hello
i want to sync the AD with office 365
there are more than 1000 users in AD and they have in house exchange account.
when i sync with azure sync tool kindly confirm over all users of local AD sync with
office 365?
Reply
Hi Mohamed,
If I understand correctly, you want to know if Azure AD Connect syncs over 1000
users? By default, Azure AD tenant allows 50k objects, so it should not be a
problem. Still, I will advise you to try it in a test environment before syncing on
the production server.
3. Amena Abdrabo
Hi!
I’ve a problem when creating new users they default to the .onmicrosoft.com address,
even though they are specified differently on prem.
They have to use PowerShell to change this each time, however, would like a way to do
this by default.
Any suggestions?
Thanks in advance
Reply
Hi Amena,
I am sorry, but I have not come across this problem before. You could try asking
the tech community at spiceworks.com, or at Microsoft’s TechNet. I wonder
myself what solution will work in this situation.
Nice Article. How it help to developer in terms of balance the day to day life.
Reply
5. abrar ahmad
i have a question.
i want to sync the AD with office 365 but in office 365 my domain name is different and
these user are premium.
when i sync with azure sync tool kindly confirm over all users of local AD sync with
office 365 AD so in this case we need to pay the extra money for the user that are using
in local ad or not .
thanks
Reply
o Adam the 32-bit Aardvark
Hi abrar ahmad,
As far as I know, you need to assign an Office 365 license only to a user that
exists in Office 365, not local AD.
Once you have synchronized users from on-premises Active Directory to Azure
Active Directory with Azure AD Connect tool, you need to manually assign them
licenses before they can use Office 365 applications.
If you have two different domains for Exchange and Office 365 environments,
make sure to set an Alternative UPN Suffix in the Active Domain and Trust to
avoid creating double user accounts in Office 365. See this Technet post for more
details: https://answers.microsoft.com/en-
us/msoffice/forum/msoffice_o365admin-mso_dirservices/after-setting-up-ad-
connect-i-now-have-two-users/833628ec-b8e7-4e58-87b3-687a31d7162f.