Search Knowledge Base by Keyword
Microsoft Endpoint Manager: Configuration Manager
Overview
Microsoft Endpoint Manager: Configuration Manager, previously System Center Configuration Manager and still universally called SCCM or ConfigMgr, is Microsoft’s on-premises management platform for Windows estates. A client agent on each device reports hardware and software inventory, software update compliance, Endpoint Protection and Defender health and deployment results back to a site server. Devices and users are grouped into collections, and packages, applications and task sequences drive software distribution and operating system builds. Everything the site collects is stored in the site database, a Microsoft SQL Server database usually named CM_<sitecode>, and exposed through a large set of reporting views whose names begin with v_.
The ReadyWorks connector reads that site database directly. It offers a single authentication method driven by the mssql.php driver: you supply the SQL Server host name, the port (1433 by default), the site database name, and a database account with read access to the reporting views. There is no WMI call, no SMS Provider and no ConfigMgr console involvement. Each job carries its own SQL statement in its Data Selection field, ReadyWorks executes that statement against the site database, and the result set lands in the staging table named on the job.
SCCM is normally the most complete record an organisation has of its Windows estate, which is why the shipped job set is the largest of any database-backed connector here. Twenty-three templates cover the device master, installed software, users and the three different ways SCCM associates a user with a device, collections and their membership, software update compliance and missing update counts, malware detections and the threat catalogue, antimalware health, client health, packages, and task sequence execution status. In the ReadyWorks estate fabric that supports device refresh and Windows readiness assessment (TPM specification version, memory, disk size, chassis type and CPU all come back on the device master job), application rationalisation, migration wave planning, and finding the devices SCCM has stopped hearing from.
NOTE: Installed software arrives in two parts. SCCM Applications returns one row per device per installed program, identified only by device resource ID and an MD5 match code built from display name, publisher and version. SCCM Programs DISTINCT returns the readable program name, publisher and version against the same match code. Enable both jobs, or the application data is unreadable.
Most templates filter on Obsolete0 = 0 and Decommissioned0 = 0, and several also exclude device names containing a pipe character. That is the standard ConfigMgr pattern for skipping superseded duplicate records and orphaned discovery rows, so counts from these jobs will be lower than a raw count of the discovery table.
The connector is inbound only. It defines no outbound job fields and ships no outbound templates, so ReadyWorks never writes to the site database or triggers anything in ConfigMgr.
Connector Properties
| Property | Value |
|---|---|
| Identifier | SCCM |
| Name | Microsoft Endpoint Manager: Configuration Manager |
| Description | Connector for accessing SCCM adapters. |
| Job Types | Inbound Only |
| Order | 250 |
| Enabled | Yes |
| Locked | Yes |
| Block Update | No |
| Single Authentication | No |
| Windows Only | No |
| Connector Version | 2025-03-12 |
| Hooks | None |
| Additional Job Fields | None |
| Image | ![]() |
Authentication Methods
SCCM offers one authentication method. It is a direct Microsoft SQL Server connection to the Configuration Manager site database using an account supplied on the connection.
| Method | Identifier | Base Method | Script | Order | Enabled | Config Fields |
|---|---|---|---|---|---|---|
| Username / Password | SCCM_user |
SCCM_user |
mssql.php |
10 | Yes | 5 |
Method 1: Username / Password (SCCM_user)
Connect to a MS SQL Server
A standard SQL Server login against the ConfigMgr site database. You give the source server, the port (pre-filled with 1433 and validated as a number below 65536), the site database name (typically CM_<sitecode>), and the username and password of the database account. The mssql.php driver authenticates natively, so there is no stored authentication recipe and no headers or tokens to configure. All five fields are required. Read access to the v_ reporting views is sufficient; every shipped job is a SELECT and nothing in this connector writes to ConfigMgr.
Connection Configuration Fields (5)
| Order | Label | Type | Required | Default | Max Len | Tooltip |
|---|---|---|---|---|---|---|
| 10 | Source Server | text | Yes | 255 | Enter name of the source server | |
| 20 | Source Server Port | text | Yes | 1433 |
5 | Enter port number of the source server |
| 30 | Source DB Name | text | Yes | 255 | Enter name of the source database | |
| 40 | Username | text | Yes | 1024 | Enter username of the database account | |
| 50 | Password | password | Yes | 64000 | Enter password of the database account |
No authentication recipe is stored. The driver script authenticates natively using the fields above.
NOTE: Point the connection at the primary site database, or at the central administration site database if you want a hierarchy-wide view. A secondary site does not hold the full inventory.
NOTE: Several templates read base tables rather than reporting views, including CollectionMembers, System_DISC, User_DISC, SMSPackageTypes and customseverityreference. An account granted access only to the v_ views will fail on those jobs.
Inbound Job Fields Enabled (8)
SCCM inbound jobs expose a deliberately small field set: description, schedule, enabled flag, destination table, data identity, the Data Selection box holding the SQL, the fields to index, and the run order.
| Order | Label | Type | Required | Default | Tooltip |
|---|---|---|---|---|---|
| 10 | Job Description | text | Yes | Enter description of the Job | |
| 20 | Job Schedule | lookup | Yes | Daily | Select frequency Job should run |
| 30 | Enabled | radio | Yes | Yes | Choose if Job is enabled |
| 70 | Destination Table | text | Yes | Enter name of the destination table | |
| 80 | Data Identity | text | No | Enter identity of the Job | |
| 90 | Data Selection | textarea | No | Enter connector specific data selection command of the Job | |
| 130 | Fields to Index | text | No | Enter fields to index | |
| 560 | Order | text | Yes | Enter order of the Job |
NOTE: Data Selection is marked optional on the form, but this is a SQL connector and a job with an empty Data Selection has nothing to execute. Every shipped template supplies one; any job you add yourself must too.
NOTE: Fields to Index matters more here than on most connectors. The SCCM tables are large and the shipped templates set index fields on the columns you will actually join on, such as ItemKey, resourceid, machineid and match_code_xf. Keep those settings when you edit a job.
Inbound Job Templates (23)
Twenty-three inbound jobs ship with the connector, each one a SQL statement against the ConfigMgr site database. Together they reproduce most of what the built-in ConfigMgr reports draw on: device hardware, installed software, user association, collections, update compliance, malware and antimalware health, client health, packages and task sequence status. They are designed to be run as a set, since several of them are only useful joined to another.
| # | Job Description | Destination Table | API End Point | Enabled | What It Pulls |
|---|---|---|---|---|---|
| 1 | SCCM Computer | cm_computer |
Not set |
No | The device master. One row per live system from vSMS_R_System joined out to the hardware inventory views: site code, machine name, operating system name, caption and build, client type and active status, AD site, manufacturer and model (with a Lenovo-specific correction that substitutes the friendly product version for the cryptic machine type), system type, serial number from the system enclosure and from the BIOS, chassis type, CPU name, total physical memory, TPM specification version, BIOS version and release date, system drive size and free space in GB, and the timestamp of the last Heartbeat Discovery from the agent. |
| 2 | SCCM Computer Malware | cm_computermalware |
Not set |
No | Detected threat instances per device from the Endpoint Protection threat inventory. Returns threat ID and device resource ID with the detection date, product version, and the numeric detection source, cleaning action, remediation result, pending action and active-threat state all decoded into readable text. |
| 3 | SCCM Applications | cm_computerprogram |
Not set |
No | Per-device installed software, drawn from both the 32-bit and 64-bit Add/Remove Programs inventory and combined with a UNION. Each row is a device resource ID, an install date where the stored value parses as a date, and an MD5 match code computed over display name, publisher and version. Entries with no publisher, no version or control characters in the name are excluded. |
| 4 | SCCM Computer Update | cm_computerupdate |
Not set |
No | Per-device software update compliance from the update compliance status view, restricted to updates that are enabled and not superseded. Returns machine ID, update configuration item ID, compliance status, and the last status change and last status check times. |
| 5 | SCCM Malware | cm_malware |
Not set |
No | The threat catalogue, independent of any device. One row per known threat with its ID, name, and its severity and category resolved from their lookup tables into readable text, with fallbacks for unknown values. |
| 6 | SCCM Update | cm_update |
Not set |
No | The software update catalogue from v_UpdateInfo. One row per update configuration item with its KB article ID, bulletin ID, title, severity, custom name and Microsoft information URL. |
| 7 | SCCM User | cm_user |
Not set |
No | Every column of the user discovery view for real user accounts, with machine accounts filtered out. Returns the discovered Active Directory attributes SCCM holds per user, including Windows NT domain, user name, full user name, unique user name, object GUID, resource ID and resource type. |
| 8 | SCCM User Computer Primary | cm_usercomputer_primary |
Not set |
No | The primary user assignments, taken from the primary machines view. One row per device and assigned primary user, returning the device resource ID with the domain and user name of the user. This is the user affinity SCCM treats as authoritative for user-targeted deployments. |
| 9 | SCCM User Computer Top Console | cm_usercomputer_topconsole |
Not set |
No | The most frequent interactive console user per device, from system console usage inventory. Returns the device resource ID, the raw top console user string, and the same value split into separate domain and user name columns. |
| 10 | SCCM User Computer Last Logon | cm_usercomputer_lastlogon |
Not set |
No | The last logged-on user recorded on each device’s discovery record, validated by joining to the user discovery table so that only accounts SCCM actually knows are returned. Gives device resource ID with user domain and user name. |
| 11 | SCCM Collection | cm_collection |
Not set |
No | The collection list from v_Collections: the collection ID (held in the legacy SiteID column), the collection name and the collection type that distinguishes device collections from user collections. |
| 12 | SCCM Computer Collection | cm_computercollection |
Not set |
No | Collection membership rows for devices, from the CollectionMembers table: which device resource IDs belong to which collection ID. Joins back to SCCM Collection on the collection ID and to SCCM Computer on the resource ID. |
| 13 | SCCM User Collection | cm_usercollection |
Not set |
No | Collection membership rows for user collections, from the CollectionMembers table filtered to the user architecture key. The MachineID column carries the user resource ID in this context, which joins to SCCM User. |
| 14 | SCCM Deployment Summary | cm_deploymentsummary |
Not set |
No | Every column of the deployment summary view: one row per deployment with its target collection, the application, package, update group or task sequence being deployed, the deployment intent and feature type, and the rolled-up counts of clients in success, in progress, error, unknown and compliant states. |
| 15 | SCCM Package | cm_package |
Not set |
No | The package catalogue from v_Package, with the numeric package type resolved to its name and the source content size converted from KB to MB. Covers classic packages, driver packages, boot images, OS images and the other package types SCCM distributes. |
| 16 | SCCM Scan History | cm_scanhistory |
Not set |
No | As shipped this job runs the package catalogue query, returning v_Package rows with the package type name resolved, into the cm_scanhistory table. It duplicates SCCM Package rather than returning any scan history. See the issues below. |
| 17 | SCCM Scan History Machines | cm_scanhistory_machines |
Not set |
No | A slim device list: resource ID, site code, machine name, operating system name and client type for every non-obsolete, non-decommissioned system. It is the spine the other scan history tables join to, giving them a device name without repeating the full device master query. |
| 18 | SCCM Scan History Missing Update Count | cm_scanhistory_missingupdatecount |
Not set |
No | Per-device counts of outstanding updates, aggregated from the compliance status view. Returns the machine ID with a count of missing critical updates (severity 10) and missing important updates (severity 8), counting only updates that are enabled, not superseded and not already installed on that device. |
| 19 | SCCM Scan History End Point Compliance | cm_scanhistory_epcompliance |
Not set |
No | Per-device Endpoint Protection and Defender health from the antimalware health status inventory. Returns the client version, boolean flags for whether real-time protection, on-access protection, IOAV protection, behaviour monitoring, antivirus, antispyware and network inspection are enabled, the engine and signature versions, and the age in days of the last quick scan, the last full scan and the last signature update. |
| 20 | SCCM Scan History Health Summary | cm_scanhistory_healthsummary |
Not set |
No | The client health summary per device: last online time, last status message, last health evaluation and its result, client active status and client state, and the timestamps of the last discovery data record, last hardware inventory, last software inventory and last policy request. This is the job that tells you which agents have gone quiet. |
| 21 | SCCM Scan History Scan Summary | cm_scanhistory_scansummary |
Not set |
No | The last software update scan time per device from the update scan status view. Two columns, device resource ID and last scan time, used to judge how current the compliance data from the other update jobs is. |
| 22 | SCCM Programs DISTINCT | cm_program |
Not set |
No | The deduplicated software title catalogue across both the 32-bit and 64-bit Add/Remove Programs inventory. Returns program name, publisher and version with tab characters stripped, plus the same MD5 match code used by SCCM Applications, so one row exists per distinct title and version across the estate. |
| 23 | SCCM Task Sequence Status Data | cm_tsstatusdata |
Not set |
No | Task sequence and advertisement execution status per device, from the client advertisement status view joined to advertisement info and the device record. Returns the package name, advertisement ID, target collection name, device name and user name, the last acceptance message, state and time, the last status message and state name, the last execution result, and the most recent step, action name, group name and action output pulled from the task execution status view. |
Job Template Configuration
Settings Common to All Twenty-Three Templates
| Setting | Value |
|---|---|
| Enabled | No |
| Job Schedule | Daily (15 1 * * *) |
| Allow Empty Table | Yes |
| Append Files to Same Destination Table | No |
| Append New Data to Existing Tables | No |
| Use Unparsed Data | No |
| Convert UUID-Keyed Objects to Rows | No |
| Ignore XML Attributes | No |
| Log Raw API Calls | No |
| Method Type | GET |
| Body Data Sending Method | JSON Encoded Data |
Settings That Vary by Template
| Template | ID | Order | Destination Table | Data Identity | Fields to Index |
|---|---|---|---|---|---|
| SCCM Computer | 184 | 10 | cm_computer |
cm_computer |
ItemKey,Name0,Client_Type0 |
| SCCM Computer Malware | 195 | 20 | cm_computermalware |
cm_computermalware |
threatid,itemkey,is_active_malware_xf |
| SCCM Applications | 200 | 30 | cm_computerprogram |
cm_computerprogram |
resourceid,match_code_xf |
| SCCM Computer Update | 201 | 40 | cm_computerupdate |
cm_computerupdate |
machineid |
| SCCM Malware | 202 | 50 | cm_malware |
cm_malware |
threatid |
| SCCM Update | 203 | 60 | cm_update |
cm_update |
ci_id |
| SCCM User | 204 | 70 | cm_user |
cm_user |
Windows_NT_Domain0,Unique_User_Name0,Object_GUID0,ResourceType,ResourceID,user_name0 |
| SCCM User Computer Primary | 205 | 80 | cm_usercomputer_primary |
cm_usercomputer_primary |
User_Name0,ResourceID,User_Domain0 |
| SCCM User Computer Top Console | 206 | 90 | cm_usercomputer_topconsole |
cm_usercomputer_topconsole |
User_Name0,ResourceID,User_Domain0 |
| SCCM User Computer Last Logon | 185 | 100 | cm_usercomputer_lastlogon |
cm_usercomputer_lastlogon |
User_Name0,ResourceID,User_Domain0 |
| SCCM Collection | 186 | 110 | cm_collection |
cm_collection |
CollectionType,CollectionName,SiteID |
| SCCM Computer Collection | 187 | 120 | cm_computercollection |
cm_computercollection |
MachineID,SiteID |
| SCCM User Collection | 188 | 130 | cm_usercollection |
cm_usercollection |
MachineID,SiteID |
| SCCM Deployment Summary | 189 | 140 | cm_deploymentsummary |
cm_deploymentsummary |
CollectionID |
| SCCM Package | 190 | 150 | cm_package |
cm_package |
package_type_name_xf,PackageId |
| SCCM Scan History | 191 | 160 | cm_scanhistory |
cm_scanhistory |
Not set |
| SCCM Scan History Machines | 192 | 170 | cm_scanhistory_machines |
cm_scanhistory_machines |
ItemKey |
| SCCM Scan History Missing Update Count | 193 | 180 | cm_scanhistory_missingupdatecount |
cm_scanhistory_missingupdatecount |
missing_important_update_count_xf,missing_critical_update_count_xf,machineid |
| SCCM Scan History End Point Compliance | 194 | 190 | cm_scanhistory_epcompliance |
cm_scanhistory_epcompliance |
io_protection_enabled_xf,on_access_protection_enabled_xf,real_time_protection_enabled_xf,resourceid,behavior_monitor_enabled_xf,antivirus_enabled_xf,antispyware_enabled_xf,nis_enabled_xf |
| SCCM Scan History Health Summary | 196 | 200 | cm_scanhistory_healthsummary |
cm_scanhistory_healthsummary |
resourceid,lasthealthevaluationresult |
| SCCM Scan History Scan Summary | 197 | 210 | cm_scanhistory_scansummary |
cm_scanhistory_scansummary |
resourceid |
| SCCM Programs DISTINCT | 198 | 220 | cm_program |
cm_program |
program_name_xf,match_code_xf |
| SCCM Task Sequence Status Data | 199 | 230 | cm_tsstatusdata |
cm_tsstatusdata |
Not set |
Job Parameters and Enumeration
SCCM Computer
Data Selection:
SELECT DISTINCT c.ItemKey, client.SiteCode, c.Name0, c.Operating_System_Name_and0, c.Client0, c.Active0, c.Client_Type0, c.Build01, os.Caption0, cs.Manufacturer0, CASE WHEN (cs.Manufacturer0 = 'LENOVO' AND csp.Version0 IS NOT NULL) THEN csp.Version0 ELSE cs.Model0 END AS [model_xf], cs.Model0, se.SerialNumber0, c.Virtual_Machine_Host_Name0, c.Resource_Domain_OR_Workgr0, cs.SystemType0, csum.ClientActiveStatus, mem.TotalPhysicalMemory0, (SELECT TOP 1 ChassisTypes0 FROM dbo.v_GS_SYSTEM_ENCLOSURE AS se WHERE se.ResourceID = c.ItemKey) AS [ChassisTypes0], c.AD_Site_Name0, cpu.[Name0] AS [cpu_Name0], BIOS.SerialNumber0 as BIOSSerialNumber0, BIOS.ReleaseDate0 as BIOSReleaseDate0, BIOS.SMBIOSBIOSVersion0 as BIOSVersion0, (SELECT TOP 1 ROUND(CAST(hd.Size0 AS float) / 1024, 0) FROM dbo.v_GS_DISK hd WHERE hd.ResourceID = c.ItemKey AND hd.DeviceID0 LIKE '%DRIVE0%' AND cs.Model0 NOT LIKE '%Virtual%') AS [disk_size_gb_xf], (SELECT TOP 1 Model0 FROM dbo.v_GS_DISK hd WHERE hd.ResourceID = c.ItemKey AND hd.DeviceID0 LIKE '%DRIVE0%' AND cs.Model0 NOT LIKE '%Virtual%') AS [hard_drive_model_xf], (SELECT TOP 1 ROUND(CAST(ldisk.FreeSpace0 AS float) / 1024, 0) FROM dbo.v_GS_LOGICAL_DISK ldisk WHERE ldisk.ResourceID = c.ItemKey AND ldisk.DeviceID0 LIKE 'C:') AS [disk_size_free_gb_xf], tpm.[SpecVersion0], (SELECT TOP 1 cmagent.[AgentTime] FROM dbo.[v_AgentDiscoveries] AS cmagent WHERE cmagent.[ResourceId] = c.ItemKey AND cmagent.[AgentName] LIKE 'Heartbeat Discovery' ORDER BY AgentTime DESC) AS [sccm_agent_time_xf] FROM dbo.vSMS_R_System c LEFT JOIN dbo.v_ClientMachines AS client ON c.ItemKey = client.resourceid LEFT JOIN dbo.v_GS_COMPUTER_SYSTEM cs ON c.ItemKey = cs.ResourceID LEFT JOIN dbo.v_GS_COMPUTER_SYSTEM_PRODUCT csp ON c.ItemKey = csp.ResourceID LEFT JOIN dbo.v_GS_X86_PC_MEMORY mem ON cs.ResourceID = mem.ResourceID LEFT JOIN dbo.v_GS_SYSTEM_ENCLOSURE AS se ON c.ItemKey = se.ResourceID LEFT JOIN dbo.v_GS_PROCESSOR AS cpu ON c.ItemKey = cpu.ResourceID LEFT JOIN dbo.v_GS_TPM AS tpm ON c.ItemKey = tpm.ResourceID LEFT JOIN dbo.v_GS_PC_BIOS BIOS ON c.ItemKey=bios.ResourceID LEFT JOIN dbo.v_GS_OPERATING_SYSTEM AS os ON c.ItemKey=os.ResourceID LEFT JOIN dbo.v_CH_ClientSummary AS csum ON csum.ResourceID = c.ItemKey WHERE c.Decommissioned0=0 AND c.Obsolete0=0 AND c.Name0 NOT LIKE N'%|%';
SCCM Computer Malware
Data Selection:
SELECT t.threatid, c.itemkey, Dateadd(day, Datediff(day, 0, t.detectiontime), 0) AS [detection_date_xf], N'SystemCenter Endpoint Protection' [observer_product_name_xf], t.productversion, CASE WHEN t.detectionsource = 0 THEN N'Unknown' WHEN t.detectionsource = 1 THEN N'User' WHEN t.detectionsource = 2 THEN N'System' WHEN t.detectionsource = 3 THEN N'Realtime' WHEN t.detectionsource = 4 THEN N'IOAV' WHEN t.detectionsource = 5 THEN N'NIS' WHEN t.detectionsource = 6 THEN N'BHO' END [observer_detection_xf], CASE WHEN t.cleaningaction = 0 THEN N'Unknown' WHEN t.cleaningaction = 1 THEN N'Clean' WHEN t.cleaningaction = 2 THEN N'Quarantine' WHEN t.cleaningaction = 3 THEN N'Remove' WHEN t.cleaningaction = 6 THEN N'Allow' WHEN t.cleaningaction = 8 THEN N'UserDefined' WHEN t.cleaningaction = 9 THEN N'NoAction' WHEN t.cleaningaction = 10 THEN N'Block' END [remediation_type_xf], CASE WHEN t.actionsuccess = 1 THEN N'True' ELSE N'False' END [remediation_result_xf], t.errorcode, CASE WHEN t.pendingactions & 4 <> 0 THEN N'FullScan' WHEN t.pendingactions & 8 <> 0 THEN N'Reboot' WHEN t.pendingactions & 16 <> 0 THEN N'SettingsModified' WHEN t.pendingactions & 32768 <> 0 THEN N'SystemSweeper' ELSE N'NoActionRequired' END [remediation_pending_action_xf], CASE WHEN t.actionsuccess = 0 THEN N'True' ELSE N'False' END [is_active_malware_xf] FROM dbo.v_gs_threats t INNER JOIN dbo.vsms_r_system c ON t.resourceid = c.itemkey INNER JOIN dbo.v_threatcatalog tc ON t.threatid = tc.threatid WHERE c.obsolete0 = 0 AND c.decommissioned0 = 0;
SCCM Applications
Data Selection:
SELECT resourceid,
CONVERT(VARCHAR(32), HASHBYTES('MD5', CONCAT(Replace(p.displayname0, CHAR(9), ' '), Replace(p.publisher0, CHAR(9), ' '), version0)), 2) [match_code_xf],
CASE WHEN ISDATE(InstallDate0) = 1 THEN InstallDate0
ELSE NULL END AS [timestamp_xf]
FROM dbo.v_gs_add_remove_programs p
INNER JOIN dbo.vsms_r_system s ON p.resourceid = s.itemkey
WHERE s.obsolete0 = 0 AND
s.decommissioned0 = 0 AND
p.displayname0 IS NOT NULL AND
p.displayname0<>'' AND
p.Publisher0 IS NOT NULL AND
p.Version0 IS NOT NULL AND
UNICODE(p.displayname0) <> 127 AND
UNICODE(RIGHT(p.version0, 1)) > 31
UNION
SELECT resourceid,
CONVERT(VARCHAR(32), HASHBYTES('MD5', CONCAT(Replace(p.displayname0, CHAR(9), ' '), Replace(p.publisher0, CHAR(9), ' '), version0)), 2) [match_code_xf],
CASE WHEN ISDATE(InstallDate0) = 1 THEN InstallDate0
ELSE NULL END AS [timestamp_xf]
FROM dbo.v_gs_add_remove_programs_64 p INNER JOIN dbo.vsms_r_system s ON p.resourceid = s.itemkey
WHERE s.obsolete0 = 0 AND
s.decommissioned0 = 0 AND
p.displayname0 IS NOT NULL AND
p.displayname0<>'' AND
p.Publisher0 IS NOT NULL AND
p.Version0 IS NOT NULL AND
UNICODE(p.displayname0) <> 127 AND
UNICODE(RIGHT(p.version0, 1)) > 31;
SCCM Computer Update
Data Selection:
SELECT machineid, ucs.ci_id, laststatuschangetime, laststatuschecktime, ucs.status FROM dbo.vsms_update_compliancestatus ucs INNER JOIN dbo.vsms_softwareupdate u ON ucs.ci_id = u.ci_id INNER JOIN dbo.vsms_r_system c ON ucs.machineid = c.itemkey AND u.isenabled = 1 AND u.issuperseded = 0 WHERE c.obsolete0 = 0 AND c.decommissioned0 = 0;
SCCM Malware
Data Selection:
SELECT tc.threatid, Coalesce(tc.NAME, N'UnknownThreat') [malware_name_xf], Coalesce(sev.severity, N'Unknown') [malware_severity_xf], Coalesce(cat.category, N'Invalid') [malware_category_xf] FROM dbo.v_threatcatalog tc LEFT JOIN dbo.v_threatseverities sev ON tc.severityid = sev.severityid LEFT JOIN dbo.v_threatcategories cat ON tc.categoryid = cat.categoryid;
SCCM Update
Data Selection:
SELECT su.ci_id, su.articleid, su.bulletinid, title, severity, customname, infourl FROM dbo.v_updateinfo su LEFT OUTER JOIN dbo.customseverityreference s ON su.severity=s.severityid;
SCCM User
Data Selection:
SELECT * FROM dbo.v_r_user WHERE user_name0 IS NOT NULL AND full_user_name0 NOT LIKE '%$%';
SCCM User Computer Primary
Data Selection:
SELECT c.ResourceID AS [ResourceID] -- ,c.Name0 AS [Computername] ,vru.Windows_NT_Domain0 AS [User_Domain0] ,vru.User_Name0 AS [User_Name0] -- ,CONCAT(vru.Windows_NT_Domain0, '\', vru.User_Name0) AS [User_FullName] FROM dbo.V_R_System c INNER JOIN dbo.v_UsersPrimaryMachines upm on upm.MachineID = c.ResourceID INNER JOIN dbo.v_R_User vru on upm.UserResourceID = vru.ResourceID WHERE ( (c.user_domain0 IS NOT NULL AND c.user_name0 IS NOT NULL) OR (vru.Windows_NT_Domain0 IS NOT NULL AND vru.User_Name0 IS NOT NULL) ) AND c.Decommissioned0=0 AND c.Obsolete0=0 AND c.Name0 NOT LIKE N'%|%';
SCCM User Computer Top Console
Data Selection:
SELECT DISTINCT
ResourceID, TopConsoleUser0,
substring(TopConsoleUser0, 1, CHARINDEX('\',TopConsoleUser0)-1) AS User_Domain0,
substring(TopConsoleUser0, CHARINDEX('\',TopConsoleUser0)+1, LEN(TopConsoleUser0)) AS User_Name0
FROM dbo.v_GS_SYSTEM_CONSOLE_USAGE
WHERE
TopConsoleUser0 IS NOT NULL
order by ResourceID;
SCCM User Computer Last Logon
Data Selection:
SELECT c.[ResourceID] AS [ResourceID] -- ,c.Name0 AS [Computername] ,c.[User_Domain0] AS [User_Domain0] ,c.[User_Name0] AS [User_Name0] -- ,CONCAT(vru.Windows_NT_Domain0, '\', vru.User_Name0) AS [User_FullName] FROM dbo.V_R_System c INNER JOIN dbo.v_R_User vru on c.[User_Domain0] = vru.[Windows_NT_Domain0] AND c.[User_Name0] = vru.[User_Name0] WHERE c.[User_Domain0] IS NOT NULL AND c.[User_Name0] IS NOT NULL AND c.[Decommissioned0] = 0 AND c.[Obsolete0] = 0 AND c.Name0 NOT LIKE N'%|%';
SCCM Collection
Data Selection:
SELECT SiteID, CollectionName, CollectionType FROM dbo.v_Collections;
SCCM Computer Collection
Data Selection:
SELECT cm.SiteID, cm.MachineID FROM dbo.CollectionMembers cm LEFT OUTER JOIN dbo.System_DISC sd ON cm.MachineID=sd.ItemKey AND cm.ArchitectureKey=5 WHERE sd.Obsolete0 IS NULL OR sd.Obsolete0=0;
SCCM User Collection
Data Selection:
SELECT cm.SiteID, cm.MachineID FROM dbo.CollectionMembers cm LEFT OUTER JOIN dbo.User_DISC ud ON cm.MachineID=ud.ItemKey WHERE cm.ArchitectureKey=4;
SCCM Deployment Summary
Data Selection: SELECT * FROM dbo.v_DeploymentSummary;
SCCM Package
Data Selection:
SELECT DISTINCT p.*, 'source_size_mb_xf' = n.SourceSize/1024, t.Name AS package_type_name_xf FROM dbo.v_Package p LEFT JOIN dbo.v_PackageStatusRootSummarizer n ON p.PackageID = n.PackageID LEFT JOIN dbo.SMSPackageTypes t ON p.PackageType = t.PackageTypeID;
SCCM Scan History
Data Selection:
SELECT DISTINCT p.*, t.Name AS t_Name FROM dbo.v_Package p LEFT JOIN dbo.v_PackageStatusRootSummarizer n ON p.PackageID = n.PackageID LEFT JOIN dbo.SMSPackageTypes t ON p.PackageType = t.PackageTypeID;
SCCM Scan History Machines
Data Selection:
SELECT computer.ItemKey, client.SiteCode, computer.Name0, computer.Operating_System_Name_and0, computer.Client_Type0 FROM dbo.vsms_r_system computer LEFT OUTER JOIN dbo.v_clientmachines AS client ON computer.ItemKey=client.ResourceID WHERE computer.Decommissioned0=0 AND computer.Obsolete0=0;
SCCM Scan History Missing Update Count
Data Selection:
SELECT [status].machineid, SUM(CASE u.severity WHEN 10 THEN 1 ELSE 0 END) AS [missing_critical_update_count_xf], SUM(CASE u.severity WHEN 8 THEN 1 ELSE 0 END) AS [missing_important_update_count_xf] FROM dbo.vsms_update_compliancestatus [status] INNER JOIN dbo.vsms_softwareupdate u ON [status].ci_id=u.ci_id WHERE [status].[status]<>3 AND u.isenabled=1 AND u.issuperseded=0 AND u.severity>=8 GROUP BY [status].machineid;
SCCM Scan History End Point Compliance
Data Selection:
SELECT resourceid, CASE WHEN enabled = 1 THEN 1 ELSE 0 END AS [enabled_xf], [version] AS [client_version_xf], CASE WHEN rtpenabled = 1 THEN 1 ELSE 0 END AS [real_time_protection_enabled_xf], CASE WHEN onaccessprotectionenabled = 1 THEN 1 ELSE 0 END AS [on_access_protection_enabled_xf], CASE WHEN ioavprotectionenabled = 1 THEN 1 ELSE 0 END AS [io_protection_enabled_xf], CASE WHEN behaviormonitorenabled = 1 THEN 1 ELSE 0 END AS [behavior_monitor_enabled_xf], CASE WHEN antivirusenabled = 1 THEN 1 ELSE 0 END AS [antivirus_enabled_xf], CASE WHEN antispywareenabled = 1 THEN 1 ELSE 0 END AS [antispyware_enabled_xf], CASE WHEN nisenabled = 1 THEN 1 ELSE 0 END AS [nis_enabled_xf], CASE WHEN lastquickscandatetimestart > Getdate() THEN 0 ELSE Datediff(day, lastquickscandatetimestart, Getdate()) END AS [quick_scan_age_days_xf], CASE WHEN lastfullscandatetimestart > Getdate() THEN 0 ELSE Datediff(day, lastfullscandatetimestart, Getdate()) END AS [full_scan_age_days_xf], CASE WHEN antivirussignatureupdatedatetime > Getdate() THEN 0 ELSE Datediff(day, antivirussignatureupdatedatetime, Getdate()) END AS [signature_age_days_xf], engineversion, antivirussignatureversion FROM dbo.vsms_g_system_antimalwarehealthstatus;
SCCM Scan History Health Summary
Data Selection:
SELECT cs.resourceid, cs.lastonline, cs.laststatusmessage, cs.lasthealthevaluation, cs.lasthealthevaluationresult, cs.clientactivestatus, cs.clientstate, cs.lastddr, cs.lasthw, cs.lastsw, cs.laststatusmessage, cs.lastpolicyrequest FROM dbo.[v_ch_clientsummary] cs;
SCCM Scan History Scan Summary
Data Selection:
SELECT resourceid, lastscantime FROM dbo.v_updatescanstatus;
SCCM Programs DISTINCT
Data Selection:
SELECT DISTINCT
Replace(p.displayname0, CHAR(9), ' ') [program_name_xf],
Replace(p.publisher0, CHAR(9), ' ') [publisher_xf],
version0,
CONVERT(VARCHAR(32), HASHBYTES('MD5', CONCAT(Replace(p.displayname0, CHAR(9), ' '), Replace(p.publisher0, CHAR(9), ' '), version0)), 2) [match_code_xf]
FROM dbo.v_gs_add_remove_programs p
INNER JOIN dbo.vsms_r_system s ON p.resourceid = s.itemkey
WHERE s.obsolete0 = 0 AND
s.decommissioned0 = 0 AND
p.displayname0 IS NOT NULL AND
p.displayname0<>'' AND
p.Publisher0 IS NOT NULL AND
p.Version0 IS NOT NULL AND
UNICODE(p.displayname0) <> 127 AND
UNICODE(RIGHT(p.version0, 1)) > 31
UNION
SELECT DISTINCT
Replace(p.displayname0, CHAR(9), ' ') [program_name_xf],
Replace(p.publisher0, CHAR(9), ' ') [publisher_xf],
version0,
CONVERT(VARCHAR(32), HASHBYTES('MD5', CONCAT(Replace(p.displayname0, CHAR(9), ' '), Replace(p.publisher0, CHAR(9), ' '), version0)), 2) [match_code_xf]
FROM dbo.v_gs_add_remove_programs_64 p INNER JOIN dbo.vsms_r_system s ON p.resourceid = s.itemkey
WHERE s.obsolete0 = 0 AND
s.decommissioned0 = 0 AND
p.displayname0 IS NOT NULL AND
p.displayname0<>'' AND
p.Publisher0 IS NOT NULL AND
p.Version0 IS NOT NULL AND
UNICODE(p.displayname0) <> 127 AND
UNICODE(RIGHT(p.version0, 1)) > 31;
SCCM Task Sequence Status Data
Data Selection:
select PackageName, ai.AdvertisementID, ai.CollectionName, Name0, User_Name0, LastAcceptanceMessageIDName, LastAcceptanceStateName, LastAcceptanceStatusTime, LastStatusMessageIDName, LastStateName, convert(varchar, dateadd(hour, -4, ( select top 1 ExecutionTime from dbo.v_TaskExecutionStatus tes where tes.ResourceID = sys.ResourceID AND tes.step <> '' AND tes.AdvertisementID = cas.AdvertisementID ORDER BY ExecutionTime DESC )), 100) as LastStatusTime, LastExecutionResult, ( select top 1 step from dbo.v_TaskExecutionStatus tes where tes.ResourceID = sys.ResourceID AND tes.step <> '' AND tes.AdvertisementID = cas.AdvertisementID ORDER BY ExecutionTime DESC ) as lastTsStep, ( select top 1 ActionName from dbo.v_TaskExecutionStatus tes where tes.ResourceID = sys.ResourceID AND tes.actionName <> '' AND tes.AdvertisementID = cas.AdvertisementID ORDER BY ExecutionTime DESC ) as lastActionName, ( select top 1 GroupName from dbo.v_TaskExecutionStatus tes where tes.ResourceID = sys.ResourceID AND tes.GroupName <> '' AND tes.AdvertisementID = cas.AdvertisementID ORDER BY ExecutionTime DESC ) as lastGroupName, ( select top 1 ActionOutput from dbo.v_TaskExecutionStatus tes where tes.ResourceID = sys.ResourceID AND tes.ActionOutput <> '' AND tes.AdvertisementID = cas.AdvertisementID ORDER BY ExecutionTime DESC ) as lastActionOutput from dbo.v_ClientAdvertisementStatus cas inner join dbo.v_R_System sys on sys.ResourceID=cas.ResourceID inner join dbo.v_AdvertisementInfo ai on ai.AdvertisementID=cas.AdvertisementID;
NOTE: All twenty-three templates ship with Enabled set to No and a Daily schedule. Enable only the jobs you need and stagger the schedules: several of these queries scan the largest tables in the site database and running them together at 01:15 will be noticeable on a busy site server.
NOTE: SCCM Applications and SCCM Programs DISTINCT are a pair joined on match_code_xf. The same is true of the scan history jobs, which all key on resource ID and are meant to be joined to SCCM Scan History Machines.
Outbound Job Templates (0)
The SCCM connector ships no outbound templates and exposes no outbound job fields. It reads from the ConfigMgr site database and never writes to it.

