Showing all Computers (With Boot Time)

Showing All computers in SCCM that have software installed, with the last boot time listed



DECLARE @lookup as varchar (50)
set @lookup = ‘%’
SELECT     TOP (100) PERCENT dbo.v_R_System.Name0, dbo.v_GS_OPERATING_SYSTEM.LastBootUpTime0,
DATEDIFF(Day,dbo.v_GS_OPERATING_SYSTEM.LastBootUpTime0, GETDATE()) AS [Days since last boot],
dbo.v_GS_OPERATING_SYSTEM.Caption0

FROM         dbo.v_GS_OPERATING_SYSTEM 
INNER JOIN dbo.v_R_System ON dbo.v_GS_OPERATING_SYSTEM.ResourceID = dbo.v_R_System.ResourceID
WHERE     dbo.v_R_System.Name0 in 

(SELECT     vrs.Name0 FROM v_r_system AS vrs
JOIN v_GS_INSTALLED_SOFTWARE AS VIS ON VIS.resourceid = vrs.resourceid
JOIN v_GS_SoftwareFile AS sf ON SF.resourceid = vrs.resourceid

WHERE     VIS.productname0 LIKE @lookup 

GROUP BY vrs.Name0)


ORDER BY [Days since last boot]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s