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




Posted by markparris

Microsoft MVP - Enterprise mobility.


  1. Thank you, Life saver as the MS instruction were incomplete


  2. Yes, thanks Mark. And to Google, for leading me here.


  3. Nice one Mark! I was struggling to find how to get this working! Usual MS articles missing key info!


  4. 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!


  5. 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: …”


  6. 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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s