Patching a remote computer

This topic contains 5 replies, has 3 voices, and was last updated by Profile photo of Daniel Krebs Daniel Krebs 3 years ago.

  • Author
    Posts
  • #16433
    Profile photo of H Man
    H Man
    Participant

    Im running this command , and get no error but its not installing the hot fix

    Invoke-Command -ComputerName br123456 -ScriptBlock {
    $arg = " /install C:\hotfixes\Windows6.1-KB2617858-x64.msu /quiet /norestart "
    start-process c:\windows\system32\wusa.exe -argumentlist $arg
    }

    i think these services might have a play in it
    "wscsvc", "CcmExec"

  • #16434
    Profile photo of H Man
    H Man
    Participant

    i got it to work with psexec

    psexec \\$target -u "domian\user" -p "p@ssword" -s wusa "\\$target\ADMIN$\Windows6.1-KB2617858-x64.msu" /quiet /norestart

  • #16483
    Profile photo of Nobody
    Nobody
    Participant

    Try using $args vs $arg

    about_Automatic_Variables

  • #16485
    Profile photo of H Man
    H Man
    Participant

    thank you for the info

  • #16499
    Profile photo of Daniel Krebs
    Daniel Krebs
    Moderator

    You've encountered a "feature" of the Windows Update installation system related to logon type of a PowerShell Remoting session (Invoke-Command, etc.). The creator of the PowerShell Deployment Toolkit (PDT) found a different workaround which involves scheduled tasks and explains why it does not work in below video from TechEd North America 2014. Watch the complete video or jump in at or before 00:28:57.

    Video:
    http://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/DCIM-B361

    PDT download if you are interested:
    http://gallery.technet.microsoft.com/PowerShell-Deployment-f20bb605

  • #16501
    Profile photo of Daniel Krebs
    Daniel Krebs
    Moderator

    Last but not least. The CcmExec process is the System Center Configuration Manager (SCCM) client which would be a better solution than using PsExec to install Windows Updates. If you have access to SCCM system or can ask someone to package the updates and deploy them for you.

You must be logged in to reply to this topic.