How to get list of pending HotfixID from a remote server using Powershell

  • Is there a way to get list of Pending HotfixID yet to be installed from a windows 2012 server remotely using Powershell?

  • Yes....this should get you started:

    $upd = new-object -com Microsoft.Update.Session "MyComputer"

    $searcher = $upd.CreateUpdateSearcher()

    $searcher

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • Hello Shawn. Please don't ming but can you give me exact commands to get the results? I'm getting errors when i run below command.

    $upd = new-object -com Microsoft.Update.Session "MyComputer"

    $searcher = $upd.CreateUpdateSearcher()

    $searcher

  • Not really, I have no environment to run this command in. What error are you getting?

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • PS C:\Windows\System32\WindowsPowerShell\v1.0> $upd = new-object -com Microsoft.Update.Session "MyServerName"

    $searcher = $upd.CreateUpdateSearcher()

    $searcher

    New-Object : A positional parameter cannot be found that accepts argument 'MyServerName'.

    At line:1 char:8

    + $upd = new-object -com Microsoft.Update.Session "MyServerName"

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidArgument: (:) [New-Object], ParameterBindingException

    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

    You cannot call a method on a null-valued expression.

    At line:2 char:1

    + $searcher = $upd.CreateUpdateSearcher()

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply