I am trying to install Exchange Cu 14 from Server A to Server B through Powershell remote and Invoke-command.
The installation completes successfully when running locally on Server B as the same logged on user... But not remote using Invoke-command from another server.
Running on Server A (Simplified version and $SetupPath and $Params is correct):
$ScriptBlock_ExchangeInstallation = {
Start-Process $SetupPath -ArgumentList $Params -NoNewWindow
}
$SessionOptions = New-PSSessionOption -MaxConnectionRetryCount 50 -IdleTimeout 86400000 -OperationTimeout 21600000
$SecPw= ConvertTo-SecureString "PwSuperSecure!" -AsPlainText -Force
$Creds = New-Object System.Management.Automation.PSCredential ("MrMarshall\Andreas.marshall", $SecPw)
Invoke-Command -ComputerName "ServerB" -SessionOption $SessionOptions -ScriptBlock $ScriptBlock_ExchangeInstallation -ErrorAction Stop -Authentication Kerberos -Credential $Creds
In the failed Exchange logs. I can see the error:
[11/12/2019 21:34:18.0728] [0] [ERROR] Active Directory operation failed on . The supplied credential for 'MRMARSHALL\andreas.marshall' is invalid. [11/12/2019 21:34:18.0728] [0] [ERROR] The supplied credential is invalid.
I feels like the credentials is not passed correctly towards the DC during the installation. Any ideas of how I could start the installation some another way?
More exceptions.
Microsoft.Exchange.Configuration.MonadDataProvider.MonadDataAdapterInvocationException: Active Directory operation failed on . The supplied credential for 'MRMARSHALL\andreas.marshall' is invalid. It was running the command 'Get-OrganizationConfig'. ---> Microsoft.Exchange.Data.Directory.ADInvalidCredentialException: Active Directory operation failed on . The supplied credential for 'MRMARSHALL\andreas.marshall' is invalid. ---> System.DirectoryServices.Protocols.LdapException: The supplied credential is invalid.
After some reading, this is a double hop issue just like @Semicolon commented. Now I could not configure kerberos for this so I went another way by scheduling a task locally and start it to run the job for me.
It's not pretty, but it works for now!
I am invoking the code below to start the process locally on the remote-servers.