Receiving the following error using the Microsoft Azure Active Directory Connect tool.

'Microsoft.Online.Administration.Automation.MicrosoftOnlineException' was thrown.

This program was running fine. Have tried reinstalling the program, restarting the server, and restarting the Microsoft Online Services Sign-in Assistant service.

Microsoft Azure Active Directory Connect authentication error

2 Answers 2


Make sure you don't have two factor authentication on the account you use for Directory Sync. If you recently enabled it, that would explain the problem.

Also, remember that the passwords expire periodically by default in Office 365. So Directory Sync will quit working periodically and require manual intervention.

Try connecting to Office 365 with PowerShell using the same account and see if you get an error.

As a general best practice, you should make a dedicated in-cloud admin account just for Directory Sync.

  • You should be setting the password doesn't expire flag for the AD Connect accounts in use.
    – MDMarra
    Sep 10, 2015 at 11:46
  • @MDMarra that's a trade off between security and convenience. But yes you can do that. Sep 10, 2015 at 13:21
  • "Try connecting to Office 365 with PowerShell using the same account and see if you get an error. " That would be my next step, as well as creating a new account specifically for sync. Sep 10, 2015 at 16:13
  • Thanks for the replies. Two factor authentication hasn't been enabled. Passwords are set to never expire within the Office 365 portal.
    – Ash
    Sep 10, 2015 at 23:23
  • I can login to Office 365 with PowerShell using the admin@ account. No error received, but did get the following warning: PS C:\> Import-PSSession $Session WARNING: Proxy creation has been skipped for the following command: 'TabExpansion', because it would shadow an existing local command. Use the AllowClobber parameter if you want to shadow existing local commands. WARNING: Some imported command names include unapproved verbs which might make them less discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of approved verbs.
    – Ash
    Sep 10, 2015 at 23:23

Make sure that your server is assigned a static IP address. The problem is a bit more than it seems on the front, and is because the Microsoft .NET Framework on which your identity sync appliance is based doesn't recognize your proxy settings.

Open the following file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config.

Add the following text to the end of the file:

<system.net> <defaultProxy> <proxy usesystemdefault="true" proxyaddress="http://<PROXYIP>:80" bypassonlocal="true" /> </defaultProxy> </system.net>

In this text, the placeholder <PROXYIP> represents the actual proxy IP address and this IP address is the static IP address of your server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.