@@ -9867,7 +9867,7 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
98679867 WHERE LOWER (cmdshell_output) = ( SELECT LOWER ([service_account])
98689868 FROM [sys].[dm_server_services]
98699869 WHERE [servicename] LIKE ' SQL Server%'
9870- AND [servicename] NOT LIKE ' SQL Server Agent%'
9870+ AND [servicename] NOT LIKE ' SQL Server% Agent%'
98719871 AND [servicename] NOT LIKE ' SQL Server Launchpad%' ))
98729872 BEGIN
98739873 INSERT INTO #BlitzResults
@@ -9913,7 +9913,7 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
99139913 FROM #localadmins
99149914 WHERE LOWER (cmdshell_output) = ( SELECT LOWER ([service_account])
99159915 FROM [sys].[dm_server_services]
9916- WHERE [servicename] LIKE ' SQL Server Agent%'
9916+ WHERE [servicename] LIKE ' SQL Server% Agent%'
99179917 AND [servicename] NOT LIKE ' SQL Server Launchpad%' ))
99189918 BEGIN
99199919 INSERT INTO #BlitzResults
@@ -9939,14 +9939,23 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
99399939 /* had to use a different table name because SQL Server/SSMS complains when parsing that the table still exists when it gets to the create part*/
99409940 IF OBJECT_ID (' tempdb..#localadminsag' ) IS NOT NULL DROP TABLE #localadminsag;
99419941 CREATE TABLE #localadminsag (cmdshell_output NVARCHAR (1000 ));
9942- INSERT INTO #localadmins
9943- EXEC /**/ xp_cmdshell/**/ N ' net localgroup administrators' /* added comments around command since some firewalls block this string TL 20210221 */
9942+ /* language specific call of xp cmdshell */
9943+ IF (SELECT os_language_version FROM sys .dm_os_windows_info ) = 1031 /* os language code for German. Again, this is a very specific fix, see #3673 */
9944+ BEGIN
9945+ INSERT INTO #localadminsag
9946+ EXEC /**/ xp_cmdshell/**/ N ' net localgroup Administratoren' /* german */
9947+ END
9948+ ELSE
9949+ BEGIN
9950+ INSERT INTO #localadminsag
9951+ EXEC /**/ xp_cmdshell/**/ N ' net localgroup administrators' /* added comments around command since some firewalls block this string TL 20210221 */
9952+ END
99449953
99459954 IF EXISTS (SELECT 1
9946- FROM #localadmins
9955+ FROM #localadminsag
99479956 WHERE LOWER (cmdshell_output) = ( SELECT LOWER ([service_account])
99489957 FROM [sys].[dm_server_services]
9949- WHERE [servicename] LIKE ' SQL Server Agent%'
9958+ WHERE [servicename] LIKE ' SQL Server% Agent%'
99509959 AND [servicename] NOT LIKE ' SQL Server Launchpad%' ))
99519960 BEGIN
99529961 INSERT INTO #BlitzResults
0 commit comments