SMS SQL for Last Hardware Inventory

The following SQL Query will return last HW Inventory date for a specific computer. Code is based on the client health queries by Paul Thomsen.

-- Last hardware inventory

select Name0, LastHWScan as 'HW Inventory'
from v_R_System sys full join v_RA_System_SMSAssignedSites ass ON ass.resourceID=SYS.resourceID
full join v_GS_WORKSTATION_STATUS WS ON WS.resourceID=sys.resourceID
where client0=1
and Name0 = 'computername'

About the Author

Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin."

Ready to move from VBScript to the Cloud? Check out his book, Pro PowerShell for Amazon Web Services.

Visit EmmanuelTsouris.com for his latest projects.

As an Amazon Associate, I earn from qualifying purchases at no cost to you.

Comments

Popular posts from this blog

SMS "Program failed (run time exceeded)" 10070

SMS "Waiting for User Condition" 10036

Reading the SCCM Client GUID