SMS SQL to show Last HW Scan by Day & Hour
A quick and dirty query to show status of your hardware scan for the last few days, add a darepart yy for year and mm for month if you are looking back more than just the current month.
----Begin SQL----
SELECT DatePart(dd,HWSCAN.LastHWScan), DatePart(hh,HWSCAN.LastHWScan), Count(*)
From v_GS_WORKSTATION_STATUS HWSCAN
Where LastHWScan > '2007-06-01'
Group By DatePart(dd,HWSCAN.LastHWScan), DatePart(hh,HWSCAN.LastHWScan)
Order by DatePart(dd,HWSCAN.LastHWScan), DatePart(hh,HWSCAN.LastHWScan)
----End SQL----
----Begin SQL----
SELECT DatePart(dd,HWSCAN.LastHWScan), DatePart(hh,HWSCAN.LastHWScan), Count(*)
From v_GS_WORKSTATION_STATUS HWSCAN
Where LastHWScan > '2007-06-01'
Group By DatePart(dd,HWSCAN.LastHWScan), DatePart(hh,HWSCAN.LastHWScan)
Order by DatePart(dd,HWSCAN.LastHWScan), DatePart(hh,HWSCAN.LastHWScan)
----End SQL----
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