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'm trying to install SQL Server 2012 on Win 2012 r2 server remotely via Powershell using Invoke-Command, but it fails with this error

"Validation for setting 'SQLSVCACCOUNT' failed. Error message: The SQL Server service account login or password is not valid. Use SQL Server Configuration Manager to update the service account."

The login and the password are correct. When i execute the same command directly on the server it works fine.. i don't understand.

I'm using Domain Administrator credentials to iniate my PSSession.

This is my code :

$SApwd = "MyPassword"
$ServiceAccount= "SPRINGFIELD\SQLCitrix"
$ServicePassword = "MyPassword"
$SqlCollation = "French_CI_AS"

$user = "Springfield\Administrator"
$password = ConvertTo-SecureString -AsPlainText -Force -String "MyPassword"
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$password
$session = New-PSSession -ComputerName $ipsqlserver -Credential $credentials

Invoke-Command -Session $session -ScriptBlock {Set-Location -Path C:\sources\sql } 

There is a more detailled log file here :

Thanks for your help

share|improve this question
up vote 1 down vote accepted

You need to let the target machine be trusted for delegation. In ADUC go to the properties of the target computer->Delegation tab-> Trust this computer for delegation to any service (Kerberos only). Then set correct SPNs to allow the service account to impersonate target box:

setspn -A MSSQLSvc/FQDNofYourTargetBox domain\accountname 
setspn -A MSSQLSvc/FQDNofYourTargetBox:1433 domain\accountname
setspn -A MSSQLSvc/NetbiosNameofYourTargetBox domain\accountname

Allow some time for SPN information to propagate through your forest and try again. More about SPNs here:

share|improve this answer
Thank you, but i'm getting the same error... i updated my post with pastebin link for detailled log. I searched a lot but didn't find anything in the log file. – Adeel ASIF Jul 3 '14 at 13:48
Edited my answer, try the extra steps. – Raf Jul 3 '14 at 14:00
Thanks but it's not working. I tried directly on my server (again) , and it's working. I don't understand why via Invoke-Command it's not working, it should be the same... – Adeel ASIF Jul 3 '14 at 15:50

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.