I need some help in automating deploying some applications on my domain. The deployment process follows this basic flow in a Powers Shell script:
I'd like to cut out step 3 and integrate it in my script. What I've got so far is
$starter = New-PSSession -ComputerName ServerName -Credential:'domain\user' -Authentication Kerberos
Invoke-Command -Session $starter -ScriptBlock {
\Services\Shipping\ShippingService.exe /deploy
}
This is paired down to just 1 application, but there are actually 5. The problem I have is that these applications use Integrated Security to access a Sql Server database so it fails with "System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'."
How do I get my remote session to run as the domain\user specified?
You are running into what is called a "Double Hop" Scenario. You are remoting into one machine and from there, accessing a remote share. This is possible using PowerShell but you have to use CredSSP authentication.
User contributions licensed under CC BY-SA 3.0