December 16, 2015 at 4:59 pm
Is there a way to get list of Pending HotfixID yet to be installed from a windows 2012 server remotely using Powershell?
December 17, 2015 at 3:13 pm
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
January 8, 2016 at 2:39 pm
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
January 8, 2016 at 2:43 pm
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
January 9, 2016 at 2:55 pm
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