Well this standard report actually does provide data but it is very deceptive.
Here is the sql:
DECLARE @sql NVARCHAR(MAX)
DECLARE @Num NVARCHAR(MAX)
IF '%Number%' = '' OR '%Number%' <= 0
BEGIN
SET @Num = '0'
END
ELSE
BEGIN
SET @Num = '%Number%'
END
SET @sql= 'DECLARE @v1_TrusteeScope nvarchar(max)
SET @v1_TrusteeScope = N''%TrusteeScope%''
SELECT TOP '+@Num+
' v.[Name] AS ''Computer Name'',
v.[Domain] AS ''Domain'',
t1.[Last Boot Up Time] AS ''Up Since'',
v.[Guid] AS ''Guid''
FROM
dbo.vOSOperatingSystem t1
JOIN dbo.vComputer v
ON t1.[_ResourceGuid] = v.[Guid]
JOIN dbo.ScopeMembership sm
ON sm.[ResourceGuid] = v.Guid
AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
ORDER BY
t1.[Last Boot Up Time] ASC'
EXEC (@sql)
This gives us a number of machines ordered by longest. Using:
dbo.vOSOperatingSystem.[Last Boot Up Time]
The problem is what if a PC is shut down? How does it determine it is no longer UP as the report suggest? Not sure if when shutting down the agent does something to this field but I don't see anything.
That makes this report soooooo horribly defined it is amazing it's in the list of standard reports. Am I missing something!
Let's put it this way. The machine with the longest uptime does not even exist anymore!