Assets/cmhealthcheck.xml
<?xml version="1.0" standalone="yes"?>
<dtsHealthCheck xmlns="http://tempuri.org/HealthCheckDataSet.xsd"> <HealthCheck> <section>1</section> <IsTextOnly>true</IsTextOnly> <Description>Basic ConfigMgr Information</Description> <IsActive>true</IsActive> <WordStyle>Heading 1</WordStyle> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_SiteInformation</XMLFile> <Description>Configuration Manager Site Summary</Description> <IsActive>true</IsActive> <PrintType>simpletable</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>SQL</querytype> <sqlquery> DECLARE @SiteCode CHAR(3) DECLARE @ServerName VARCHAR(255) DECLARE @RoleName VARCHAR(255) DECLARE @RoleNameLower VARCHAR(255) DECLARE @SMSProvider VARCHAR(8000) DECLARE @DP VARCHAR(8000) DECLARE @MP VARCHAR(8000) DECLARE @FSP VARCHAR(8000) DECLARE @RSP VARCHAR(8000) DECLARE @EPP VARCHAR(8000) DECLARE @SUP VARCHAR(8000) DECLARE @AISP VARCHAR(8000) DECLARE @AWS VARCHAR(8000) DECLARE @PWS VARCHAR(8000) DECLARE @SMP VARCHAR(8000) DECLARE @SNS VARCHAR(8000) DECLARE @SQLVersion VARCHAR(50) DECLARE @SQLSP VARCHAR(50) DECLARE @SQLEdition VARCHAR(500) DECLARE @SSBPort INT DECLARE @SQLPort INT DECLARE @SiteNumber int DECLARE @CPC VARCHAR(8000) DECLARE @DWP VARCHAR(8000) DECLARE @DMP VARCHAR(8000) DECLARE @SCP VARCHAR(8000) SET @SMSProvider = '' SET @DP = '' SET @MP = '' SET @FSP = '' SET @RSP = '' SET @EPP = '' SET @SUP = '' SET @AISP = '' SET @AWS = '' SET @PWS = '' SET @SMP = '' SET @SNS = '' SET @CPC = '' SET @DWP = '' SET @DMP = '' SET @SCP = '' SELECT @SiteCode = '@@SITECODE@@' SELECT @SiteNumber = SiteNumber FROM SC_SiteDefinition WHERE SiteCode = @SiteCode SELECT @SQLVersion = CONVERT(VARCHAR(50), SERVERPROPERTY('productversion')), @SQLSP = CONVERT(VARCHAR(50), SERVERPROPERTY ('productlevel')), @SQLEdition = CONVERT(VARCHAR(500), SERVERPROPERTY ('edition')) SELECT @SSBPort = Value3 FROM SC_SiteDefinition_Property WHERE Name = 'SSBPort' AND SiteNumber = @SiteNumber SELECT @SQLPort = Value3 FROM SC_SiteDefinition_Property WHERE Name = 'SQLServicePort' AND SiteNumber = @SiteNumber DECLARE @ServerList CURSOR SET @ServerList = CURSOR FAST_FORWARD FOR SELECT RoleName, ServerName FROM vSMS_SC_SysResUse WHERE SiteCode = @SiteCode OPEN @ServerList FETCH NEXT FROM @ServerList INTO @RoleName,@ServerName WHILE @@FETCH_STATUS = 0 BEGIN IF @RoleName = 'SMS Provider' BEGIN IF LEN(@SMSProvider) <> 0 SET @SMSProvider = @SMSProvider + ', ' SET @SMSProvider = @SMSProvider + @ServerName END IF @RoleName = 'SMS Distribution Point' BEGIN IF LEN(@DP) <> 0 SET @DP = @DP + ', ' SET @DP = @DP + @ServerName END IF @RoleName = 'SMS Management Point' BEGIN IF LEN(@MP) <> 0 SET @MP = @MP+ ', ' SET @MP = @MP+ @ServerName END IF @RoleName = 'SMS Fallback Status Point' BEGIN IF LEN(@FSP) <> 0 SET @FSP = @FSP+ ', ' SET @FSP = @FSP+ @ServerName END IF @RoleName = 'SMS SRS Reporting Point' BEGIN IF LEN(@RSP) <> 0 SET @FSP = @RSP+ ', ' SET @RSP = @RSP+ @ServerName END IF @RoleName = 'SMS Endpoint Protection Point' BEGIN IF LEN(@EPP) <> 0 SET @EPP = @EPP+ ', ' SET @EPP = @EPP+ @ServerName END IF @RoleName = 'SMS Software Update Point' BEGIN IF LEN(@SUP) <> 0 SET @SUP = @SUP+ ', ' SET @SUP = @SUP+ @ServerName END IF @RoleName = 'AI Update Service Point' BEGIN IF LEN(@AISP) <> 0 SET @AISP = @AISP+ ', ' SET @AISP = @AISP+ @ServerName END IF @RoleName = 'SMS Application Web Service' BEGIN IF LEN(@AWS) <> 0 SET @AWS = @AWS+ ', ' SET @AWS = @AWS+ @ServerName END IF @RoleName = 'SMS Portal Web Site' BEGIN IF LEN(@PWS) <> 0 SET @PWS = @PWS+ ', ' SET @PWS = @PWS+ @ServerName END IF @RoleName = 'SMS State Migration Point' begin if Len(@SMP) <> 0 set @PWS = @SMP+ ', ' set @SMP = @SMP+ @ServerName END IF @RoleName = 'SMS Notification Server' BEGIN IF LEN(@SNS) <> 0 SET @SNS = @SNS+ ', ' SET @SNS = @SNS+ @ServerName END IF @RoleName = 'SMS Cloud Proxy Connector' BEGIN IF LEN (@CPC) <> 0 SET @CPC = @CPC+ ', ' set @CPC = @CPC+ @ServerName END IF @RoleName = 'Data Warehouse Service Point' BEGIN IF LEN (@DWP) <> 0 SET @DWP = @DWP+ ', ' set @DWP = @DWP+ @ServerName END IF @RoleName = 'SMS Dmp Connector' begin if Len (@DMP) <> 0 SET @DMP = @DMP+ ', ' set @DMP = @DMP+ @ServerName END IF @RoleName = 'SMS Service Connection Point' BEGIN IF LEN (@SCP) <> 0 SET @SCP = @SCP+ ', ' SET @DMP = @SCP+ @ServerName END FETCH NEXT FROM @ServerList INTO @RoleName,@ServerName END CLOSE @ServerList DEALLOCATE @ServerList SELECT s.SiteCode, s.SiteName, s.Version, s.BuildNumber, CASE WHEN RIGHT(s.Version,14) = '5.00.7958.1000' THEN '2012 R2 RTM' WHEN RIGHT(s.Version,14) = '5.00.7958.1203' THEN '2012 R2 CU1' WHEN RIGHT(s.Version,14) = '5.00.7958.1303' THEN '2012 R2 CU2' WHEN RIGHT(s.Version,14) = '5.00.7958.1401' THEN '2012 R2 CU3' WHEN RIGHT(s.Version,14) = '5.00.7958.1501' THEN '2012 R2 CU4' WHEN RIGHT(s.Version,14) = '5.00.7958.1604' THEN '2012 R2 CU5' WHEN RIGHT(s.Version,14) = '5.00.8239.1000' THEN '2012 R2 SP1' WHEN RIGHT(s.Version,14) = '5.00.8239.1203' THEN '2012 R2 SP1 CU1' WHEN RIGHT(s.Version,14) = '5.00.8239.1206' THEN '2012 R2 SP1 CU1 Hotfix 1' WHEN RIGHT(s.Version,14) = '5.00.8239.1211' THEN '2012 R2 SP1 CU1 Hotfix 2' WHEN RIGHT(s.Version,14) = '5.00.8239.1301' THEN '2012 R2 SP1 CU2' WHEN RIGHT(s.Version,14) = '5.00.8239.1403' THEN '2012 R2 SP1 CU3' WHEN RIGHT(s.Version,14) = '5.00.8239.1406' THEN '2012 R2 SP1 CU3 Hotfix 1' WHEN RIGHT(s.Version,14) = '5.00.8239.1407' THEN '2012 R2 SP1 CU3 Hotfix 2' WHEN RIGHT(s.Version,14) = '5.00.8239.1501' THEN '2012 R2 SP1 CU4' WHEN RIGHT(s.Version,14) = '5.00.8325.1000' THEN '1511' WHEN RIGHT(s.Version,14) = '5.00.8325.1005' THEN '1511 Hotfix 1 of 3' WHEN RIGHT(s.Version,14) = '5.00.8325.1010' THEN '1511 Hotfix 2 of 3' WHEN RIGHT(s.Version,14) = '5.00.8325.1126' THEN '1511 Hotfix 3 of 3' WHEN RIGHT(s.Version,14) = '5.00.8355.1000' THEN '1602' WHEN RIGHT(s.Version,14) = '5.00.8355.1306' THEN '1602 Hotfix 1 of 2' WHEN RIGHT(s.Version,14) = '5.00.8355.1307' THEN '1602 Hotfix 2 of 2' WHEN RIGHT(s.Version,14) = '5.00.8412.1000' THEN '1606' WHEN RIGHT(s.Version,14) = '5.00.8412.1204' THEN '1606 Hotfix 1 of 5' WHEN RIGHT(s.Version,14) = '5.00.8412.1205' THEN '1606 Hotfix 2 of 5' WHEN RIGHT(s.Version,14) = '5.00.8412.1207' THEN '1606 Hotfix 3 of 5' WHEN RIGHT(s.Version,14) = '5.00.8412.1307' THEN '1606 Hotfix 4 of 5' WHEN RIGHT(s.Version,14) = '5.00.8412.1309' THEN '1606 Hotfix 5 of 5' WHEN RIGHT(s.Version,14) = '5.00.8458.1000' THEN '1610' WHEN RIGHT(s.Version,14) = '5.00.8458.1520' THEN '1610 Hotfix 1 of 2' WHEN RIGHT(s.Version,14) = '5.00.8458.1526' THEN '1610 Hotfix 2 of 2' WHEN RIGHT(s.Version,14) = '5.00.8498.1000' THEN '1702' WHEN RIGHT(s.Version,14) = '5.00.8498.1700' THEN '1702 Hotfix 1' WHEN RIGHT(s.Version,14) = '5.00.8498.1711' THEN '1702 Hotfix 2' WHEN RIGHT(s.Version,14) = '5.00.8533.1000' THEN '1706' WHEN RIGHT(s.Version,14) = '5.00.8577.1000' THEN '1710' WHEN RIGHT(s.Version,14) = '5.00.8577.1108' THEN '1710 Hotfix 1' WHEN RIGHT(s.Version,14) = '5.00.8577.1115' THEN '1710 Hotfix 2' WHEN RIGHT(s.Version,14) = '5.00.8634.1007' THEN '1802' WHEN RIGHT(s.Version,14) = '5.00.8634.1813' THEN '1802 Hotfix 1' WHEN RIGHT(s.Version,14) = '5.00.8692.1003' THEN '1806' WHEN RIGHT(s.Version,14) = '5.00.8735.1000' THEN 'Preview 1810.2' WHEN RIGHT(s.Version,14) = '5.00.8740.1003' THEN '1810' WHEN RIGHT(s.Version,14) = '5.00.8748.1000' THEN 'Preview 1811' WHEN RIGHT(s.Version,14) = '5.00.8756.1000' THEN 'Preview 1812' WHEN RIGHT(s.Version,14) = '5.00.8772.1000' THEN 'Preview 1901' WHEN RIGHT(s.Version,14) = '5.00.8782.1000' THEN 'Preview 1902' WHEN RIGHT(s.Version,14) = '5.00.8787.1000' THEN 'Preview 1902.2' WHEN RIGHT(s.Version,14) = '5.00.8790.1000' THEN '1902' WHEN RIGHT(s.Version,14) = '5.00.8853.1000' THEN '1906' WHEN RIGHT(s.Version,14) = '5.00.8913.1000' THEN '1910' WHEN RIGHT(s.Version,14) = '5.00.8909.1000' THEN 'Preview 1911' WHEN RIGHT(s.Version,14) = '5.00.8968.1000' THEN '2002' WHEN RIGHT(s.Version,14) = '5.00.9024.1000' THEN '2006' ELSE CAST(s.Version AS VARCHAR(100)) END AS SPLevel, CASE WHEN s.Status = 1 THEN 'Active' ELSE 'Inactive' END AS Status, CASE WHEN s.SiteType = 2 THEN 'Primary Site' WHEN s.SiteType = 1 THEN 'Secondary Site' WHEN s.SiteType = 4 THEN 'Central Administration Site' END AS SiteType, s.InstallDir, s.SiteServer, @SMSProvider AS SMSProvider, sd.SQLServerName, sd.SQLDatabaseName, @SSBPort AS SSBPort, @SQLPort AS SQLPort, @SQLVersion AS SQLVersion, @SQLSP AS SQLSP, @SQLEdition AS SQLEdition, @DP AS DP, @MP as MP, @FSP AS FSP, @RSP AS RSP, @EPP AS EPP, @SUP AS SUP, @AISP AS AISP, @AWS AS AWS, @PWS AS PWS, @SMP AS SMP, @SNS AS SNS, @CPC AS CPC, @DWP AS DWP, @DMP AS DMP, @SCP AS SCP FROM Sites s INNER JOIN SC_SiteDefinition sd ON sd.SiteCode = s.SiteCode WHERE s.SiteCode = @SiteCode </sqlquery> <Fields> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteName" Description="Site Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Version" Description="Version" value="" format="" key="false" groupby="1" /> <Field FieldName="BuildNumber" Description="Build Number" value="" format="" key="false" groupby="1" /> <Field FieldName="SPLevel" Description="Update Pack Level" value="" format="" key="false" groupby="1" /> <Field FieldName="Status" Description="Status" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteType" Description="Site Type" value="" format="" key="false" groupby="1" /> <Field FieldName="InstallDir" Description="Installation Directory" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteServer" Description="Site Server" value="" format="" key="false" groupby="1" /> <Field FieldName="SMSProvider" Description="SMS Provider" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLServerName" Description="SQL Server" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLDatabaseName" Description="Database Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SSBPort" Description="SSB Port" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLPort" Description="SQL Server Port" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLVersion" Description="SQL Version" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLSP" Description="SQL Service Pack Level" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLEdition" Description="SQL Edition" value="" format="" key="false" groupby="1" /> <Field FieldName="DP" Description="Distribution Point" value="" format="" key="false" groupby="1" /> <Field FieldName="MP" Description="Management Point" value="" format="" key="false" groupby="1" /> <Field FieldName="FSP" Description="Fallback Status Point" value="" format="" key="false" groupby="1" /> <Field FieldName="RSP" Description="Reporting Service Point" value="" format="" key="false" groupby="1" /> <Field FieldName="EPP" Description="Endpoint Protection Point" value="" format="" key="false" groupby="1" /> <Field FieldName="SUP" Description="Software Update Point" value="" format="" key="false" groupby="1" /> <Field FieldName="AISP" Description="Asset Intelligence synchronization Point" value="" format="" key="false" groupby="1" /> <Field FieldName="AWS" Description="Application Catalog web service Point" value="" format="" key="false" groupby="1" /> <Field FieldName="PWS" Description="Application Catalog web site Point" value="" format="" key="false" groupby="1" /> <Field FieldName="SMP" Description="State Migration Point" value="" format="" key="false" groupby="1" /> <Field FieldName="SNS" Description="SMS Notification Server" value="" format="" key="false" groupby="1" /> <Field FieldName="CPC" Description="Cloud Proxy Connector" value="" format="" key="false" groupby="1" /> <Field FieldName="DWP" Description="Data Warehouse Service Point" value="" format="" key="false" groupby="1" /> <Field FieldName="DMP" Description="DMP Connector" value="" format="" key="false" groupby="1" /> <Field FieldName="SCP" Description="Service Connection Point" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_MPConnectivity</XMLFile> <Description>Management Point Connectivity</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>MPConnectivity</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="ServerName" Description="Server Name" value="" format="" key="false" groupby="1" /> <Field FieldName="HTTPReturn" Description="HTTP Return Code" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_MPCertConnectivity</XMLFile> <Description>Management Point Certificate Connectivity</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>MPCertConnectivity</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="ServerName" Description="Server Name" value="" format="" key="false" groupby="1" /> <Field FieldName="HTTPReturn" Description="HTTP Return Code" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_SiteMaintenance</XMLFile> <Description>Site Maintenance</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT TaskName, CASE IsEnabled WHEN 1 THEN 'YES' ELSE 'NO' END AS IsEnabled, CASE DeleteOlderThan WHEN 0 THEN NULL ELSE DeleteOlderThan END AS DeleteOlderThan, CASE BeginTime WHEN 0 THEN '0:00' ELSE LEFT(CONVERT(VARCHAR(4), BeginTime),(CASE WHEN (LEN(BeginTime)-2) <=0 THEN 0 ELSE (LEN(BeginTime)-2) END)) + ':' + RIGHT(CONVERT(VARCHAR(4), BeginTime),2) END AS BeginTime, CASE LatestBeginTime WHEN 0 THEN '0:00' ELSE LEFT(CONVERT(VARCHAR(4), LatestBeginTime),(CASE WHEN (LEN(LatestBeginTime)-2) <=0 THEN 0 ELSE (len(LatestBeginTime)-2) END)) + ':' + RIGHT(CONVERT(VARCHAR(4), LatestBeginTime),2) END AS LatestBeginTime, ISNULL((CASE CAST(DaysOfWeek & 1 as bit) WHEN 1 THEN 'Sunday, ' END), '') + ISNULL((CASE CAST(DaysOfWeek & 2 as bit) WHEN 1 THEN 'Monday, ' END), '') + ISNULL((CASE CAST(DaysOfWeek & 4 as bit) WHEN 1 THEN 'Tuesday, ' END), '') + ISNULL((CASE CAST(DaysOfWeek & 8 as bit) WHEN 1 THEN 'Wednesday, ' END), '') + ISNULL((CASE CAST(DaysOfWeek & 16 as bit) WHEN 1 THEN 'Thursday, ' END), '') + ISNULL((CASE CAST(DaysOfWeek & 32 as bit) WHEN 1 THEN 'Friday, ' END), '') + ISNULL((CASE CAST(DaysOfWeek & 64 as bit) WHEN 1 THEN 'Saturday' END), '') AS DaysOfWeek FROM vSMS_SC_SQL_Task WHERE SiteCode = '@@SITECODE@@' </sqlquery> <Fields> <Field FieldName="TaskName" Description="Task Name" value="" format="" key="false" groupby="1" /> <Field FieldName="IsEnabled" Description="Enabled" value="" format="" key="false" groupby="1" /> <Field FieldName="DeleteOlderThan" Description="Delete Older Than (days)" value="" format="" key="false" groupby="1" /> <Field FieldName="BeginTime" Description="Begin Time" value="" format="" key="false" groupby="1" /> <Field FieldName="LatestBeginTime" Description="Latest Begin Time" value="" format="" key="false" groupby="1" /> <Field FieldName="DaysOfWeek" Description="Days Of Week" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_LastSCCMBackup</XMLFile> <Description>Last Backup Summary (Taken from SCCM)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> DECLARE @starttime as DATETIME, @endtime AS DATETIME, @id as INT, @sitecode CHAR(3), @numberofdays INT SET @sitecode = '@@SiteCode@@' SET @numberofdays = @@NumberOfDays@@ SELECT TOP 1 @starttime = smsgs.Time FROM v_StatusMessage smsgs WHERE smsgs.Time >= DATEADD(dd,-CONVERT(INT,@NumberofDays),GETDATE()) AND smsgs.MessageID = 5055 AND smsgs.sitecode = @sitecode ORDER BY smsgs.Time DESC SELECT TOP 1 @endtime = smsgs.Time, @id = smsgs.MessageID FROM v_StatusMessage smsgs WHERE smsgs.Time >= DATEADD(dd,-CONVERT(INT,@NumberofDays),GETDATE()) and smsgs.MessageID IN (5035, 5000, 5002, 5004, 5006, 5008, 5017, 5018, 5019, 5022, 5024, 5025, 5026, 5027, 5032, 5033, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053) AND smsgs.sitecode = @sitecode ORDER BY smsgs.Time DESC IF (@starttime IS NOT NULL) SELECT @starttime AS StartTime, CASE WHEN (@starttime > @endtime) THEN NULL ELSE @endtime END AS EndTime, CASE WHEN (@starttime > @endtime) THEN 'Last Backup did not finish' WHEN (@endtime is NULL) THEN 'Last Backup did not finish' WHEN (@id = 5035) THEN 'SMS Site Backup completed successfully with zero errors but still there could be some warnings' WHEN (@id != 5035) THEN 'SMS Site Backup failed to completed successfully' END AS 'Comments' </sqlquery> <Fields> <Field FieldName="StartTime" Description="Start Time" value="" format="" key="false" groupby="1" /> <Field FieldName="EndTime" Description="End Time" value="" format="" key="false" groupby="1" /> <Field FieldName="Comments" Description="Comments" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_LastSQLBackup</XMLFile> <Description>Last Backup Summary (Taken from SQL Server)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> DECLARE @starttime as DATETIME, @endtime as DATETIME, @id AS INT, @DatabaseName VARCHAR(10), @numberofdays INT SET @DatabaseName = 'CM_@@SITECODE@@' SET @numberofdays = @@NumberOfDays@@ SELECT TOP 1 m.physical_device_name, s.backup_start_date, s.backup_finish_date, CASE s.[type] WHEN 'D' THEN 'Full' WHEN 'I' THEN 'Differential' WHEN 'L' THEN 'Transaction Log' END AS BackupType, s.server_name, s.recovery_model FROM msdb.dbo.backupset s INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id AND m.device_type in (2,5) WHERE s.database_name = @DatabaseName AND s.backup_start_date >= DATEADD(dd,-CONVERT(INT,@numberofdays),GETDATE()) ORDER BY s.backup_finish_date DESC </sqlquery> <Fields> <Field FieldName="physical_device_name" Description="Backup Location" value="" format="" key="false" groupby="1" /> <Field FieldName="backup_start_date" Description="Start Time" value="" format="" key="false" groupby="1" /> <Field FieldName="backup_finish_date" Description="End Time" value="" format="" key="false" groupby="1" /> <Field FieldName="BackupType" Description="Backup Type" value="" format="" key="false" groupby="1" /> <Field FieldName="server_name" Description="Server Name" value="" format="" key="false" groupby="1" /> <Field FieldName="recovery_model" Description="Recovery Model" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_ComponentInformation</XMLFile> <Description>Component information since 12:00AM</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>SQL</querytype> <sqlquery> SELECT ComponentName, Errors, Infos, Warnings, CASE WHEN Status = 0 THEN 'OK' WHEN Status = 1 THEN 'Warning' WHEN Status = 2 THEN 'Critical' END AS Status FROM v_ComponentSummarizer WHERE TallyInterval='0001128000100008' AND SiteCode = '@@SITECODE@@' </sqlquery> <Fields> <Field FieldName="ComponentName" Description="Component Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Errors" Description="Error" value="" format="" key="false" groupby="1" /> <Field FieldName="Warnings" Description="Warning" value="" format="" key="false" groupby="1" /> <Field FieldName="Infos" Description="Information" value="" format="" key="false" groupby="1" /> <Field FieldName="Status" Description="Status" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_LastWSUSSyncInformation</XMLFile> <Description>Last WSUS Sync Information</Description> <IsActive>true</IsActive> <PrintType>simpletable</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>SQL</querytype> <sqlquery> DECLARE @starttime AS DATETIME, @endtime AS DATETIME, @id AS INT, @sitecode CHAR(3) SELECT @sitecode = '@@SITECODE@@' SELECT TOP 1 @starttime = smsgs.Time FROM v_StatusMessage smsgs WHERE smsgs.Time >= DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) AND smsgs.MessageID = 6701 AND smsgs.sitecode = @sitecode ORDER BY smsgs.Time DESC SELECT TOP 1 @endtime = smsgs.Time, @id = smsgs.MessageID FROM v_StatusMessage smsgs WHERE smsgs.Time >= DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) AND smsgs.MessageID IN (6702, 6703) AND smsgs.sitecode = @sitecode ORDER BY smsgs.Time DESC IF (@starttime IS NOT NULL) AND (@endtime IS NOT NULL) SELECT @starttime as StartTime, CASE WHEN (@starttime > @endtime) THEN NULL ELSE @endtime END AS EndTime, CASE WHEN (@starttime > @endtime) THEN 'Last WSYS Sync did not finish' WHEN (@id = 6702) THEN 'Success' WHEN (@id = 6703) THEN 'Error' END AS 'Comments' </sqlquery> <Fields> <Field FieldName="StartTime" Description="Start Date/Time" value="" format="" key="false" groupby="1" /> <Field FieldName="EndTime" Description="End Date/Time" value="" format="" key="false" groupby="1" /> <Field FieldName="Comments" Description="Comments" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_ClientSettingsMisconfiguration</XMLFile> <Description>Client Settings Misconfiguration</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> CREATE TABLE ##temp_ClientSettingsMisconfiguration (ClientSettingName VARCHAR(2000), AgentName VARCHAR(2000), PropertyName VARCHAR(2000), Value VARCHAR(2000), CollectionName VARCHAR(2000)) DELETE ##temp_ClientSettingsMisconfiguration INSERT INTO ##temp_ClientSettingsMisconfiguration SELECT cs.Name as [ClientSettingName], ca.Name as [AgentName], cb.PropertyName, CASE WHEN ISNULL(cb.DwordValue, 0) <> 0 THEN CAST(cb.DwordValue as VARCHAR(2000)) WHEN ISNULL(cb.StringValue, '') <> '' THEN dbo.fn_CM12R2HealthCheck_ScheduleToMinutes(cb.StringValue) END AS [Value], col.Name AS [CollectionName] FROM vSMS_ClientSettings cs INNER JOIN vSMS_ClientAgentConfig_Base cb ON cs.ID = cb.SettingsID INNER JOIN ClientAgent ca ON ca.ID = cb.AgentID LEFT JOIN vClientSettingsAssignments csa ON csa.ClientSettingsID = cs.ID LEFT JOIN v_Collection col ON csa.CollectionID = col.CollectionID WHERE cs.SourceSite = '@@SITECODE@@' AND ((cb.AgentID IN (13, 26) AND cb.PropertyName IN ('PolicyRequestAssignmentTimeout')) or (cb.AgentID in (15, 2) and cb.PropertyName IN ('Schedule')) or (cb.AgentID in (5) AND cb.PropertyName IN ('ComputeComplianceSchedule')) or (cb.AgentID in (17,9) AND cb.PropertyName IN ('EvaluationSchedule')) or (cb.AgentID in (8) AND cb.PropertyName IN ('DataCollectionSchedule')) or (cb.AgentID in (9) AND cb.PropertyName IN ('ScanSchedule'))) INSERT INTO ##temp_ClientSettingsMisconfiguration SELECT 'Default Client Settings', cc.ClientComponentName, ccp.Name, CASE WHEN ccp.Value1 = 'REG_SZ' then dbo.fn_CM12R2HealthCheck_ScheduleToMinutes(ccp.Value2) WHEN ccp.Value1 = 'REG_DWORD' then CAST(ccp.Value3 as VARCHAR(2000)) ELSE dbo.fn_CM12R2HealthCheck_ScheduleToMinutes(ccp.Value1) END AS [Value], 'All Systems' FROM vSMS_SC_ClientComponent cc INNER JOIN vSMS_SC_ClientComponent_Properties ccp on cc.ID = ccp.ID WHERE ccp.Name in ('EvaluationSchedule', 'Inventory Schedule','AMTStatusCheckSchedule','Policy Refresh Interval','Refresh Minutes','Data Collection Schedule','EvaluationSchedule','Scan Schedule','Compute Compliance Schedule') AND cc.SiteCode = '@@SITECODE@@' SELECT * FROM ##temp_ClientSettingsMisconfiguration WHERE (AgentName = 'User Policy Agent' and PropertyName = 'PolicyRequestAssignmentTimeout' and (Value BETWEEN 0 and 29 or Value > 120)) OR (AgentName in ('Application Management Agent', 'AppMan Client Agent') and PropertyName = 'EvaluationSchedule' and Value < 1439) OR (AgentName in ('Software Distribution','Policy Agent') and PropertyName in ('Refresh Minutes','Policy Refresh Interval','PolicyRequestAssignmentTimeout') and (Value BETWEEN 0 and 29 or Value > 120)) OR (AgentName = 'Hardware Inventory Agent' and PropertyName in ('Inventory Schedule', 'Schedule') and (Value BETWEEN 0 and 1439 or Value > 10080)) OR (AgentName in ('Software Inventory Agent', 'Software Inventory Client Agent') and PropertyName in ('Inventory Schedule','Schedule') and (Value BETWEEN 0 and 1439 or Value > 10080)) OR (AgentName = 'Software Metering Agent' and PropertyName in ('Data Collection Schedule', 'DataCollectionSchedule') and (Value BETWEEN 0 and 1439 or Value > 10080)) OR (AgentName = 'Software Updates' and PropertyName in ('EvaluationSchedule', 'Scan Schedule','Software Updates Agent') and (Value BETWEEN 0 and 1439 or Value > 10080)) OR (AgentName = 'System Health Agent' and PropertyName in ('Compute Compliance Schedule', 'ComputeComplianceSchedule') and Value > 1439) ORDER BY ClientSettingName, AgentName, PropertyName DROP TABLE ##temp_ClientSettingsMisconfiguration </sqlquery> <Fields> <Field FieldName="ClientSettingName" Description="Client Settings Name" value="" format="" key="false" groupby="1" /> <Field FieldName="AgentName" Description="Agent Name" value="" format="" key="false" groupby="1" /> <Field FieldName="PropertyName" Description="Property Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Value" Description="Value (Minutes)" value="" format="" key="false" groupby="1" /> <Field FieldName="CollectionName" Description="Deployed to Collection" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_DiscoveryMisconfiguration</XMLFile> <Description>Discovery Misconfiguration</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> CREATE TABLE ##temp_DiscoveryMisconfiguration (componentname VARCHAR(2000), Name VARCHAR(2000), Value VARCHAR(2000)) DELETE ##temp_DiscoveryMisconfiguration INSERT INTO ##temp_DiscoveryMisconfiguration SELECT sdk.componentname, prop.Name, dbo.fn_CM12R2HealthCheck_ScheduleToMinutes(prop.Value1) FROM vSMS_SC_Component_SDK sdk INNER JOIN vSMS_SC_Component_Properties prop ON sdk.ID = prop.ID WHERE sdk.componentname LIKE '%DISCOVERY%' AND prop.name IN ('Full Sync Schedule', 'Startup Schedule') AND prop.Value1 <> '' and sdk.componentname <> 'SMS_WINNT_SERVER_DISCOVERY_AGENT' AND sdk.SiteCode = '@@SITECODE@@' ORDER BY sdk.ComponentName, prop.Name SELECT * FROM ##temp_DiscoveryMisconfiguration WHERE (ComponentName = 'SMS_AD_FOREST_DISCOVERY_MANAGER' AND Name = 'Startup Schedule' AND (Value BETWEEN 0 AND 1439)) OR (ComponentName IN ('SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT','SMS_AD_SYSTEM_DISCOVERY_AGENT','SMS_AD_USER_DISCOVERY_AGENT') AND Name = 'Full Sync Schedule' AND (Value BETWEEN 0 AND 10079)) OR (ComponentName IN ('SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT','SMS_AD_SYSTEM_DISCOVERY_AGENT','SMS_AD_USER_DISCOVERY_AGENT') AND Name = 'Startup Schedule' AND (Value BETWEEN 0 AND 4 OR Value > 30)) DROP TABLE ##temp_DiscoveryMisconfiguration </sqlquery> <Fields> <Field FieldName="componentname" Description="Component Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Name" Description="Property Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Value" Description="Value (Minutes)" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_ClientInformation</XMLFile> <Description>Client Information</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> DECLARE @SiteCode CHAR(3) = '@@SITECODE@@' SELECT (SELECT COUNT(1) from v_R_System) AS TotalDiscovered, (SELECT COUNT(1) from v_R_System_Valid) AS TotalClient, (SELECT COUNT(1) from v_FullCollectionMembership_Valid fcm INNER JOIN v_CH_ClientSummary chs ON chs.ResourceID = fcm.ResourceID AND chs.ClientActiveStatus = 1 WHERE fcm.CollectionID = 'SMS00001' AND fcm.Name NOT LIKE '%unknown%' AND fcm.SiteCode = @SiteCode) AS TotalSiteActive, (SELECT COUNT(1) from v_FullCollectionMembership_Valid fcm INNER JOIN v_CH_ClientSummary chs ON chs.ResourceID = fcm.ResourceID AND chs.ClientActiveStatus = 0 WHERE fcm.CollectionID = 'SMS00001' AND fcm.Name NOT LIKE '%unknown%' AND fcm.SiteCode = @SiteCode) AS TotalSiteInactive </sqlquery> <Fields> <Field FieldName="TotalDiscovered" Description="Total Discovered" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalClient" Description="Total Client" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalSiteActive" Description="Total Active (Site)" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalSiteInactive" Description="Total Inactive (Site)" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_DPContentSummary</XMLFile> <Description>Distribution Point Content Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT SUBSTRING(lc.NALPath, CHARINDEX('\\', lc.NALPath) + 2, CHARINDEX('\', lc.NALPath, CHARINDEX('\\', lc.NALPath) + 2) - CHARINDEX('\\', lc.NALPath) - 2 ) AS DPName, Count(1) AS TotalContent FROM fn_ListDPContents(2057) AS lc INNER JOIN vSMS_SC_SysResUse_SDK srl ON srl.NALPath = lc.NALPath AND srl.RoleName = 'SMS Distribution Point' AND srl.SiteCode = '@@SITECODE@@' AND srl.Type IN (1,2,4,8) GROUP BY SUBSTRING(lc.NALPath, CHARINDEX('\\', lc.NALPath) + 2, CHARINDEX('\', lc.NALPath, CHARINDEX('\\', lc.NALPath) + 2) - CHARINDEX('\\', lc.NALPath) - 2 ) </sqlquery> <Fields> <Field FieldName="DPName" Description="Distribution Point" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalContent" Description="Total Content" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>1</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_SQLMemory</XMLFile> <Description>SQL Server Memory Allocation Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>SQLMemory</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="TotalMemory" Description="Total Physical Memory" value="" format="" key="false" groupby="1" /> <Field FieldName="MaxLimit" Description="Max Allocated to SQL" value="" format="" key="" groupby="1" /> <Field FieldName="Pct" Description="Pct" value="" format="" key="" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>true</IsTextOnly> <Description>Server overview</Description> <IsActive>true</IsActive> <WordStyle>Heading 1</WordStyle> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_OSInformation</XMLFile> <Description>Operating System Information Summary</Description> <IsActive>true</IsActive> <PrintType>simpletable</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>BaseOSInfo</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="ComputerName" Description="Computer Name" value="" format="" key="false" groupby="1" /> <Field FieldName="OperatingSystem" Description="Operating System" value="" format="" key="false" groupby="1" /> <Field FieldName="ServicePack" Description="Service Pack" value="" format="" key="false" groupby="1" /> <Field FieldName="Version" Description="Version" value="" format="" key="false" groupby="1" /> <Field FieldName="Architecture" Description="Architecture" value="" format="" key="false" groupby="1" /> <Field FieldName="LastBootTime" Description="Last Boot" value="" format="" key="false" groupby="1" /> <Field FieldName="CurrentTime" Description="Current Time" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalPhysicalMemory" Description="Total Memory" value="" format="" key="false" groupby="1" /> <Field FieldName="FreePhysicalMemory" Description="Free Memory" value="" format="" key="false" groupby="1" /> <Field FieldName="TimeZone" Description="Time Zone" value="" format="" key="false" groupby="1" /> <Field FieldName="DaylightInEffect" Description="DST In Effect" value="" format="" key="false" groupby="1" /> <Field FieldName="Domain" Description="Domain" value="" format="" key="false" groupby="1" /> <Field FieldName="Role" Description="Role" value="" format="" key="false" groupby="1" /> <Field FieldName="Model" Description="Model" value="" format="" key="false" groupby="1" /> <Field FieldName="NumberOfProcessors" Description="Processors" value="" format="" key="false" groupby="1" /> <Field FieldName="NumberOfLogicalProcessors" Description="Logical Procs" value="" format="" key="false" groupby="1" /> <Field FieldName="Processors" Description="Processors" value="" format="" key="false" groupby="1" /> <Field FieldName="AntiMalware" Description="Anti-Malware" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_DiskInformation</XMLFile> <Description>Disk Information Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>diskinfo</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="DeviceID" Description="Device ID" value="" format="" key="false" groupby="1" /> <Field FieldName="VolumeName" Description="VolumeName" value="" format="" key="false" groupby="1" /> <Field FieldName="FileSystem" Description="File System" value="" format="" key="false" groupby="1" /> <Field FieldName="Size" Description="Size (GB)" value="" format="" key="false" groupby="1" /> <Field FieldName="FreeSpace" Description="Free Space (GB)" value="" format="" key="false" groupby="1" /> <Field FieldName="Used" Description="Used Space (GB)" value="" format="" key="false" groupby="1" /> <Field FieldName="PctUsed" Description="Pct Used" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_NetworkInfo</XMLFile> <Description>Network Information Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>NetworkInfo</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="IPAddress" Description="IP Address" value="" format="" key="false" groupby="1" /> <Field FieldName="DefaultIPGateway" Description="Default Gateway" value="" format="" key="false" groupby="1" /> <Field FieldName="IPSubnet" Description="IP Subnet" value="" format="" key="false" groupby="1" /> <Field FieldName="MACAddress" Description="MAC Address" value="" format="" key="false" groupby="1" /> <Field FieldName="DHCPEnabled" Description="DHCP Enabled" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_CCMRolesInstallationStatus</XMLFile> <Description>Configuration Manager Roles Installation Status</Description> <IsActive>true</IsActive> <PrintType>simpletable</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>RolesInstalled</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="SiteServer" Description="Site Server" value="" format="" key="false" groupby="1" /> <Field FieldName="IIS" Description="IIS Web Server" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLServer" Description="SQL Server" value="" format="" key="false" groupby="1" /> <Field FieldName="DP" Description="Distribution Point" value="" format="" key="false" groupby="1" /> <Field FieldName="PXE" Description="PXE Enabled DP" value="" format="" key="false" groupby="1" /> <Field FieldName="MultiCast" Description="Multicast Enabled DP" value="" format="" key="false" groupby="1" /> <Field FieldName="PreStaged" Description="Pre Staging Allowed" value="" format="" key="false" groupby="1" /> <Field FieldName="MP" Description="Management Point" value="" format="" key="false" groupby="1" /> <Field FieldName="FSP" Description="Fallback Status Point" value="" format="" key="false" groupby="1" /> <Field FieldName="SSRS" Description="SQL Reporting Services" value="" format="" key="false" groupby="1" /> <Field FieldName="EP" Description="Endpoint Protection" value="" format="" key="false" groupby="1" /> <Field FieldName="SUP" Description="Software Update Point" value="" format="" key="false" groupby="1" /> <Field FieldName="AI" Description="Asset Intelligence Synchronization Point" value="" format="" key="false" groupby="1" /> <Field FieldName="AWS" Description="Application Catalog web service point" value="" format="" key="false" groupby="1" /> <Field FieldName="PWS" Description="Application catalog website point" value="" format="" key="false" groupby="1" /> <Field FieldName="SMP" Description="State Migration Point" value="" format="" key="false" groupby="1" /> <Field FieldName="Console" Description="SCCM Admin Console" value="" format="" key="false" groupby="1" /> <Field FieldName="Client" Description="SCCM Client" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_ServiceStatus</XMLFile> <Description>Service Status</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>ServiceStatus</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="DisplayName" Description="Display Name" value="" format="" key="false" groupby="1" /> <Field FieldName="StartName" Description="Account" value="" format="" key="false" groupby="1" /> <Field FieldName="StartMode" Description="Start Mode" value="" format="" key="false" groupby="1" /> <Field FieldName="State" Description="State" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_Applications</XMLFile> <Description>Installed Software</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>InstalledApps</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Version" Description="Version" value="" format="" key="false" groupby="1" /> <Field FieldName="Vendor" Description="Vendor" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_HotfixStatus</XMLFile> <Description>Installed Hotfixes</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>HotfixStatus</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Title" Description="Hotfix Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Date" Description="Installation Date" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_LocalGroups</XMLFile> <Description>Local Groups</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>This is no information to report</EmptyText> <querytype>LocalGroups</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="Group Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Description" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="Members" Description="Members" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>2</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_LocalUsers</XMLFile> <Description>Local Users</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>This is no information to report</EmptyText> <querytype>LocalUsers</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="UserName" value="" format="" key="false" groupby="1" /> <Field FieldName="FullName" Description="Full Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Description" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="AccountType" Description="Account Type" value="" format="" key="false" groupby="1" /> <Field FieldName="AccountExpires" Description="Expires" value="" format="" key="false" groupby="1" /> <Field FieldName="PasswordChangeable" Description="Pwd Changeable" value="" format="" key="false" groupby="1" /> <Field FieldName="PasswordRequired" Description="Pwd Reqd" value="" format="" key="false" groupby="1" /> <Field FieldName="SID" Description="" value="SID" format="" key="false" groupby="1" /> <Field FieldName="LockOut" Description="LockOut" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>true</IsTextOnly> <Description>Database Analysis</Description> <IsActive>true</IsActive> <WordStyle>Heading 1</WordStyle> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_CMMonitor</XMLFile> <Description>CMMonitor Database</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT Name FROM master.sys.databases WHERE name = N'CMMonitor' </sqlquery> <Fields> <Field FieldName="Name" Description="Name" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_DatabaseJobs</XMLFile> <Description>Database Jobs</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT s.name,l.name AS Owner, CASE WHEN s.enabled = 1 THEN 'Enabled' ELSE 'Disabled' END AS Enabled FROM msdb..sysjobs s LEFT JOIN master.sys.syslogins l ON s.owner_sid = l.sid </sqlquery> <Fields> <Field FieldName="Name" Description="Job Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Owner" Description="Owner" value="" format="" key="false" groupby="1" /> <Field FieldName="Enabled" Description="Enabled" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_DatabaseInfo</XMLFile> <Description>Database Info</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> CREATE TABLE ##temp_DatabaseAnalysis (DatabaseName sysname, Name sysname, physical_name NVARCHAR(500), size DECIMAL (18,2), FreeSpace DECIMAL (18,2) ) EXEC sp_msforeachdb ' USE [?]; INSERT INTO ##temp_DatabaseAnalysis (DatabaseName, Name, physical_name, Size, FreeSpace) SELECT DB_NAME() AS [DatabaseName], Name, physical_name, CAST(CAST(ROUND(CAST(size as decimal) * 8.0/1024.0,2) as DECIMAL(18,2)) AS NVARCHAR) Size, CAST(CAST(ROUND(CAST(size as decimal) * 8.0/1024.0,2) as DECIMAL(18,2)) - CAST(FILEPROPERTY(name, ''SpaceUsed'') * 8.0/1024.0 as DECIMAL(18,2)) as NVARCHAR) As FreeSpace FROM sys.database_files ' SELECT db.name, db.recovery_model_desc, CASE WHEN mf.type_desc = 'ROWS' THEN 'Database' ELSE 'Logs' END AS type_desc, mf.physical_name, (mf.size*8)/1024 as Size, CASE WHEN mf.max_size = -1 THEN 'Unlimited' ELSE CAST(mf.max_size as VARCHAR(200)) END AS Max_Size, tmp.FreeSpace, CASE WHEN mf.is_percent_growth = 1 THEN CAST(mf.growth as VARCHAR(200)) + '%' ELSE CAST(mf.growth as VARCHAR(200)) + ' MB' END AS Growth, (SELECT COUNT(1) FROM sys.master_files mf1 WHERE mf1.type_desc = 'ROWS' AND db.database_id = mf1.database_id ) AS CountDataFile, (SELECT COUNT(1) FROM sys.master_files mf1 WHERE mf1.type_desc = 'LOG' AND db.database_id = mf1.database_id ) AS CountLogFile FROM sys.master_files mf INNER JOIN sys.databases db ON db.database_id = mf.database_id INNER JOIN ##temp_DatabaseAnalysis tmp ON mf.physical_name = tmp.physical_name DROP TABLE ##temp_DatabaseAnalysis </sqlquery> <Fields> <Field FieldName="Name" Description="DB Name" value="" format="" key="false" groupby="1" /> <Field FieldName="recovery_model_desc" Description="Recovery Model" value="" format="" key="false" groupby="1" /> <Field FieldName="Type_desc" Description="File Type" value="" format="" key="false" groupby="1" /> <Field FieldName="physical_name" Description="Location" value="" format="" key="false" groupby="1" /> <Field FieldName="size" Description="Size (GB)" value="" format="" key="false" groupby="1" /> <Field FieldName="FreeSpace" Description="Free Space (GB)" value="" format="" key="false" groupby="1" /> <Field FieldName="Max_Size" Description="Max Size" value="" format="" key="false" groupby="1" /> <Field FieldName="Growth" Description="Growth" value="" format="" key="false" groupby="1" /> <Field FieldName="CountDataFile" Description="# Data File" value="" format="" key="false" groupby="1" /> <Field FieldName="CountLogFile" Description="# Log File" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_IndexFragmentation</XMLFile> <Description>Index Fragmentation Higher than 50%</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT object_name(object_id) AS ObjectID, index_type_desc,LEFT(avg_fragmentation_in_percent,5) AS avg_fragmentation_in_percent,fragment_count,LEFT(avg_page_space_used_in_percent,5) AS avg_page_space_used_in_percent,page_count FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL , 'SAMPLED') WHERE ABS(avg_fragmentation_in_percent) > 50 ORDER BY avg_fragmentation_in_percent DESC </sqlquery> <Fields> <Field FieldName="ObjectID" Description="Object Name" value="" format="" key="false" groupby="1" /> <Field FieldName="index_type_desc" Description="Index Type" value="" format="" key="false" groupby="1" /> <Field FieldName="avg_fragmentation_in_percent" Description="Avg Fragmentation (%)" value="" format="" key="false" groupby="1" /> <Field FieldName="fragment_count" Description="Fragmentation Count" value="" format="" key="false" groupby="1" /> <Field FieldName="avg_page_space_used_in_percent" Description="Avg Page Space used (%)" value="" format="" key="false" groupby="1" /> <Field FieldName="page_count" Description="Page Count" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_DatabaseCPUusage</XMLFile> <Description>Database CPU usage</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> WITH DB_CPU_Stats AS (SELECT DatabaseID, DB_Name(DatabaseID) AS [DatabaseName], SUM(total_worker_time) AS [CPU_Time_Ms] FROM sys.dm_exec_query_stats AS qs CROSS APPLY (SELECT CONVERT(int, value) AS [DatabaseID] FROM sys.dm_exec_plan_attributes(qs.plan_handle) WHERE attribute = N'dbid') AS F_DB GROUP BY DatabaseID) SELECT DatabaseName, CAST([CPU_Time_Ms] * 1.0 / SUM([CPU_Time_Ms]) OVER() * 100.0 AS DECIMAL(5, 2)) AS [CPUPercent] FROM DB_CPU_Stats WHERE DatabaseID > 4 AND DatabaseID <> 32767 ORDER BY [CPU_Time_Ms] DESC; </sqlquery> <Fields> <Field FieldName="DatabaseName" Description="Database Name" value="" format="" key="false" groupby="1" /> <Field FieldName="CPUPercent" Description="CPU Usage (%)" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_DatabaseCPUWaits</XMLFile> <Description>Database CPU Waits</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT CAST(100.0 * SUM(signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [cpuwaits],CAST(100.0 * SUM(wait_time_ms - signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [resourcewaits] FROM sys.dm_os_wait_stats OPTION (RECOMPILE); </sqlquery> <Fields> <Field FieldName="CPUWaits" Description="% signal (cpu) waits" value="" format="" key="false" groupby="1" /> <Field FieldName="ResourceWaits" Description="%resource waits" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>3</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@ServerName@@_DatabaseGrowthLast@@NUMBEROFDAYS@@</XMLFile> <Description>Database Growth Last @@NUMBEROFDAYS@@</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT s.database_name, CASE s.[type] WHEN 'D' THEN 'Full' WHEN 'I' THEN 'Differential' WHEN 'L' THEN 'Transaction Log' END AS BackupType, CAST(CAST(s.backup_size / 1000000 AS INT) AS VARCHAR(14)) + ' ' + 'MB' AS bkSize, CAST(DATEDIFF(second, s.backup_start_date, s.backup_finish_date) AS VARCHAR(4)) + ' ' + 'Seconds' TimeTaken, s.backup_start_date FROM msdb.dbo.backupset s INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id WHERE s.backup_start_date >= DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) ORDER BY s.database_name, backup_finish_date DESC, backup_start_date ASC </sqlquery> <Fields> <Field FieldName="Database_Name" Description="DB Name" value="" format="" key="false" groupby="1" /> <Field FieldName="BackupType" Description="Growth Type" value="" format="" key="false" groupby="1" /> <Field FieldName="bkSize" Description="Size" value="" format="" key="false" groupby="1" /> <Field FieldName="TimeTaken" Description="Time Taken" value="" format="" key="false" groupby="1" /> <Field FieldName="backup_start_date" Description="Date/Time" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>4</section> <IsTextOnly>true</IsTextOnly> <Description>SCCM Database Replication Analysis</Description> <IsActive>true</IsActive> <WordStyle>Heading 1</WordStyle> </HealthCheck> <HealthCheck> <section>4</section> <IsTextOnly>false</IsTextOnly> <XMLFile>OverallLinkStatus</XMLFile> <Description>Overall Link Status</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT SiteCode, SUBSTRING(Name, 1, CHARINDEX('.', Name) - 1) AS SiteServerName, dbo.fnGetSiteStatusFriendlyName(SiteStatus) AS SiteStatus, SUBSTRING(SQLInstance, 1, CHARINDEX('.', SQLInstance) - 1) AS SQLServerName, ServerRole FROM ServerData ORDER BY ID </sqlquery> <Fields> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteServerName" Description="Site Server Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteStatus" Description="Replication Status" value="" format="" key="false" groupby="1" /> <Field FieldName="SQLServerName" Description="SQL Server Name" value="" format="" key="false" groupby="1" /> <Field FieldName="ServerRole" Description="Replication Role" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>4</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ReplicationInitializationStatus</XMLFile> <Description>Replication Initialization Status</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> DECLARE @SiteCode CHAR(3) = '@@SITECODE@@' SELECT trk.SiteRequesting ,trk.SiteFulfilling ,trk.ReplicationGroup ,dta.ReplicationPattern ,trk.InitializationStatus AS [InitStatusCode] INTO #InitInfo FROM RCM_DrsInitializationTracking trk INNER JOIN ReplicationData dta ON trk.ReplicationGroup = dta.ReplicationGroup INNER JOIN ( SELECT trk.SiteRequesting ,trk.SiteFulfilling ,trk.ReplicationGroup ,MAX(trk.ModifiedTime) AS [MaxTime] FROM RCM_DrsInitializationTracking trk GROUP BY trk.SiteRequesting ,trk.SiteFulfilling ,trk.ReplicationGroup ) mxt ON trk.SiteRequesting = mxt.SiteRequesting AND trk.SiteFulfilling = mxt.SiteFulfilling AND trk.ReplicationGroup = mxt.ReplicationGroup AND trk.ModifiedTime = mxt.MaxTime -- Site Info SELECT SiteRequesting ,SiteFulfilling ,ReplicationPattern ,COUNT(CASE InitStatusCode WHEN 6 THEN ReplicationGroup END) [ReplGroupsCompleted] ,COUNT(CASE WHEN InitStatusCode NOT IN (6,99) THEN ReplicationGroup END) [ReplGroupsPending] ,COUNT(CASE InitStatusCode WHEN 99 THEN ReplicationGroup END) [ReplGroupsFailed] ,COUNT(CASE InitStatusCode WHEN 6 THEN ReplicationGroup END)/CONVERT(float,COUNT(ReplicationGroup))*100.00 [PercentComplete] FROM #InitInfo WHERE SiteRequesting = @SiteCode AND ReplicationPattern = 'site' GROUP BY SiteRequesting ,SiteFulfilling ,ReplicationPattern UNION ALL -- Global Info SELECT SiteRequesting ,SiteFulfilling ,ReplicationPattern ,COUNT(CASE InitStatusCode WHEN 6 THEN ReplicationGroup END) [ReplGroupsCompleted] ,COUNT(CASE WHEN InitStatusCode NOT IN (6,99) THEN ReplicationGroup END) [ReplGroupsPending] ,COUNT(CASE InitStatusCode WHEN 99 THEN ReplicationGroup END) [ReplGroupsFailed] ,COUNT(CASE InitStatusCode WHEN 6 THEN ReplicationGroup END)/CONVERT(float,COUNT(ReplicationGroup))*100.00 [PercentComplete] FROM #InitInfo WHERE SiteRequesting != @SiteCode AND ReplicationPattern = 'global' GROUP BY SiteRequesting ,SiteFulfilling ,ReplicationPattern UNION ALL -- Global_Proxy Info SELECT SiteRequesting ,SiteFulfilling ,ReplicationPattern ,COUNT(CASE InitStatusCode WHEN 6 THEN ReplicationGroup END) [ReplGroupsCompleted] ,COUNT(CASE WHEN InitStatusCode NOT IN (6,99) THEN ReplicationGroup END) [ReplGroupsPending] ,COUNT(CASE InitStatusCode WHEN 99 THEN ReplicationGroup END) [ReplGroupsFailed] ,COUNT(CASE InitStatusCode WHEN 6 THEN ReplicationGroup END)/CONVERT(float,COUNT(ReplicationGroup))*100.00 [PercentComplete] FROM #InitInfo WHERE SiteRequesting != @SiteCode AND ReplicationPattern = 'global_proxy' GROUP BY SiteRequesting ,SiteFulfilling ,ReplicationPattern DROP TABLE #InitInfo </sqlquery> <Fields> <Field FieldName="SiteRequesting" Description="Site Requesting" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteFulfilling" Description="Site Fulfilling" value="" format="" key="false" groupby="1" /> <Field FieldName="ReplicationPattern" Description="Pattern" value="" format="" key="false" groupby="1" /> <Field FieldName="ReplGroupsCompleted" Description="Completed" value="" format="" key="false" groupby="1" /> <Field FieldName="ReplGroupsPending" Description="Pending" value="" format="" key="false" groupby="1" /> <Field FieldName="ReplGroupsFailed" Description="Failed" value="" format="" key="false" groupby="1" /> <Field FieldName="PercentComplete" Description="% Completed" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>4</section> <IsTextOnly>false</IsTextOnly> <XMLFile>GlobalReplicationStatus</XMLFile> <Description>Global Replication Status</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT lnk.ParentSiteCode,lnk.ChildSiteCode, CASE lnk.OverallLinkStatus WHEN 0 THEN 'Deleted' WHEN 1 THEN 'Tombstoned' WHEN 2 THEN 'Active' WHEN 3 THEN 'Initializing' WHEN 4 THEN 'NotStarted' WHEN 5 THEN 'Error' WHEN 6 THEN 'Unknown' WHEN 7 THEN 'Degraded' WHEN 8 THEN 'Failed' END AS OverallLinkStatus, CASE lnk.GlobalParentToChildLinkStatus WHEN 0 THEN 'Deleted' WHEN 1 THEN 'Tombstoned' WHEN 2 THEN 'Active' WHEN 3 THEN 'Initializing' WHEN 4 THEN 'NotStarted' WHEN 5 THEN 'Error' WHEN 6 THEN 'Unknown' WHEN 7 THEN 'Degraded' WHEN 8 THEN 'Failed' END AS GlobalParentToChildLinkStatus, CASE lnk.GlobalChildToParentLinkStatus WHEN 0 THEN 'Deleted' WHEN 1 THEN 'Tombstoned' WHEN 2 THEN 'Active' WHEN 3 THEN 'Initializing' WHEN 4 THEN 'NotStarted' WHEN 5 THEN 'Error' WHEN 6 THEN 'Unknown' WHEN 7 THEN 'Degraded' WHEN 8 THEN 'Failed' END AS GlobalChildToParentLinkStatus, CASE lnk.SiteChildToParentLinkStatus WHEN 0 THEN 'Deleted' WHEN 1 THEN 'Tombstoned' WHEN 2 THEN 'Active' WHEN 3 THEN 'Initializing' WHEN 4 THEN 'NotStarted' WHEN 5 THEN 'Error' WHEN 6 THEN 'Unknown' WHEN 7 THEN 'Degraded' WHEN 8 THEN 'Failed' WHEN 99 THEN 'Secondary Site' END AS SiteChildToParentLinkStatus,(lnk.LastSendTimeParentToChild - GETUTCDATE() + GETDATE()) AS LastSendTimeParentToChild, (lnk.LastSendTimeChildToParent - GETUTCDATE() + GETDATE()) AS LastSendTimeChildToParent,(lnk.LastSiteSyncTime - GETUTCDATE() + GETDATE()) AS LastSiteSyncTime, CASE srv.ServerRole WHEN 'Peer' THEN 'Primaries' WHEN 'Proxy' THEN 'Secondaries' END AS ServerRole FROM RCM_ReplicationLinkSummary_Child lnk INNER JOIN ServerData srv ON lnk.ChildSiteCode = srv.SiteCode </sqlquery> <Fields> <Field FieldName="ParentSiteCode" Description="Site Code (Parent)" value="" format="" key="false" groupby="1" /> <Field FieldName="ChildSiteCode" Description="Site Code (CHild)" value="" format="" key="false" groupby="1" /> <Field FieldName="OverallLinkStatus" Description="Link Status" value="" format="" key="false" groupby="1" /> <Field FieldName="GlobalParentToChildLinkStatus" Description="Global Link Status (Parent->Child)" value="" format="" key="false" groupby="1" /> <Field FieldName="GlobalChildToParentLinkStatus" Description="Global Link Status (Child->Parent)" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteChildToParentLinkStatus" Description="Site Link Status (Child->Parent)" value="" format="" key="false" groupby="1" /> <Field FieldName="LastSendTimeParentToChild" Description="Last Send Time (Parent->Child)" value="" format="" key="false" groupby="1" /> <Field FieldName="LastSendTimeChildToParent" Description="Last Send Time (Chld->Parent)" value="" format="" key="false" groupby="1" /> <Field FieldName="LastSiteSyncTime" Description="Last Site Sync" value="" format="" key="false" groupby="1" /> <Field FieldName="ServerRole" Description="Replication Role" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>4</section> <IsTextOnly>false</IsTextOnly> <XMLFile>BacklogsCounts</XMLFile> <Description>Backlogs Counts</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> DECLARE @NumOfSeconds int = 15 CREATE TABLE #Temp (SiteName CHAR(3), GlobalQueueCount INT, SiteQueueCount INT, Run INT) DECLARE @Site nVARCHAR(3), @CMDB nVARCHAR(7), @ID tinyint, @SQLInstance NVARCHAR(25), @SQL NVARCHAR(4000) = '' DECLARE Sites CURSOR FAST_FORWARD FOR SELECT SiteCode, SUBSTRING(SQLInstance,1,CHARINDEX('.',SQLInstance,1)-1) Instance, ConfigMgrDatabase, ID FROM ServerData srv /****** UPDATE THIS PORTION FOR THE CAS YOU ARE CREATING THIS ON!!!! ******/ WHERE ServerRole != 'Proxy' OPEN Sites FETCH NEXT FROM Sites INTO @Site, @SQLInstance, @CMDB, @ID WHILE @@FETCH_STATUS = 0 BEGIN SET @SQL = @SQL + ' SELECT '''+@Site+''' AS [Site] ,SUM(CASE que.name WHEN ''ConfigMgrDRSQueue'' THEN dps.row_count END) AS [GlobalQueueCount] ,SUM(CASE que.name WHEN ''ConfigMgrDRSSiteQueue'' THEN dps.row_count END) AS [SiteQueueCount] FROM '+CASE WHEN @ID = 0 THEN @CMDB ELSE '['+@SQLInstance+'].'+@CMDB END+'.sys.dm_db_partition_stats dps INNER JOIN '+CASE WHEN @ID = 0 THEN @CMDB ELSE '['+@SQLInstance+'].'+@CMDB END+'.sys.internal_tables tbl ON dps.object_id = tbl.object_id AND dps.index_id < 2 INNER JOIN '+CASE WHEN @ID = 0 THEN @CMDB ELSE '['+@SQLInstance+'].'+@CMDB END+'.sys.service_queues que ON tbl.parent_object_id = que.object_id AND que.name IN (''ConfigMgrDRSQueue'',''ConfigMgrDRSSiteQueue'')' FETCH NEXT FROM Sites INTO @Site, @SQLInstance, @CMDB, @ID IF @@FETCH_STATUS = 0 SET @SQL = @SQL + CHAR(13) + 'UNION ALL ' + CHAR(13) END CLOSE Sites DEALLOCATE Sites DECLARE @i int = 1 IF @NumOfSeconds < @i BEGIN INSERT #Temp (SiteName, GlobalQueueCount, SiteQueueCount) EXECUTE sp_executesql @SQL UPDATE #Temp SET Run = @i END ELSE BEGIN WHILE @i <= @NumOfSeconds BEGIN IF @i = 1 OR @i = @NumOfSeconds BEGIN INSERT #Temp (SiteName, GlobalQueueCount, SiteQueueCount) EXECUTE sp_executesql @SQL UPDATE #Temp SET Run = @i WHERE Run IS NULL SELECT @i = @i+1 WAITFOR DELAY '00:00:01' END ELSE BEGIN SELECT @i = @i+1 WAITFOR DELAY '00:00:01' END END END SELECT tmp.SiteName ,ISNULL(SUM(CASE WHEN tmp.Run = 1 THEN tmp.GlobalQueueCount END),0) GlobalQueueAtStart ,ISNULL(SUM(CASE WHEN tmp.Run = @NumOfSeconds THEN tmp.GlobalQueueCount END),0) GlobalQueueAtEnd ,ISNULL(SUM(CASE WHEN tmp.Run = 1 THEN tmp.SiteQueueCount END),0) SiteQueueAtStart ,ISNULL(SUM(CASE WHEN tmp.Run = @NumOfSeconds THEN tmp.SiteQueueCount END),0) SiteQueueAtEnd ,ISNULL(SUM(CASE WHEN tmp.Run = 1 THEN tmp.GlobalQueueCount END),0) TotalQueueAtStart ,ISNULL(SUM(CASE WHEN tmp.Run = @NumOfSeconds THEN tmp.GlobalQueueCount END),0) TotalQueueAtEnd FROM #Temp tmp GROUP BY tmp.SiteName DROP TABLE #Temp --Site Replication Status DECLARE @SiteCode VARCHAR(3) = '@@SITECODE@@' SELECT trk.SiteRequesting ,trk.SiteFulfilling ,trk.ReplicationGroup ,dta.ReplicationPattern ,trk.InitializationStatus AS [InitStatusCode] INTO #InitInfo FROM RCM_DrsInitializationTracking trk INNER JOIN ReplicationData dta ON trk.ReplicationGroup = dta.ReplicationGroup INNER JOIN ( SELECT trk.SiteRequesting ,trk.SiteFulfilling ,trk.ReplicationGroup ,MAX(trk.ModifiedTime) AS [MaxTime] FROM RCM_DrsInitializationTracking trk GROUP BY trk.SiteRequesting ,trk.SiteFulfilling ,trk.ReplicationGroup ) mxt ON trk.SiteRequesting = mxt.SiteRequesting AND trk.SiteFulfilling = mxt.SiteFulfilling AND trk.ReplicationGroup = mxt.ReplicationGroup AND trk.ModifiedTime = mxt.MaxTime </sqlquery> <Fields> <Field FieldName="SiteName" Description="Site Code" value="" format="" key="false" groupby="1" /> <Field FieldName="GlobalQueueAtStart" Description="Queue At Start (Global)" value="" format="" key="false" groupby="1" /> <Field FieldName="GlobalQueueAtEnd" Description="Queue At End (Global)" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteQueueAtStart" Description="Queue At Start (Site)" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteQueueAtEnd" Description="Queue At End (Site)" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalQueueAtStart" Description="Total Queue At Start" value="" format="" key="false" groupby="1" /> <Field FieldName="TotalQueueAtEnd" Description="Total Queue At End" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ComponentErrorsMessages</XMLFile> <Description>Component Errors Messages for the last @@NUMBEROFDAYS@@ days</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>SQL</querytype> <sqlquery> SELECT stat.SiteCode, stat.Component, stat.MessageID, stat.MessageID as Value FROM vStatusMessages AS stat WHERE stat.Severity IN (-1073741824, -2147483648) AND stat.Component NOT IN ('Advanced Client', 'Windows Installer SourceList Update Agent', 'Desired Configuration Management', 'Software Updates Scan Agent', 'File Collection Agent', 'Hardware Inventory Agent', 'Software Distribution', 'Software Inventory Agent') AND stat.Time >= DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) </sqlquery> <Fields> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Component" Description="Component" value="" format="" key="false" groupby="2" /> <Field FieldName="MessageID" Description="Message ID" value="" format="" key="false" groupby="2" /> <Field FieldName="Value" Description="Message" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ContentNotDistributed</XMLFile> <Description>Content Not Distributed</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT SourceSite, SoftwareName, CASE ObjectType WHEN 0 THEN 'Package' WHEN 3 THEN 'Driver Package' WHEN 5 THEN 'Software Update Package' WHEN 257 THEN 'Operating System Image' WHEN 258 THEN 'Boot Image' WHEN 259 THEN 'Operating System Installer' WHEN 512 THEN 'Application' ELSE 'Unknown ID ' + CONVERT(VARCHAR(200), ObjectType) END AS ObjectTYpeName FROM fn_ListObjectContentExtraInfo(1033) AS SMS_ObjectContentExtraInfo WHERE Targeted = 0 </sqlquery> <Fields> <Field FieldName="SourceSite" Description="Source Site" value="" format="" key="false" groupby="2" /> <Field FieldName="SoftwareName" Description="Software Name" value="" format="" key="false" groupby="1" /> <Field FieldName="ObjectTypeName" Description="Object Type" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ContentMissing</XMLFile> <Description>Content Missing</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT SourceSite, SoftwareName, Targeted, NumberInstalled, NumberErrors, NumberInProgress, NumberUnknown, CASE ObjectType WHEN 0 THEN 'Package' WHEN 3 THEN 'Driver Package' WHEN 5 THEN 'Software Update Package' WHEN 257 THEN 'Operating System Image' WHEN 258 THEN 'Boot Image' WHEN 259 THEN 'Operating System Installer' WHEN 512 THEN 'Application' ELSE 'Unknown ID ' + CONVERT(VARCHAR(200), ObjectType) END AS ObjectTYpeName FROM fn_ListObjectContentExtraInfo(1033) AS SMS_ObjectContentExtraInfo WHERE Targeted > 0 AND NumberInstalled <> Targeted </sqlquery> <Fields> <Field FieldName="SourceSite" Description="Source Site" value="" format="" key="false" groupby="2" /> <Field FieldName="SoftwareName" Description="Software Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Targeted" Description="Targeted" value="" format="" key="false" groupby="2" /> <Field FieldName="NumberInstalled" Description="Installed" value="" format="" key="false" groupby="2" /> <Field FieldName="NumberErrors" Description="Errors" value="" format="" key="false" groupby="2" /> <Field FieldName="NumberInProgress" Description="In Progress" value="" format="" key="false" groupby="2" /> <Field FieldName="NumberUnknown" Description="Unknown" value="" format="" key="false" groupby="2" /> <Field FieldName="ObjectTypeName" Description="Object Type" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ClientDeploymentFailure</XMLFile> <Description>Client Deployment Failure</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT FQDN AS MachineNameFQDN, NetBiosName AS MachineNameNetBios, ClientVersion AS ClientVersion, AssignedSiteCode AS SiteCode, DeploymentBeginTime AS DeployStartTime, StateDescription AS FailureDescription, LastMessageParam AS DescriptionParam, LastMessageStateID FROM v_ClientDeploymentState WHERE LastMessageStateID < 100 AND LastMessageStateID > 400 </sqlquery> <Fields> <Field FieldName="MachineNameFQDN" Description="Name (FQDN)" value="" format="" key="false" groupby="1" /> <Field FieldName="MachineNameNetBios" Description="Name (Netbios)" value="" format="" key="false" groupby="1" /> <Field FieldName="ClientVersion" Description="Total" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="DeployStartTime" Description="Deployment Start Time" value="" format="" key="false" groupby="1" /> <Field FieldName="FailureDescription" Description="Failure Description" value="" format="" key="false" groupby="1" /> <Field FieldName="DescriptionParam" Description="Description Param" value="" format="" key="false" groupby="1" /> <Field FieldName="LastMessageStateID" Description="LastMessageStateID" value="" format="" key="false" groupby="3" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ClientAssignmentFailure</XMLFile> <Description>Client Assignment Failure</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT FQDN AS MachineNameFQDN, NetBiosName AS MachineNameNetBios, ClientVersion AS ClientVersion, AssignedSiteCode AS SiteCode, AssignmentBeginTime AS AssignmentStartTime, StateDescription AS FailureDescription, LastMessageParam AS DescriptionParam, LastMessageStateID FROM v_ClientDeploymentState WHERE LastMessageStateID > 500 AND LastMessageStateID < 700 </sqlquery> <Fields> <Field FieldName="MachineNameFQDN" Description="Name (FQDN)" value="" format="" key="false" groupby="1" /> <Field FieldName="MachineNameNetBios" Description="Name (Netbios)" value="" format="" key="false" groupby="1" /> <Field FieldName="ClientVersion" Description="Total" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="AssignmentStartTime" Description="Assignment Start Time" value="" format="" key="false" groupby="1" /> <Field FieldName="FailureDescription" Description="Failure Description" value="" format="" key="false" groupby="1" /> <Field FieldName="DescriptionParam" Description="Description Param" value="" format="" key="false" groupby="1" /> <Field FieldName="LastMessageStateID" Description="Message ID" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>InactiveClients</XMLFile> <Description>Inactive Clients</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT fcm.ResourceID, fcm.Name, CASE WHEN fcm.IsObsolete = 1 THEN '*' ELSE '' END AS Obsolete, CASE WHEN fcm.IsBlocked = 1 THEN '*' ELSE '' END AS Blocked, chs.LastActiveTime as LastContactTime, fcm.SiteCode FROM v_FullCollectionMembership fcm INNER JOIN v_CH_ClientSummary chs ON chs.ResourceID = fcm.ResourceID AND chs.ClientActiveStatus = 0 WHERE fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="ResourceID" Description="Resource ID" value="" format="" key="false" groupby="1" /> <Field FieldName="Name" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Obsolete" Description="Obsolete" value="" format="" key="false" groupby="1" /> <Field FieldName="Blocked" Description="Blocked" value="" format="" key="false" groupby="1" /> <Field FieldName="LastContactTime" Description="LastContactTime" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>DiscoveredmachineswithoutSCCMClientinstalled</XMLFile> <Description>Discovered machines without SCCM Client installed</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT fcm.ResourceID, fcm.Name, fcm.SiteCode, fcm.Domain, sys.Operating_System_Name_and0 FROM v_FullCollectionMembership fcm INNER JOIN v_R_System sys ON fcm.ResourceID = sys.ResourceID WHERE fcm.IsClient != 1 AND fcm.Name NOT LIKE '%Unknown%' AND fcm.CollectionID = 'SMS00001' AND sys.Operating_System_Name_and0 IS NOT NULL AND sys.Operating_System_Name_and0 <> '' </sqlquery> <Fields> <Field FieldName="ResourceID" Description="Resource ID" value="" format="" key="false" groupby="1" /> <Field FieldName="Name" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Domain" Description="Domain" value="" format="" key="false" groupby="2" /> <Field FieldName="Operating_System_Name_and0" Description="Operating System" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>Clientsthathavenotreportedinthelast@@NUMBEROFDAYS@@days</XMLFile> <Description>Clients that have not reported in the last @@NUMBEROFDAYS@@ days</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT fcm.Name, sys.Client_Version0, fcm.Domain, sys.User_Name0, fcm.SiteCode, chs.LastActiveTime AS AgentTime, chs.LastHW AS LastHWScan, chs.LastSW AS LastScanDate FROM v_FullCollectionMembership fcm INNER JOIN v_R_System sys ON fcm.ResourceID = sys.ResourceID INNER JOIN v_CH_ClientSummary chs ON chs.ResourceID = fcm.ResourceID AND chs.ClientActiveStatus = 0 WHERE fcm.CollectionID = 'SMS00001' AND chs.LastActiveTime < DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) </sqlquery> <Fields> <Field FieldName="Name" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Client_Version0" Description="Client Version" value="" format="" key="false" groupby="2" /> <Field FieldName="Domain" Description="Domain" value="" format="" key="false" groupby="2" /> <Field FieldName="User_Name0" Description="User Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="AgentTime" Description="Agent Time" value="" format="" key="false" groupby="1" /> <Field FieldName="LastHWScan" Description="Last Hardware Scan" value="" format="" key="false" groupby="1" /> <Field FieldName="LastScanDate" Description="Last Software Scan" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ClientwithduplicatedNames</XMLFile> <Description>Client with duplicated Names</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT g.ResourceID, g.SMSID0, g.Name0 [NewName], h.Name0 [OldName], r.SiteCode, r.Domain, CASE WHEN r.IsObsolete = 1 THEN '*' ELSE '' END AS Obsolete, CASE WHEN r.IsActive = 1 THEN '*' ELSE '' END AS Active FROM v_GS_System AS g INNER JOIN v_FullCollectionMembership r ON g.ResourceID = r.ResourceID INNER JOIN v_HS_System AS h ON g.ResourceId = h.ResourceId WHERE g.Name0 != h.Name0 </sqlquery> <Fields> <Field FieldName="ResourceID" Description="Resource ID" value="" format="" key="false" groupby="1" /> <Field FieldName="SMSID0" Description="SMS ID" value="" format="" key="false" groupby="1" /> <Field FieldName="NewName" Description="New Name" value="" format="" key="false" groupby="1" /> <Field FieldName="OldName" Description="Old Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Obsolete" Description="Obsolete" value="" format="" key="false" groupby="1" /> <Field FieldName="Active " Description="Active" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Domain" Description="Domain" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ClientwithduplicatedSMSID</XMLFile> <Description>Client with duplicated SMS ID</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT g.ResourceID, g.Name0, r.SiteCode, r.Domain, g.SMSID0 [NewID], h.SMSID0 [OldID], CASE WHEN r.IsObsolete = 1 THEN '*' ELSE '' END AS Obsolete, CASE WHEN r.IsActive = 1 THEN '*' ELSE '' END AS Active FROM v_GS_System AS g INNER JOIN v_FullCollectionMembership r ON g.ResourceID = r.ResourceID INNER JOIN v_HS_System AS h ON g.ResourceId = h.ResourceId WHERE g.Name0 = h.Name0 AND g.SMSID0 != h.SMSID0 </sqlquery> <Fields> <Field FieldName="ResourceID" Description="Resource ID" value="" format="" key="false" groupby="1" /> <Field FieldName="SMSID0" Description="SMS ID" value="" format="" key="false" groupby="1" /> <Field FieldName="NewID" Description="New ID" value="" format="" key="false" groupby="1" /> <Field FieldName="OldID" Description="Old ID" value="" format="" key="false" groupby="1" /> <Field FieldName="Obsolete" Description="Obsolete" value="" format="" key="false" groupby="1" /> <Field FieldName="Active " Description="Active" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Domain" Description="Domain" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ClientReportingErrorsinthelast@@NUMBEROFDAYS@@days</XMLFile> <Description>Client Reporting Errors in the last @@NumberOfDays@@ days</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT stat.MachineName, fcm.SiteCode, stat.Component FROM v_StatusMessage stat INNER JOIN v_FullCollectionMembership_Valid fcm ON fcm.Name = stat.MachineName WHERE stat.Time > DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) and stat.Severity=0xC0000000 AND stat.PerClient!=0 AND fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="MachineName" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Component" Description="Component" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SCCMClientversionlowerthanSite</XMLFile> <Description>SCCM Client version lower than Site</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT fcm.Name, sys.Client_Version0, fcm.Domain, sys.User_Name0, fcm.SiteCode FROM v_FullCollectionMembership_Valid fcm INNER JOIN v_R_System_Valid sys ON fcm.ResourceID = sys.ResourceID INNER JOIN v_Site st ON st.SiteCode = fcm.SiteCode WHERE fcm.CollectionID = 'SMS00001' AND sys.Client_Version0 < st.Version </sqlquery> <Fields> <Field FieldName="Name" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Client_Version0" Description="Client Version" value="" format="" key="false" groupby="2" /> <Field FieldName="Domain" Description="Domain" value="" format="" key="false" groupby="2" /> <Field FieldName="User_Name0" Description="User Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>MachineswithoutlatestWindowsUpdateAgentVersion</XMLFile> <Description>Machines Without Latest Windows Update Agent Version (KB949104)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT rsys.Netbios_Name0 AS MachineName, rsys.Client_Version0, uss.LastWUAVersion, fcm.SiteCode FROM v_UpdateScanStatus uss WITH (NOLOCK) JOIN v_ClientCollectionMembers ccm WITH (NOLOCK) ON uss.ResourceID = ccm.ResourceID JOIN v_SoftwareUpdateSource sus WITH (NOLOCK) ON sus.UpdateSource_ID = uss.UpdateSource_ID JOIN v_R_System_Valid rsys WITH (NOLOCK) ON rsys.ResourceID = uss.ResourceID JOIN v_FullCollectionMembership_VaLID fcm WITH (NOLOCK) ON uss.ResourceID = fcm.ResourceID AND fcm.CollectionID = 'SMS00001' INNER JOIN v_GS_OPERATING_SYSTEM ops ON rsys.ResourceID = ops.ResourceID WHERE ops.Version0 < '10.0' AND uss.LastWUAVersion < '7.6.7600.256' UNION SELECT DISTINCT rsys.Netbios_Name0 as MachineName, rsys.Client_Version0, uss.LastWUAVersion, fcm.SiteCode FROM v_UpdateScanStatus uss WITH (NOLOCK) JOIN v_ClientCollectionMembers ccm WITH (NOLOCK) ON uss.ResourceID = ccm.ResourceID JOIN v_SoftwareUpdateSource sus WITH (NOLOCK) ON sus.UpdateSource_ID = uss.UpdateSource_ID JOIN v_R_System_Valid rsys WITH (NOLOCK) ON rsys.ResourceID = uss.ResourceID JOIN v_FullCollectionMembership_VaLID fcm WITH (NOLOCK) ON uss.ResourceID = fcm.ResourceID AND fcm.CollectionID = 'SMS00001' INNER JOIN v_GS_OPERATING_SYSTEM ops ON rsys.ResourceID = ops.ResourceID WHERE ops.Version0 like '6.2.%' AND uss.LastWUAVersion < '7.8.9200.16693' UNION SELECT DISTINCT rsys.Netbios_Name0 as MachineName, rsys.Client_Version0, uss.LastWUAVersion, fcm.SiteCode FROM v_UpdateScanStatus uss WITH (NOLOCK) JOIN v_ClientCollectionMembers ccm WITH (NOLOCK) ON uss.ResourceID = ccm.ResourceID JOIN v_SoftwareUpdateSource sus WITH (NOLOCK) ON sus.UpdateSource_ID = uss.UpdateSource_ID JOIN v_R_System_Valid rsys WITH (NOLOCK) ON rsys.ResourceID = uss.ResourceID JOIN v_FullCollectionMembership_VaLID fcm WITH (NOLOCK) ON uss.ResourceID = fcm.ResourceID AND fcm.CollectionID = 'SMS00001' INNER JOIN v_GS_OPERATING_SYSTEM ops ON rsys.ResourceID = ops.ResourceID WHERE ops.Version0 > '6.2' AND uss.LastWUAVersion < '7.9.9600.16422' </sqlquery> <Fields> <Field FieldName="MachineName" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Client_Version0" Description="Client Version" value="" format="" key="false" groupby="2" /> <Field FieldName="LastWUAVersion" Description="WUA Version" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>Computerswithlowdiskspace</XMLFile> <Description>Computers with low disk space (<= 10%)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT SYS.Name, LDISK.Description0, LDISK.DeviceID0, LDISK.VolumeName0, LDISK.FileSystem0, LDISK.Size0, LDISK.FreeSpace0, sys.SiteCode FROM v_FullCollectionMembership_Valid SYS JOIN v_GS_LOGICAL_DISK LDISK on SYS.ResourceID = LDISK.ResourceID WHERE LDISK.DriveType0 = 3 AND LDISK.FreeSpace0 <= ((LDisk.Size0 * 10)/100) AND sys.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="Name" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Description0" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="DeviceID" Description="Device ID" value="" format="" key="false" groupby="1" /> <Field FieldName="VolumeName0" Description="Volume Name" value="" format="" key="false" groupby="1" /> <Field FieldName="FileSystem0" Description="File System" value="" format="" key="false" groupby="1" /> <Field FieldName="Size0" Description="Size" value="" format="" key="false" groupby="1" /> <Field FieldName="FreeSpace0" Description="FreeSpace" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>Computerswithcriticaldiskspace</XMLFile> <Description>Computers with critical disk space (<= 1GB)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT SYS.Name, LDISK.Description0, LDISK.DeviceID0, LDISK.VolumeName0, LDISK.FileSystem0, LDISK.Size0, LDISK.FreeSpace0, sys.SiteCode FROM v_FullCollectionMembership_Valid SYS JOIN v_GS_LOGICAL_DISK LDISK ON SYS.ResourceID = LDISK.ResourceID WHERE LDISK.DriveType0 = 3 AND LDISK.FreeSpace0 <= 1024 AND sys.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="Name" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Description0" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="DeviceID" Description="Device ID" value="" format="" key="false" groupby="1" /> <Field FieldName="VolumeName0" Description="Volume Name" value="" format="" key="false" groupby="1" /> <Field FieldName="FileSystem0" Description="File System" value="" format="" key="false" groupby="1" /> <Field FieldName="Size0" Description="Size" value="" format="" key="false" groupby="1" /> <Field FieldName="FreeSpace0" Description="FreeSpace" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ComputerswithlowMemory</XMLFile> <Description>Computers with low Memory (<= 1024MB)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT SYS.Netbios_Name0, SYS.Operating_System_Name_and0, sys.Client_Version0, fcm.SiteCode, MEM.TotalPhysicalMemory00/1024 As TotalMemory FROM v_R_System SYS INNER JOIN PC_Memory_DATA MEM on SYS.ResourceID = MEM.MachineID INNER JOIN v_FullCollectionMembership_Valid fcm on fcm.ResourceID = sys.ResourceID WHERE MEM.TotalPhysicalMemory00/1024 <= 1024 and fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="Netbios_Name0" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Operating_System_Name_and0" Description="Operating System" value="" format="" key="false" groupby="2" /> <Field FieldName="Client_Version0" Description="Client Version" value="" format="" key="false" groupby="2" /> <Field FieldName="TotalMemory" Description="TotalMemory (MB)" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ComputerswithslowProcessor</XMLFile> <Description>Computers with slow Processor (<= 1GHz)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT SYS.Name as Netbios_Name0, sys.SiteCode, Processor.Name0, Processor.MaxClockSpeed0, Processor.DeviceID0 FROM v_FullCollectionMembership SYS JOIN v_GS_PROCESSOR Processor ON SYS.ResourceID = Processor.ResourceID WHERE Processor.MaxClockSpeed0 <= 1000 AND sys.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="Netbios_Name0" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Name0" Description="Processor Name" value="" format="" key="false" groupby="1" /> <Field FieldName="MaxClockSpeed0" Description="MaxClockSpeed0" value="" format="" key="false" groupby="1" /> <Field FieldName="DeviceID0" Description="DeviceID0" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>Diskchangeslast@@NumberOfDays@@days</XMLFile> <Description>Disk changes (last @@NumberOfDays@@ days)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT sys.Name, sys.siteCode, tblData.TimeKey, tblData.Description00, tblData.Size00 [NewValue], tblHist.Size00 [OldValue] FROM Logical_Disk_DATA tblData, Logical_Disk_HIST tblHist, v_FullCollectionMembership sys WHERE tblData.Size00 != tblHist.Size00 AND tblData.MachineID = tblHist.MachineID AND tblData.InstanceKey = tblHist.InstanceKey AND tblData.TimeKey >= (DATEADD(day, -@@NUMBEROFDAYS@@, CONVERT(VARCHAR(10), GETDATE(), 101))) AND tblData.MachineId = sys.ResourceID and sys.CollectionID = 'SMS00001' AND tblHist.RevisionID = (SELECT TOP 1 tblHist2.RevisionID FROM Logical_Disk_HIST tblHist2 WHERE tblHist.MachineID = tblHist2.MachineID AND tblHist.InstanceKey = tblHist2.InstanceKey AND tblHist.AgentID = tblHist2.AgentID ORDER BY tblHist2.RevisionID desc) </sqlquery> <Fields> <Field FieldName="Name" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="TimeKey" Description="Date/Time" value="" format="" key="false" groupby="1" /> <Field FieldName="Description00" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="NewValue" Description="NewValue" value="" format="" key="false" groupby="1" /> <Field FieldName="OldValue" Description="OldValue" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>Memorychangeslast@@NumberOfDays@@days</XMLFile> <Description>Memory changes (last @@NumberOfDays@@ days)</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT sys.Name, sys.siteCode, tblData.TimeKey, tblData.TotalPhysicalMemory00 [NewValue], tblHist.TotalPhysicalMemory00 [OldValue] FROM PC_Memory_DATA tblData, PC_Memory_HIST tblHist, v_FullCollectionMembership sys WHERE tblData.TotalPhysicalMemory00 != tblHist.TotalPhysicalMemory00 AND tblData.MachineID = tblHist.MachineID AND tblData.InstanceKey = tblHist.InstanceKey AND tblData.TimeKey >= (DATEADD(day, -@@NUMBEROFDAYS@@, CONVERT(VARCHAR(10), GETDATE(), 101))) AND tblData.MachineId = sys.ResourceID AND sys.CollectionID = 'SMS00001' AND tblHist.RevisionID = (SELECT TOP 1 tblHist2.RevisionID from PC_Memory_HIST tblHist2 WHERE tblHist.MachineID = tblHist2.MachineID AND tblHist.InstanceKey = tblHist2.InstanceKey AND tblHist.AgentID = tblHist2.AgentID ORDER BY tblHist2.RevisionID desc) </sqlquery> <Fields> <Field FieldName="Name" Description="Machine Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="TimeKey" Description="Date/Time" value="" format="" key="false" groupby="1" /> <Field FieldName="NewValue" Description="NewValue" value="" format="" key="false" groupby="1" /> <Field FieldName="OldValue" Description="OldValue" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareUpdateScanErrors</XMLFile> <Description>Software Update Scan Errors</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT rsys.Name0 as MachineName, rsys.Client_Version0 as SMSClientVersion, uss.LastWUAVersion as WUAVersion, rsys.User_Name0 as LastLoggedOnUser, uss.LastStatusMessageID&0x0000FFFF as ErrorStatusID, uss.LastErrorCode as LastErrorCode, LastScanTime, fcm.SiteCode from v_UpdateScanStatus uss with (NOLOCK) join v_ClientCollectionMembers ccm with (NOLOCK) on uss.ResourceID = ccm.ResourceID join v_SoftwareUpdateSource sus with (NOLOCK) on sus.UpdateSource_ID = uss.UpdateSource_ID join v_R_System rsys with (NOLOCK) on rsys.ResourceID = uss.ResourceID join v_FullCollectionMembership_Valid fcm with (NOLOCK) on uss.ResourceID = fcm.ResourceID where uss.LastStatusMessageID <> 0 and fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="MachineName" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SMSClientVersion" Description="Client Version" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="WUAVersion" Description="WUA Version" value="" format="" key="false" groupby="2" /> <Field FieldName="LastLoggedOnUser" Description="Last Logged On User" value="" format="" key="false" groupby="1" /> <Field FieldName="ErrorStatusID" Description="Error Status ID" value="" format="" key="false" groupby="1" /> <Field FieldName="LastErrorCode" Description="Last Error Code" value="" format="" key="false" groupby="2" /> <Field FieldName="LastScanTime" Description="Last Scan Date/Time" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareUpdateScanErrorsMessage</XMLFile> <Description>Software Update Scan Errors Message</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT fcm.ResourceID, uss.LastErrorCode as LastErrorCode, uss.LastErrorCode as Message FROM v_UpdateScanStatus uss WITH (NOLOCK) JOIN v_ClientCollectionMembers ccm WITH (NOLOCK) ON uss.ResourceID = ccm.ResourceID JOIN v_SoftwareUpdateSource sus WITH (NOLOCK) ON sus.UpdateSource_ID = uss.UpdateSource_ID JOIN v_R_System rsys WITH (NOLOCK) ON rsys.ResourceID = uss.ResourceID JOIN v_FullCollectionMembership_Valid fcm WITH (NOLOCK) ON uss.ResourceID = fcm.ResourceID WHERE uss.LastStatusMessageID <> 0 AND fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="LastErrorCode" Description="Error Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Message" Description="Message" value="" format="Message" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareDeploymentSummary</XMLFile> <Description>Software Deployment Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT SoftwareName,AssignmentID,CollectionName,CollectionID,DeploymentTime,CreationTime,ModificationTime, case when (featuretype = 1) then 'Application' when (featuretype = 2) then 'Program' when (featuretype = 3) then 'MobileProgram' when (featuretype = 4) then 'Script' when (featuretype = 5) then 'SoftwareUpdate' when (featuretype = 6) then 'Baseline' when (featuretype = 7) then 'TaskSequence' when (featuretype = 8) then 'ContentDistribution' when (featuretype = 9) then 'DistributionPointGroup' when (featuretype = 10) then 'DistributionPointHealth' when (featuretype = 11) then 'ConfigurationPolicy' when (featuretype = 28) then 'AbstractConfigurationItem' end as FeatureType, SummaryType, case when (DeploymentIntent = 1) then 'Install' when (DeploymentIntent = 2) then 'Uninstall' when (DeploymentIntent = 3) then 'Preflight' end as DeployIntent, EnforcementDeadline,NumberTotal as Total,NumberSuccess as Success, NumberErrors as Failed,NumberInProgress as InProgress, NumberUnknown as Unknown,NumberOther as Other, SummarizationTime,ProgramName,PackageID FROM vDeploymentSummary WHERE FeatureType <> 5 ORDER BY SoftwareName </sqlquery> <Fields> <Field FieldName="SoftwareName" Description="SoftwareName" value="" format="" key="true" groupby="1" /> <Field FieldName="AssignmentID" Description="AssignmentID" value="" format="" key="false" groupby="2" /> <Field FieldName="CollectionName" Description="CollectionName" value="" format="" key="false" groupby="1" /> <Field FieldName="CollectionID" Description="CollectionID" value="" format="" key="false" groupby="2" /> <Field FieldName="DeploymentTime" Description="DeploymentTime" value="" format="" key="false" groupby="3" /> <Field FieldName="FeatureType" Description="FeatureType" value="" format="" key="false" groupby="1" /> <Field FieldName="SummaryType" Description="SummaryType" value="" format="" key="false" groupby="1" /> <Field FieldName="DeployIntent" Description="DeployIntent" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="1" /> <Field FieldName="Success" Description="Success" value="" format="" key="false" groupby="1" /> <Field FieldName="Failed" Description="Failed" value="" format="" key="false" groupby="1" /> <Field FieldName="InProgress" Description="InProgress" value="" format="" key="false" groupby="1" /> <Field FieldName="Unknown" Description="Unknown" value="" format="" key="false" groupby="1" /> <Field FieldName="Other" Description="Other" value="" format="" key="false" groupby="1" /> <Field FieldName="SummarizationTime" Description="SummarizationTime" value="" format="" key="false" groupby="1" /> <Field FieldName="ProgramName" Description="ProgramName" value="" format="" key="false" groupby="1" /> <Field FieldName="PackageID" Description="PackageID" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareUpdateDeploymentErrors</XMLFile> <Description>Software Update Deployment Errors</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT sys.Name0 AS MachineName, sys.Client_Version0 AS SMSClientVersion, sys.User_Name0 AS LastLoggedOnUser, assc.LastEnforcementMessageTime AS LastEnforcementTime, assc.LastEnforcementErrorID&0x0000FFFF AS ErrorStatusID, isnull(assc.LastEnforcementErrorCode,0) AS ErrorCode, fcm.SiteCode FROM v_CIAssignment cia WITH (NOLOCK) JOIN v_UpdateAssignmentStatus_Live assc WITH (NOLOCK) ON assc.AssignmentID = cia.AssignmentID JOIN v_R_System sys WITH (NOLOCK) ON assc.ResourceID=sys.ResourceID and isnull(sys.Obsolete0,0) <> 1 JOIN v_FullCollectionMembership_Valid fcm WITH (NOLOCK) ON assc.ResourceID = fcm.ResourceID WHERE assc.LastEnforcementErrorID&0x0000FFFF <> 0 AND assc.LastEnforcementMessageID IN (6,9) AND assc.IsCompliant=0 AND fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="MachineName" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="SMSClientVersion" Description="Client Version" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="LastLoggedOnUser" Description="Last Logged On User" value="" format="" key="false" groupby="1" /> <Field FieldName="LastEnforcementTimer" Description="Last Enforcement Date/Time" value="" format="" key="false" groupby="1" /> <Field FieldName="ErrorStatusID" Description="Error Status ID" value="" format="" key="false" groupby="1" /> <Field FieldName="ErrorCode" Description="Error Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareUpdateDeploymentErrorsMessage</XMLFile> <Description>Software Update Deployment ErrorsMessage</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT fcm.ResourceID, ISNULL(assc.LastEnforcementErrorCode,0) AS ErrorCode, ISNULL(assc.LastEnforcementErrorCode,0) AS Message FROM v_CIAssignment cia WITH (NOLOCK) JOIN v_UpdateAssignmentStatus_Live assc WITH (NOLOCK) ON assc.AssignmentID = cia.AssignmentID JOIN v_R_System sys WITH (NOLOCK) ON assc.ResourceID=sys.ResourceID AND ISNULL(sys.Obsolete0,0) <> 1 JOIN v_FullCollectionMembership_Valid fcm WITH (NOLOCK) ON assc.ResourceID = fcm.ResourceID WHERE assc.LastEnforcementErrorID&0x0000FFFF <> 0 AND assc.LastEnforcementMessageID in (6,9) AND assc.IsCompliant=0 AND fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="ErrorCode" Description="Error Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Message" Description="Message" value="" format="Message" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ADRErrors</XMLFile> <Description>Automatic Deployment Rules Errors</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT Name, LastRunTime, LastErrorCode, LastErrorTime FROM vSMS_AutoDeployments WHERE LastErrorCode IS NOT NULL </sqlquery> <Fields> <Field FieldName="Name" Description="ADR Name" value="" format="" key="false" groupby="1" /> <Field FieldName="LastRunTime" Description="Last Run Time" value="" format="" key="false" groupby="1" /> <Field FieldName="LastErrorCode" Description="Last Error Code" value="" format="" key="false" groupby="2" /> <Field FieldName="LastErrorTime" Description="Last Error Time" value="" format="" key="false" groupby="1" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ComputerPendingReboot</XMLFile> <Description>Computer pending reboot</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT sys.ResourceID, sys.Netbios_Name0 AS Name0, sys.Resource_Domain_OR_Workgr0, fcm.SiteCode FROM v_R_System_Valid sys INNER JOIN v_GS_OPERATING_SYSTEM os ON os.ResourceID= sys.ResourceID INNER JOIN v_UpdateComplianceStatus cs ON cs.ResourceID = sys. ResourceID LEFT JOIN SR_StateNames srEnf ON srEnf.StateID=cs.LastEnforcementMessageID AND srEnf.TopicType = 402 LEFT JOIN v_UpdateInfo ui ON cs.CI_ID = ui.CI_ID INNER JOIN v_FullCollectionMembership_Valid AS fcm ON sys.Resourceid = fcm.ResourceID AND fcm.CollectionID = 'SMS00001' WHERE cs.LastEnforcementMessageID = 9 AND cs.LastEnforcementMessageTime > os.LastBootUpTime0 UNION SELECT DISTINCT sys.ResourceID, sys.Name0, sys.Resource_Domain_OR_Workgr0, fcm.SiteCode FROM v_R_System AS sys INNER JOIN vStatusMessages AS st ON sys.Name0 = st.MachineName INNER JOIN vSMS_AdvertisementStatusInformation AS sti ON st.MessageID = sti.MessageID INNER JOIN v_FullCollectionMembership_Valid AS fcm ON sys.Resourceid = fcm.ResourceID AND fcm.CollectionID = 'SMS00001' WHERE sti.MessageState = 102 </sqlquery> <Fields> <Field FieldName="ResourceID" Description="Resource ID" value="" format="" key="false" groupby="1" /> <Field FieldName="Name0" Description="Name" value="" format="" key="false" groupby="1" /> <Field FieldName="Resource_Domain_OR_Workgr0" Description="Domain" value="" format="" key="false" groupby="2" /> <Field FieldName="SiteCode" Description="Site Code" value="" format="" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ActiveAlerts</XMLFile> <Description>Active Alerts</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT Name, CAST(Severity AS VARCHAR(300)) AS Severity, CAST(TypeID AS VARCHAR(300)) AS TypeID FROM vSMS_Alert a WHERE (a.TypeID NOT IN (21, 22, 23, 31, 32, 33, 34) AND (a.FeatureArea <> 11 AND a.AlertState = 0)) or (A.TypeID = 31 AND A.AlertState = 0) </sqlquery> <Fields> <Field FieldName="Name" Description="Name" value="" format="AlertsName" key="false" groupby="1" /> <Field FieldName="Severity" Description="Severity" value="" format="AlertsSeverity" key="false" groupby="2" /> <Field FieldName="TypeID" Description="Type" value="" format="AlertsTypeID" key="false" groupby="2" /> <Field FieldName="Total" Description="Total" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_BoundaryGroups</XMLFile> <Description>Boundary Groups</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>boundarygroups</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="Name" value="" format="" key="true" groupby="1" /> <Field FieldName="GroupID" Description="GroupID" value="" format="" key="false" groupby="1" /> <Field FieldName="Description" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="Flags" Description="BG Flags" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteCode" Description="SiteCode" value="" format="" key="false" groupby="1" /> <Field FieldName="CreatedOn" Description="Date Created" value="" format="" key="false" groupby="1" /> <Field FieldName="Boundaries" Description="Boundaries" value="" format="" key="false" groupby="1" /> <Field FieldName="SiteSystems" Description="Site Systems" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SITECODE@@_Boundaries</XMLFile> <Description>Site Boundaries</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>boundaries</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="DisplayName" Description="Name" value="" format="" key="true" groupby="1" /> <Field FieldName="BoundaryID" Description="ID" value="" format="" key="false" groupby="1" /> <Field FieldName="BValue" Description="Value" value="" format="" key="false" groupby="1" /> <Field FieldName="BoundaryType" Description="Type" value="" format="" key="false" groupby="1" /> <Field FieldName="BoundaryFlags" Description="Flags" value="" format="" key="false" groupby="1" /> <Field FieldName="BGName" Description="Boundary Group" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_DiscoveryMethods</XMLFile> <Description>Discovery Methods</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>discoveries</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="ItemType" Description="Type" value="" format="" key="true" groupby="1" /> <Field FieldName="SiteNumber" Description="Site" value="" format="" key="false" groupby="1" /> <Field FieldName="Name" Description="Name" value="" format="" key="false" groupby="2" /> <Field FieldName="Value1" Description="Value1" value="" format="" key="false" groupby="3" /> <Field FieldName="Value2" Description="Value2" value="" format="" key="false" groupby="3" /> <Field FieldName="Value3" Description="Value3" value="" format="" key="false" groupby="3" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_DeviceCollections</XMLFile> <Description>Device Collections Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>DevCollections</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="Collection Name" value="" format="" key="true" groupby="1" /> <Field FieldName="CollectionID" Description="CollID" value="" format="" key="false" groupby="1" /> <Field FieldName="Description" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="MemberCount" Description="Members" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_UserCollections</XMLFile> <Description>User Collections Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>UserCollections</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="Collection Name" value="" format="" key="true" groupby="1" /> <Field FieldName="CollectionID" Description="CollID" value="" format="" key="false" groupby="1" /> <Field FieldName="Description" Description="Description" value="" format="" key="false" groupby="1" /> <Field FieldName="MemberCount" Description="Members" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>5</section> <IsTextOnly>false</IsTextOnly> <XMLFile>@@SiteCode@@_Packages</XMLFile> <Description>Software Packages Summary</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>packages</querytype> <sqlquery></sqlquery> <Fields> <Field FieldName="Name" Description="Name" value="" format="" key="true" groupby="1" /> <Field FieldName="PkgID" Description="PackageID" value="" format="" key="false" groupby="1" /> <Field FieldName="Type" Description="Type" value="" format="" key="false" groupby="1" /> <Field FieldName="Version" Description="Version" value="" format="" key="false" groupby="1" /> <Field FieldName="Description" Description="Description" value="" format="" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>6</section> <IsTextOnly>true</IsTextOnly> <Description>Troubleshooting</Description> <IsActive>true</IsActive> <WordStyle>Heading 1</WordStyle> </HealthCheck> <HealthCheck> <section>6</section> <IsTextOnly>false</IsTextOnly> <XMLFile>ComponentErrorsSolution</XMLFile> <Description>Component Errors Solution for the last @@NUMBEROFDAYS@@ days</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>SQL</querytype> <sqlquery> SELECT DISTINCT stat.Component, stat.MessageID, stat.MessageID AS Value FROM vStatusMessages AS stat where stat.Severity IN (-1073741824, -2147483648) AND stat.Component NOT IN ('Advanced Client', 'Windows Installer SourceList Update Agent', 'Desired Configuration Management', 'Software Updates Scan Agent', 'File Collection Agent', 'Hardware Inventory Agent', 'Software Distribution', 'Software Inventory Agent') AND stat.Time >= DATEADD(dd,-CONVERT(INT,@@NUMBEROFDAYS@@),GETDATE()) </sqlquery> <Fields> <Field FieldName="Component" Description="Component" value="" format="" key="false" groupby="1" /> <Field FieldName="MessageID" Description="Message ID" value="" format="" key="false" groupby="1" /> <Field FieldName="Value" Description="Solution" value="" format="MessageSolution" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>6</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareUpdateScanErrorsSolution</XMLFile> <Description>Software Update Scan Errors Solution</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT uss.LastErrorCode AS LastErrorCode, uss.LastErrorCode AS Message FROM v_UpdateScanStatus uss WITH (NOLOCK) JOIN v_ClientCollectionMembers ccm WITH (NOLOCK) ON uss.ResourceID = ccm.ResourceID JOIN v_SoftwareUpdateSource sus WITH (NOLOCK) ON sus.UpdateSource_ID = uss.UpdateSource_ID JOIN v_R_System rsys WITH (NOLOCK) ON rsys.ResourceID = uss.ResourceID JOIN v_FullCollectionMembership_Valid fcm WITH (NOLOCK) ON uss.ResourceID = fcm.ResourceID WHERE uss.LastStatusMessageID <> 0 AND fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="LastErrorCode" Description="Error Code" value="" format="" key="false" groupby="1" /> <Field FieldName="Message" Description="Solution" value="" format="MessageSolution" key="false" groupby="1" /> </Fields> </HealthCheck> <HealthCheck> <section>6</section> <IsTextOnly>false</IsTextOnly> <XMLFile>SoftwareUpdateDeploymentErrorsSolution</XMLFile> <Description>Software Update Deployment Errors Solution</Description> <IsActive>true</IsActive> <PrintType>table</PrintType> <WordStyle>Heading 2</WordStyle> <EmptyText>There is no information to report</EmptyText> <querytype>sql</querytype> <sqlquery> SELECT DISTINCT assc.LastEnforcementErrorCode as ErrorCode, assc.LastEnforcementMessageID as Message FROM v_CIAssignment cia WITH (NOLOCK) JOIN v_UpdateAssignmentStatus_Live assc WITH (NOLOCK) on assc.AssignmentID = cia.AssignmentID JOIN v_R_System sys WITH (NOLOCK) on assc.ResourceID=sys.ResourceID AND ISNULL(sys.Obsolete0,0) <> 1 JOIN v_FullCollectionMembership_Valid fcm WITH (NOLOCK) on assc.ResourceID = fcm.ResourceID WHERE assc.LastEnforcementErrorID <> 0 AND assc.LastEnforcementMessageID in (6,9) AND assc.IsCompliant=0 AND fcm.CollectionID = 'SMS00001' </sqlquery> <Fields> <Field FieldName="ErrorCode" Description="Error Code" value="" format="" key="false" groupby="1" /> <Field FieldName="Message" Description="Solution" value="" format="MessageSolution" key="false" groupby="1" /> </Fields> </HealthCheck> </dtsHealthCheck> |