Can't install Azure AD Connect Cloud Sync silently without user interaction

Anonymous
2021-08-18T19:12:42.28+00:00

I am trying to follow this guide to install Azure AD Connect Cloud Sync using Powershell, ideally silently without user interaction:

https://learn.microsoft.com/en-us/azure/active-directory/cloud-sync/how-to-install-pshell

When trying to connect using the following commands, a login window opens instead of accepting my credentials.

$globalAdminPassword = ConvertTo-SecureString -String "Global admin password" -AsPlainText -Force
$globalAdminCreds = New-Object System.Management.Automation.PSCredential -ArgumentList ("GlobalAdmin@Company portal .onmicrosoft.com", $globalAdminPassword)
Connect-AADCloudSyncAzureAD -Credential $globalAdminCreds
I need to automate this so I don't understand why the credential I pass in this function don't seem to do anything and I get prompted with a login screen.

Any idea? I tried some powershell commands like NonInteractive or WindowStyle hidden, but no luck.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,629 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-08-18T19:39:18.493+00:00

    Found the problem! My password had a special character "`" which was disappearing using the above command. I found the difference using Get-Credential instead and converting the secure string back...


0 additional answers

Sort by: Most helpful