Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need some help in automating deploying some applications on my domain. The deployment process follows this basic flow in a Powers Shell script:

  1. Stop services
  2. Copy out applications
  3. Log into at least 1 remote server and run "\Services\Shipping\ShippingService.exe /deploy"
  4. Start services.

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?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
I saw the CredSSP in the documentation, but couldn't get it to work. From my computer it kept telling me "CredSSP authentication is currently disabled in the client configuration." I thought I enabled it on the server, do I also need to enable it on my computer? – Kleinux Mar 31 '11 at 17:31
@Kleinux Yes you do need to enable the "client" role on your client machine as well as telling the server that it is the "server" role. Then when using invoke-command include -Authentication CredSSP – rob Feb 27 '14 at 14:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.