Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Unable to install updates via Powershell

  • Thread starter Thread starter jellekamma
  • Start date Start date
  • Replies Replies 0
  • Views Views 684

jellekamma

New Member
Messages
1
Reaction score
0
Points
1
I am migrating from a standalone WSUS server to SCCM Software updates. I can see the updates in software center and install them just fine. However, I want to be able to install the updates manually via powershell.

I found this command to install all available updates: ([wmiclass]'ROOT\ccm\ClientSDK:CCM_SoftwareUpdatesManager').InstallUpdates([System.Management.ManagementObject[]] (get-wmiobject -query 'SELECT * FROM CCM_SoftwareUpdate' -namespace 'ROOT\ccm\ClientSDK'))
this prompts me with an error:

Exception calling "InstallUpdates" : ""
At line:1 char:1
+ ([wmiclass]'ROOT\ccm\ClientSDK:CCM_SoftwareUpdatesManager').InstallUp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WMIMethodException


If I run: get-wmiobject -query 'SELECT * FROM CCM_SoftwareUpdate' -namespace 'ROOT\ccm\ClientSDK' I can see all the updates. SO my question is, how do I install them via powershell?
 
Back
Top