Enable-O365integration : Credential cannot be authenticated

Enable-O365integration : Credential cannot be authenticated
At line:1 char:1
+ Enable-O365integration -o365accountupn "xxxxxxxxxxxxxxxxxxxxxxxxxxx" -Pas ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Enable-O365Integration], O365ConfigureException
+ FullyQualifiedErrorId : InvalidInvoke,Microsoft.WindowsServerSolutions.O365Integration.EnableO365IntegrationPSCmdlet

If you ever get this error you need to disable the windows azure active directory sync in the Dashboard before continuing