Create a collection of computers that has not been windows update from last 30 days

Hi All,

The query i am looking for is to "Create a collection of computers that has not been windows update from last 30 days". I have got some Powershell scripts which can perform the tasks, but I require this can be done from by WQL or SQL query.

Below are some related powershell article:

http://www.powershelladmin.com/wiki/Check_when_servers_were_last_patched_with_Windows_Update_via_COM_or_WSUS

https://gallery.technet.microsoft.com/scriptcenter/4d70947e-21b1-4a45-9d78-a7198ed55cca

Please share if somebody have the script.

May 18th, 2015 1:15pm

Hi, 

 This is a query to get the need information....

SELECT

v_R_System.Netbios_Name0Hostname,v_UpdateScanStatus.LastScanTime

          


[Last Scan]


FROM

v_R_System


JOIN


v_UpdateScanStatus

ONv_R_System.ResourceID=v_UpdateScanStatus.ResourceID



WHERE

v_UpdateScanStatus.LastScanTime<(GetDate()-30)


ORDER

BYLastScanTimeDESC

Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 2:22pm

Hi Jeovan,

I am getting below error while running the query in SQL:

May 18th, 2015 3:47pm

ONv_R_System.ResourceID --> ON v_R_System.ResourceID and BYLastScanTimeDESC --> BY LastScanTime DESC
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 3:52pm

Sorry man....
 Revise the 8 line
ONv_R_System.ResourceID to ON v_R_System.ResourceID
May 18th, 2015 3:54pm

ONv_R_System.ResourceID --> ON v_R_System.ResourceID and BYLastScanTimeDESC --> BY LastScanTime DESC
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 4:02pm

Hi,

Thanks for the help. Now Query is working, But my question is to find the Last update install time on machine not last scan time.

Above highlighted value can be fetch from below registry value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install REG_SZ: LastSuccessTime

May 19th, 2015 12:52am

That would require to modify hardware inventory. 

Win32_QuickfixEngineering also contains the install date. 

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 2:06am

Thanks,

Now I am able to fetch the Last install date in SCCM by Win32_QuickfixEngineering. 

I have created the same query to fetch Last install date as the same used in last software scan query.

Now the outcome of the report something like showing all updates less than 30 days.. I need some fine tuining here which will fetch the machine with time stamp details from last 30 days. Only a single Installed date against the mac

May 20th, 2015 3:03pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics