Powershell Remoting始终以匿名身份login

我需要一些帮助来自动化在我的域上部署一些应用程序。 部署过程遵循Powershell脚本中的基本stream程:

  1. 停止服务
  2. 复制应用程序
  3. login到至less1个远程服务器并运行“\ Services \ Shipping \ ShippingService.exe / deploy”
  4. 开始服务。

我想删除第3步并将其集成到我的脚本中。 我到目前为止是

$starter = New-PSSession -ComputerName ServerName -Credential:'domain\user' -Authentication Kerberos Invoke-Command -Session $starter -ScriptBlock { \Services\Shipping\ShippingService.exe /deploy } 

这是成对的只有一个应用程序,但实际上是5.我遇到的问题是,这些应用程序使用集成安全访问Sql Server数据库,因此它失败,“System.Data.SqlClient.SqlException(0x80131904):login失败为用户'NT AUTHORITY \ ANONYMOUS LOGON'。“

如何让远程会话以指定的域\用户身份运行?

你正在进入所谓的“双跳”情景。 您正在远程访问一台机器,然后从那里访问远程共享。 这是可能的使用PowerShell,但你必须使用CredSSP身份validation。