remotely patch sql 2012, hangs using poewrshell winrm


  • I am trying to remotely patch an sql server. I am using credssp and WINRM with powershell to run the installer but it doesn't work. The first get-childitem works so I am sure that it is not a credssp/authentication issue. The second command just keeps running/hang. Is there anything I can do get any error message?

    $Password = 'strongpassword'
    $pass = ConvertTo-SecureString -AsPlainText $Password -Force
    $Credential = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
    Invoke-Command -ComputerName $ComputerName -Credential $Credential -ScriptBlock { Get-ChildItem <IPAddress>\d$\Software\MSSQL\MSSQL2012\ServicePacks}
    Invoke-Command -ComputerName $ComputerName -Credential $Credential -ScriptBlock { start-process -Filepath "<IPAddress>\d$\Software\MSSQL\MSSQL2012\ServicePacks\SQLServer2012SP3KB3072779x64ENU.exe" -ArgumentList "/q /allinstances /IAcceptSQLServerLicenseTerms /Action=Patch" -wait }

        Directory: <IPAddress>\d$\Software\MSSQL\MSSQL2012\ServicePacks

    Mode                LastWriteTime     Length Name                                                      PSComputerName                                          
    ----                -------------     ------ ----                                                      --------------                                          
    -a---         2/24/2017   2:25 AM 1066843840 SQLServer2012SP3KB3072779x64ENU.exe                       privateservername 

    ............The second one keeps running without giving any message and it runs forever. Nothing in eventlog or the setup bootstrap location.

    Notes: I had removed '-' as a part of troubleshooting so it is intended

    I have changed the IP addresses and hostnames.

    • Edited by HumayunM Tuesday, April 25, 2017 6:15 AM
    Tuesday, April 25, 2017 6:13 AM

All replies

  • Hi HumayunM,

    Your commands seems fine, and since you mentioned there is nothing in setup bootstrap location, I’m guessing the decompression process was never finished so the installation cannot continue. Could you please navigate to temp folder(%temp%) and locate the corresponding files that looks likeSqlSetup.log’ and ‘SQLServer2012-KB3072779-x64_decompression_log.txt’ and share your finding here?

    If you have any other questions, please let me know.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, May 1, 2017 6:12 AM