state messages for some reason is not being updated correctly Causes Updates Compliance Report Issue

run the below script to get the actual system state. this will help to report back actual compliance of patch level to SCCM Server

 

Option Explicit
On Error Resume Next

Call RefreshServerComplianceState

' WScript.Echo "Finished"

Sub RefreshServerComplianceState()

    ' Initialize the UpdatesStore variable.
    dim newCCMUpdatesStore
    ' Create the COM object.
    set newCCMUpdatesStore = CreateObject ("Microsoft.CCM.UpdatesStore")

    ' Refresh the server compliance state by running the RefreshServerComplianceState method.
    newCCMUpdatesStore.RefreshServerComplianceState
    ' Output success message.
'    wscript.echo "Ran RefreshServerComplianceState."

End Sub

0 comments:

Post a Comment