> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/m/microsoft-endpoint-configuration-manager-formerly-sccm.md).

# Microsoft Endpoint Configuration Manager (formerly SCCM)

Microsoft Endpoint Configuration Manager (formerly SCCM) keeps its inventory in a SQL Server site database. OctoXLabs reads that database and adds devices, installed software, network adapters, services, TPM data, hotfixes, collections and optional compliance data to the device inventory.

## Use cases

* List devices known to Configuration Manager.

```
Adapters = sccm
```

* Find Configuration Manager devices that have not reported for 30 days.

```
Adapters = sccm AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination                                                | Port                          | Protocol |
| ------------------- | ---------------------------------------------------------- | ----------------------------- | -------- |
| OctoXLabs connector | SQL Server host of the Configuration Manager site database | 1433 (or the configured port) | TCP      |

### Required permissions

| Scope or role | Permission | Needed for                                                                           |
| ------------- | ---------- | ------------------------------------------------------------------------------------ |
| Select, List  | Read       | The site database (`cm_<site code>`), including the views listed under API endpoints |

The database name must begin with `cm_`. The frontend instructions require Select and List privileges for the account.

## Create credentials in Microsoft Endpoint Configuration Manager (formerly SCCM)

{% stepper %}
{% step %}

### Open SQL Server Management Studio

Connect to the SQL Server instance that hosts the Configuration Manager database.
{% endstep %}

{% step %}

### Create a login

Go to the Security folder, right-click Login, and select New Login. Select the authentication method your server uses.
{% endstep %}

{% step %}

### Set the default database

Fill in the details and select the Configuration Manager database as Default Database.
{% endstep %}

{% step %}

### Grant privileges

Give the user Select and List privileges.
{% endstep %}

{% step %}

### Sign in once

Save the user and log in to the database with it once to avoid an error.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                                                                       | Required    | Type    | Default                    | Description                                                                                                                |
| ------------------------------------------------------------------------------- | ----------- | ------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| IP (`ip`)                                                                       | Yes         | String  |                            | IP address or hostname of the SQL Server host.                                                                             |
| Port (`port`)                                                                   | No          | Integer | 1433                       | SQL Server port.                                                                                                           |
| Domain (`domain`)                                                               | No          | String  |                            | Windows domain. When set, the login is sent as `DOMAIN\username`.                                                          |
| Database (`database`)                                                           | Yes         | String  |                            | Name of the database to connect to.                                                                                        |
| Username (`username`)                                                           | Yes         | String  |                            | Account used to connect.                                                                                                   |
| Password (`password`)                                                           | Conditional | String  |                            | Required for SQL authentication and for Kerberos mode `password`. Optional for Kerberos mode `keytab`.                     |
| Use PyODBC Driver (`use_pyodbc_driver`)                                         | No          | Boolean | False                      | Use pyodbc instead of pymssql. The connector tries ODBC Driver 17, then ODBC Driver 18.                                    |
| Batch Size (`batch_size`)                                                       | No          | Integer | 300                        | Rows fetched per batch.                                                                                                    |
| Query Timeout (`query_timeout`)                                                 | No          | Integer | 60                         | Query timeout in seconds.                                                                                                  |
| Auth Type (`auth_type`)                                                         | No          | String  | SQL                        | Set to `Kerberos` to authenticate with Active Directory.                                                                   |
| Kerberos Mode (`kerberos_mode`)                                                 | No          | String  | password                   | `password` requests a ticket with username and password. `keytab` uses an uploaded keytab.                                 |
| Kerberos Realm (`kerberos_realm`)                                               | No          | String  |                            | Active Directory realm in uppercase. Can be empty when the username is in UPN format.                                      |
| KDC IP (`kdc_ip`)                                                               | No          | String  |                            | Key Distribution Center host or IP.                                                                                        |
| Kerberos SPN (`kerberos_spn`)                                                   | No          | String  |                            | Service Principal Name override.                                                                                           |
| Keytab (`keytab`)                                                               | Conditional | String  |                            | Required when Kerberos Mode is `keytab`.                                                                                   |
| Encrypt (`encrypt`)                                                             | No          | Boolean | True                       | TLS encryption. Applied only when Auth Type is Kerberos.                                                                   |
| Trust Server Certificate (`trust_server_certificate`)                           | No          | Boolean | True                       | Skip certificate chain validation. Applied only when Auth Type is Kerberos.                                                |
| Use No Lock (`with_no_lock`)                                                    | No          | Boolean | True                       | Add the `WITH (NOLOCK)` hint to the queries.                                                                               |
| Table Name (`table_name`)                                                       | No          | String  | v\_GS\_INSTALLED\_SOFTWARE | Installed software view to query. The connector probes the column names and adapts.                                        |
| Enrich Chunk Size (`enrich_chunk_size`)                                         | No          | Integer | 100                        | Device IDs per enrichment query (size of the `IN (...)` list). Lower it if enrichment queries time out. Minimum 1.         |
| Fetch Compliance Authlist (`fetch_compliance_authlist`)                         | No          | Boolean | False                      | Fetch compliance per Software Update Group for each device.                                                                |
| Compliance Authlist Title Pattern (`compliance_authlist_title_pattern`)         | No          | String  | %                          | SQL LIKE pattern that selects the Software Update Groups.                                                                  |
| Fetch Compliance Assignment (`fetch_compliance_assignment`)                     | No          | Boolean | False                      | Fetch overall compliance across deployed assignments.                                                                      |
| Compliance Assignment Types (`compliance_assignment_types`)                     | No          | String  | 1,5                        | Comma separated assignment type IDs. 0 DCM Baseline, 1 Software Updates, 2 Application, 5 Software Update Group, 8 Policy. |
| Compliance Assignment Exclude Pattern (`compliance_assignment_exclude_pattern`) | No          | String  |                            | SQL NOT LIKE pattern that excludes assignments by name.                                                                    |
| Verbose Logging (`verbose_logging`)                                             | No          | Boolean | False                      | Detailed per-batch logging. Use it only while debugging.                                                                   |

## Troubleshooting

| Error message                                                                                                     | Cause                                                                                        | Fix                                                                     |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| No ODBC Driver found. Install 'ODBC Driver 17' or 'ODBC Driver 18' for SQL Server.                                | Pyodbc is enabled or Kerberos is used and neither driver is installed on the connector host. | Install ODBC Driver 17 or 18 for SQL Server on the connector host.      |
| Kerberos config failed: SQL Server reports auth\_scheme=''. Check SPN registration in AD and the Encrypt setting. | The connection fell back from Kerberos, for example to NTLM.                                 | Check the SPN registration in Active Directory and the Encrypt setting. |
| Password is required for SQL Server Authentication.                                                               | Auth Type is not Kerberos and Password is empty.                                             | Enter the password.                                                     |
| Keytab is required when kerberos\_mode is 'keytab'.                                                               | Kerberos mode is keytab and no keytab was uploaded.                                          | Upload the keytab file.                                                 |
| Password is required when kerberos\_mode is 'password'.                                                           | Kerberos mode is password and Password is empty.                                             | Enter the password.                                                     |
| Must be comma-separated integers                                                                                  | Compliance Assignment Types has a value that is not an integer list.                         | Enter integers separated by commas, for example `1,5`.                  |

## Change history
