question

SyedNasiruddinsShahSs-3522 avatar image
0 Votes"
SyedNasiruddinsShahSs-3522 asked kalyansundar-6796 answered

SCCM api or powershell code to get live patch installation update (Software center)

Hi Team,

Please help us as we are looking to get live patch updates for the windows patches installed using software center.

Do we have any SCCM api which will help us or any powershell module to get exact status of patches.

How to get to know reboot status of the machine after the patch is installed or when patch installation needs reboot.

mem-cm-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered SyedNasiruddinsShahSs-3522 commented

Hi SyedNasiruddinsShahSs-3522,

You can get the status of specific updates using this example:

$sudeploy = Get-CMSoftwareUpdateDeployment -Name "Patch Tuesday - Office and Edge 2020-07-15 00:11:11"
Get-CMSoftwareUpdateDeploymentStatus -InputObject $sudeploy

Source: https://docs.microsoft.com/en-us/powershell/module/configurationmanager/get-cmsoftwareupdatedeploymentstatus?view=sccm-ps

Software Centre displays progress for software installs and advertisements. It does not show patch status other than Installed/Missing, so I suspect if you want to enumerate the progress status for that patch, you'll need to scrape logs to determine if the client is doing anything with each respective patch to create a calculated status message at runtime. You can read more here:

https://docs.microsoft.com/en-us/sccm/sum/understand/software-updates-introduction#BKMK_SUMCompliance


I hope this answers your question.



--If the reply is helpful, please Upvote and Accept as answer--

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi LimitlessTechnology-2700

I am getting module not found error, is there a way where we can directly check using an rest api
Do we have any api from SCCM which will query the server and get us the exactly status

0 Votes 0 ·
Garth avatar image
1 Vote"
Garth answered SyedNasiruddinsShahSs-3522 commented

Personally i would query the Sql views directly, it will be fast then querying the API. https://docs.microsoft.com/en-us/mem/configmgr/develop/core/understand/sqlviews/sql-server-views-configuration-manager

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Grath,

we don't have access to sql database, if you can help us away using rest api

0 Votes 0 ·
kalyansundar-6796 avatar image
0 Votes"
kalyansundar-6796 answered

You can also use CMPivot to get live data where you can refer quickfixEngineering -> InstalledBy

https://www.anoopcnair.com/sccm-cmpivot-query-patches-installed-in-last-90-days-configmgr/

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.