You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WHEN [owi].[windows_release] ='5'THEN'You''re running a really old version: Windows 2000, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6602
-
WHEN [owi].[windows_release] >'5'AND [owi].[windows_release] <'6'THEN'You''re running a really old version: Windows Server 2003/2003R2 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6603
-
WHEN [owi].[windows_release] >='6'AND [owi].[windows_release] <='6.1'THEN'You''re running a pretty old version: Windows: Server 2008/2008R2 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6604
-
WHEN [owi].[windows_release] ='6.2'THEN'You''re running a rather modern version of Windows: Server 2012 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6605
-
WHEN [owi].[windows_release] ='6.3'THEN'You''re running a pretty modern version of Windows: Server 2012R2 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6606
-
WHEN [owi].[windows_release] >'6.3'THEN'Hot dog! You''re living in the future! You''re running version '+CAST([owi].[windows_release] ASVARCHAR(5))
6607
-
ELSE'I have no idea which version of Windows you''re on. Sorry.'
6631
+
WHEN [ohi].[host_platform] ='Linux'THEN'You''re running the '+CAST([ohi].[host_distribution] ASVARCHAR(35)) +' distribution of '+CAST([ohi].[host_platform] ASVARCHAR(35)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6632
+
WHEN [ohi].[host_platform] ='Windows'AND [ohi].[host_release] ='5'THEN'You''re running a really old version: Windows 2000, version '+CAST([ohi].[host_release] ASVARCHAR(5))
6633
+
WHEN [ohi].[host_platform] ='Windows'AND [ohi].[host_release] >'5'AND [ohi].[host_release] <'6'THEN'You''re running a really old version: '+CAST([ohi].[host_distribution] ASVARCHAR(50)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6634
+
WHEN [ohi].[host_platform] ='Windows'AND [ohi].[host_release] >='6'AND [ohi].[host_release] <='6.1'THEN'You''re running a pretty old version: Windows: '+CAST([ohi].[host_distribution] ASVARCHAR(50)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6635
+
WHEN [ohi].[host_platform] ='Windows'AND [ohi].[host_release] ='6.2'THEN'You''re running a rather modern version of Windows: '+CAST([ohi].[host_distribution] ASVARCHAR(50)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6636
+
WHEN [ohi].[host_platform] ='Windows'AND [ohi].[host_release] ='6.3'THEN'You''re running a pretty modern version of Windows: '+CAST([ohi].[host_distribution] ASVARCHAR(50)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6637
+
WHEN [ohi].[host_platform] ='Windows'AND [ohi].[host_release] >'6.3'THEN'Hot dog! You''re living in the future! You''re running '+CAST([ohi].[host_distribution] ASVARCHAR(50)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6638
+
ELSE'You''re running '+CAST([ohi].[host_distribution] ASVARCHAR(35)) +', version '+CAST([ohi].[host_release] ASVARCHAR(5))
6608
6639
END
6609
6640
) AS [Details]
6610
-
FROM [sys].[dm_os_windows_info] [owi];
6611
-
6641
+
FROM [sys].[dm_os_host_info] [ohi];
6612
6642
END;
6643
+
ELSE
6644
+
BEGIN
6645
+
-- Otherwise, stick with Windows-only detection
6646
+
6647
+
IFEXISTS ( SELECT1
6648
+
FROMsys.all_objects
6649
+
WHEREname='dm_os_windows_info' )
6650
+
6651
+
BEGIN
6652
+
6653
+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 172) WITHNOWAIT;
WHEN [owi].[windows_release] ='5'THEN'You''re running a really old version: Windows 2000, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6671
+
WHEN [owi].[windows_release] >'5'AND [owi].[windows_release] <'6'THEN'You''re running a really old version: Windows Server 2003/2003R2 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6672
+
WHEN [owi].[windows_release] >='6'AND [owi].[windows_release] <='6.1'THEN'You''re running a pretty old version: Windows: Server 2008/2008R2 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6673
+
WHEN [owi].[windows_release] ='6.2'THEN'You''re running a rather modern version of Windows: Server 2012 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6674
+
WHEN [owi].[windows_release] ='6.3'THEN'You''re running a pretty modern version of Windows: Server 2012R2 era, version '+CAST([owi].[windows_release] ASVARCHAR(5))
6675
+
WHEN [owi].[windows_release] >'6.3'THEN'Hot dog! You''re living in the future! You''re running version '+CAST([owi].[windows_release] ASVARCHAR(5))
6676
+
ELSE'I have no idea which version of Windows you''re on. Sorry.'
6677
+
END
6678
+
) AS [Details]
6679
+
FROM [sys].[dm_os_windows_info] [owi];
6680
+
6681
+
END;
6682
+
END;
6613
6683
END;
6614
6684
6615
6685
/*
@@ -6782,13 +6852,15 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
6782
6852
6783
6853
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 83) WITHNOWAIT;
6784
6854
6855
+
-- DATETIMEOFFSET and DATETIME have different minimum values, so there's
6856
+
-- a small workaround here to force 1753-01-01 if the minimum is detected
6785
6857
SET @StringToExecute ='INSERT INTO #BlitzResults (CheckID, Priority, FindingsGroup, Finding, URL, Details)
6786
6858
SELECT 83 AS CheckID ,
6787
6859
250 AS Priority ,
6788
6860
''Server Info'' AS FindingsGroup ,
6789
6861
''Services'' AS Finding ,
6790
6862
'''' AS URL ,
6791
-
N''Service: '' + servicename + N'' runs under service account '' + service_account + N''. Last startup time: '' + COALESCE(CAST(CAST(last_startup_time AS DATETIME) AS VARCHAR(50)), ''not shown.'') + ''. Startup type: '' + startup_type_desc + N'', currently '' + status_desc + ''.''
6863
+
N''Service: '' + servicename + N'' runs under service account '' + service_account + N''. Last startup time: '' + COALESCE(CAST(CASE WHEN YEAR(last_startup_time) <= 1753 THEN CAST(''17530101'' as datetime) ELSE CAST(last_startup_time AS DATETIME) END AS VARCHAR(50)), ''not shown.'') + ''. Startup type: '' + startup_type_desc + N'', currently '' + status_desc + ''.''
6792
6864
FROM sys.dm_server_services OPTION (RECOMPILE);';
6793
6865
6794
6866
IF @Debug =2AND @StringToExecute ISNOTNULLPRINT @StringToExecute;
0 commit comments