Azure AD Connect: Initialize-ADSyncDomainJoinedComputerSync


Azure Active Directory Connect (AADConnect) is the tool that connects your on-premises Active Directory to Azure Active Directory.

At the end of the setup there is a rather unhelpful message asking you to run


Translated to English this means. (also see Update 20/07/2016)

  1. Open PowerShell and set your execution policy to unrestricted.
    set-executionpolicy unrestricted

  2. Change directory to
    C:\Program Files\Microsoft Azure Active Directory Connect\AdPrep

  3. Then
    import-module .\AdSyncPrep.psm1

  4. Then

  5. Supply values for the following parameters:

    AdConnectorAccount: your AAD connector account.

    AzureADCredentials: your credentials for Azure.

  6. If successful you should see
    Initializing your Active Directory forest to sync Windows 10 domain joined computers to Azure AD.Configuration Complete

  7. As good practice, set  your execution policy back to restricted.
    set-executionpolicy restricted

Update 20/07/2016:

This must be run from a computer that has the Active Directory module for Windows PowerShell and the AD DS Snap-Ins and Command-Line Tools installed.


Failure to have both options installed will result in two errors:

The first error is obvious.


The second is not quite so obvious, a dsacls.exe error is generated as the command line tooling is not installed.

DSAcls Error




7 thoughts on “Azure AD Connect: Initialize-ADSyncDomainJoinedComputerSync

  1. Thanks for this. When running “Initialize-ADSyncDomainJoinedComputerSync” I get the failure; “Connect-MsolService : A parameter cannot be found that matches parameter name ‘AzureEnvironment’.” What am I missing? I just upgraded to AADConnect 1.1.561 and got the same error message.

    1. OK I resolved it! I had to update my version of the MSOnline PS module. I was using the original version 1, and when I upgraded it to, then the error message as gone. Thanks again for this write-up!

  2. Make sure you run Microsoft Azure Active Directory Module for Windows Powershell as Administrator (elevated) or you’ll get this error: “Get-ADDomain : Cannot find an object with the identity: …”

  3. Had issues with the installation of the powershell module and had to add the rsat tools and then the steps worked wonderfully.

    Thanks for sharing the steps!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.