Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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 at 14:17
add comment

Your Answer

 
discard

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.