SCCM LastStatusChangeTime updates every day

I run this below VBS script every day at SCCM customers to get better an more accurate patch installation status from clients:

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

I took it from Microsoft msdn so it’s supported:
http://msdn.microsoft.com/en-us/library/cc146437.aspx

The only down side i have seen is that the LastStatusChangeTime is updated every time the script is run and therefore you can’t use this field to validate the patch installation date. I query “Add remove programs” table and the patch KB number for that.

LastStatusChangeTime in SCCM

Technorati-taggar: ,,,,