> For the complete documentation index, see [llms.txt](https://help.glpi-project.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.glpi-project.org/doc-plugins/plugins-glpi/sccm.md). Agents can also search and read this documentation through its [MCP server](https://help.glpi-project.org/~gitbook/mcp).

# SCCM

| Download                                       | Sources                               |
| ---------------------------------------------- | ------------------------------------- |
| <https://github.com/pluginsGLPI/sccm/releases> | <https://github.com/pluginsGLPI/sccm> |

## Description

The **SCCM** plugin synchronizes computers managed by Microsoft System Center Configuration Manager (SCCM) to GLPI.

***

## Compatibility

| Plugin version  | GLPI version |
| --------------- | ------------ |
| 2.7.x           | 12.0.x       |
| 2.5.x and 2.6.x | 11.0.x       |

***

## Requirements

### Plugin and GLPI

* A plugin version compatible with your GLPI version (see the table above).
* A Microsoft System Center Configuration Manager (SCCM) server, reachable over MSSQL from the GLPI server.
* GLPI native inventory enabled. The plugin no longer needs the GLPI Inventory plugin: it generates one XML file per computer and sends it to GLPI's native inventory over HTTP(S) using cURL.

### PHP

| GLPI Version | Minimum PHP | Recommended |
| ------------ | ----------- | ----------- |
| 11.0.x       | 8.2         | 8.4         |
| 12.0.X       | 8.3         | 8.5         |

{% hint style="info" %}
This plugin is available without a [GLPI Network](https://services.glpi-network.com/#offers) subscription. It is also available on [GLPI Cloud](https://glpi-network.cloud).
{% endhint %}

Required PHP extensions:

* `curl` (sends inventories to GLPI);
* `sqlsrv` and `pdo_sqlsrv` (connect to the SCCM SQL Server database), with the Microsoft ODBC driver for SQL Server (`msodbcsql18`).

  **Note:** since version 2.5.1, the requirement for the `mssql_connect` function has been removed. The Microsoft `sqlsrv` and `pdo_sqlsrv` extensions are the ones to use.

### Installing the `sqlsrv` and `pdo_sqlsrv` extensions

#### Ubuntu server

```bash
sudo apt update
sudo apt install -y php-dev php-pear build-essential unixodbc-dev gnupg2 curl

curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo ACCEPT_EULA=Y apt install -y msodbcsql18 mssql-tools18

sudo pecl install sqlsrv pdo_sqlsrv

PHPVER=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
echo "extension=sqlsrv.so" | sudo tee /etc/php/$PHPVER/mods-available/sqlsrv.ini
echo "extension=pdo_sqlsrv.so" | sudo tee /etc/php/$PHPVER/mods-available/pdo_sqlsrv.ini
sudo phpenmod -v $PHPVER sqlsrv pdo_sqlsrv

sudo systemctl restart apache2   # or php$PHPVER-fpm
php -m | grep -i sqlsrv
```

#### GLPI on Docker

The official `glpi/glpi` image does not include these extensions. Build your own image based on it. Create a `Dockerfile` next to your `docker-compose.yml`:

<pre class="language-dockerfile"><code class="lang-dockerfile"><a data-footnote-ref href="#user-content-fn-1">FROM glpi/glpi:latest</a>

USER root

ENV ACCEPT_EULA=Y

RUN . /etc/os-release \
    &#x26;&#x26; apt-get update &#x26;&#x26; apt-get install -y --no-install-recommends \
        $PHPIZE_DEPS curl gnupg2 ca-certificates unixodbc-dev \
    &#x26;&#x26; curl -fsSL -o /tmp/ms.deb "https://packages.microsoft.com/config/debian/${VERSION_ID}/packages-microsoft-prod.deb" \
    &#x26;&#x26; dpkg -i /tmp/ms.deb &#x26;&#x26; rm /tmp/ms.deb \
    &#x26;&#x26; apt-get update \
    &#x26;&#x26; apt-get install -y msodbcsql18 \
    &#x26;&#x26; pecl install sqlsrv pdo_sqlsrv \
    &#x26;&#x26; docker-php-ext-enable sqlsrv pdo_sqlsrv \
    &#x26;&#x26; apt-get purge -y $PHPIZE_DEPS \
    &#x26;&#x26; apt-get autoremove -y &#x26;&#x26; apt-get clean \
    &#x26;&#x26; rm -rf /var/lib/apt/lists/* /tmp/pear

USER www-data
</code></pre>

Then, in the `docker-compose.yml`, replace the `image: "glpi/glpi:latest"` line of the `glpi` service with `build: .`:

<pre class="language-yaml"><code class="lang-yaml">services:
  glpi:
    build: .
    restart: "unless-stopped"
    volumes:
      <a data-footnote-ref href="#user-content-fn-2">- ./storage/glpi:/var/glpi</a>
    env_file: .env
    ports:
      - "80:80"
</code></pre>

Build and start:

```bash
docker compose build --pull glpi
docker compose up -d
docker compose exec glpi php -m | grep -i sqlsrv
```

The `pdo_sqlsrv` and `sqlsrv` extensions should appear. To update GLPI, run `docker compose build --pull glpi` again: an image built locally is not updated by `docker compose pull`.

{% hint style="info" %}
ODBC driver 18 enforces TLS encryption. With a SQL server that uses a self-signed certificate, the connection may be refused: install a valid certificate or clear the **Verify SSL certificate** option in the configuration (see below).
{% endhint %}

***

## Plugin installation

1. Download the plugin from the Marketplace.
2. Then **install** and **enable** the SCCM plugin.

<div align="left"><figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2F4razPo0YO0ETJsDZDioV%2Fplugin-sccm.png?alt=media&amp;token=1c294ed9-5f74-43b5-b849-10e831548656" alt=""><figcaption></figcaption></figure></div>

***

## Configuration

* The configuration is done in **`Setup`** > **`SCCM`**.
* Click **+ Add** to create a configuration (the plugin manages one configuration item per SCCM server).

<figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FxdJZnXUYLDgg8IDwGxz5%2Fsccm-configuration.png?alt=media&amp;token=ddc5f7d0-1889-47d2-8f42-7ca45d2e2627" alt=""><figcaption><p>SCCM plugin configuration form</p></figcaption></figure>

### Identification

| Field                      | Description                                     |
| -------------------------- | ----------------------------------------------- |
| **Name**                   | Name of the configuration.                      |
| **Comments**               | Free comments.                                  |
| **Enable synchronization** | Enables synchronization for this configuration. |

### SCCM database connection

| Field                       | Description                                                                       |
| --------------------------- | --------------------------------------------------------------------------------- |
| **Server hostname (MSSQL)** | Name or address of the SQL Server that hosts the SCCM database.                   |
| **Database name**           | Name of the SCCM database.                                                        |
| **Username**                | Account used to connect to the database. A read-only account is enough.           |
| **Password**                | Password of the account. The **Clear** checkbox erases the saved password.        |
| **Collection name**         | Name of the SCCM collection to synchronize. Leave empty to collect all computers. |

### Sending data to the GLPI inventory

| Field                                       | Description                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Inventory server base URL**               | Base URL of GLPI to which the XML files are sent, **without** `/front/inventory.php`: the plugin appends this path itself (the red text under the field shows the full URL that will be called). Leave empty to use the GLPI URL (`url_base`). This URL must be reachable **from the GLPI server itself** (example: `http://localhost`). |
| **Verify SSL certificate**                  | Enables certificate verification, both for the connection to SQL Server and for the HTTPS push to GLPI. Check this option only if the SQL server has a valid certificate (clear it for a self-signed certificate).                                                                                                                       |
| **Use NTLM authentication**                 | Uses NTLM authentication when sending data to the inventory.                                                                                                                                                                                                                                                                             |
| **Send credentials to other hosts too**     | Allows credentials to be sent to other hosts (cURL "unrestricted auth" option). Enable only if necessary.                                                                                                                                                                                                                                |
| **Use specific authentication information** | Sends credentials when pushing data to the inventory. Check it as soon as the GLPI inventory requires authentication (see below).                                                                                                                                                                                                        |
| **Value for specific authentication**       | Credentials in the `login:password` format, passed as is to cURL. They must match those defined in the GLPI inventory configuration. The **Clear** checkbox erases the saved value.                                                                                                                                                      |

### Inventory date

| Field                                          | Description                                                         |
| ---------------------------------------------- | ------------------------------------------------------------------- |
| **Use LastHWScan as GLPI last inventory date** | Uses the SCCM `LastHWScan` date as the last inventory date in GLPI. |

Once the fields are filled in, click **Add**. On an existing configuration, the **Test connection** button checks the connection to SQL Server (it does not test the push to the inventory).

***

## Enabling the GLPI native inventory

Before the first synchronization, go to **`Setup`** > **`Inventory`**:

* check **Enable inventory**. Otherwise, GLPI answers `403 Forbidden` to every push;
* **Authorization header**

  * **GLPI 11**: default value `None`;
  * **GLPI 12**: no default value, the field is mandatory and pushes are rejected until a method is chosen; the choices are `OAuth - Client credentials`, `Basic Authentication`, `None (not recommended)`.

  The plugin **does not support OAuth**: choose **Basic Authentication** (recommended) and enter the same login and password in the plugin, or `None` (not recommended).

***

## How it works

<figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FiEhmX0TrnpPmMI62phgb%2Fsccm-workflow-en.png?alt=media&amp;token=cec3c486-82ea-4a88-ae22-3b59fc3a0547" alt=""><figcaption></figcaption></figure>

1. The plugin queries the SCCM server with MSSQL requests.
2. It generates one XML file per computer, in the GLPI inventory format.
3. It sends these files to GLPI's native inventory over HTTP(S) using cURL.

These steps are run by two **automatic actions** of the plugin, available in `Setup` > `Automatic actions`:

| Action          | Role                                                     | Default schedule                        |
| --------------- | -------------------------------------------------------- | --------------------------------------- |
| **SCCMCollect** | Queries SQL Server and writes one XML file per computer. | Every 7 days, between 4 a.m. and 5 a.m. |
| **SCCMPush**    | Sends the XML files to the GLPI inventory.               | Every 7 days, between 6 a.m. and 7 a.m. |

These actions run in **CLI** mode: they are not triggered by web activity, but by the GLPI scheduler launched from the command line (`php front/cron.php`, through cron or, with the official Docker image, its built-in worker). To test, open the action and click **Execute**, running SCCMCollect first and then SCCMPush. The logs are in [`files/_log/sccm.log`](#user-content-fn-3)[^3] (`Push OK` / `Push KO` lines).

{% hint style="info" %}
`SCCMPush` runs the SQL query for computers again and only sends those that are still present in SCCM (or in the collection).
{% endhint %}

### Required network flows

All exchanges are initiated by the **GLPI server**. SCCM does not open any connection to GLPI, and GLPI does not need to reach the computers.

| # | Source      | Destination              | Protocol and port                                                        | Role                                                                                                                                               |
| - | ----------- | ------------------------ | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1 | GLPI server | SCCM SQL Server          | TCP **1433** by default (other port: `host,port` in **Server hostname**) | Read-only SQL queries on the SCCM database. SQL account authentication, TLS encryption (ODBC 18). Both SCCMCollect **and** SCCMPush connect to it. |
| 2 | GLPI server | GLPI server (itself)     | HTTP **80** or HTTPS **443**, to `<base URL>/front/inventory.php`        | Sending the XML files (`POST`, `Content-Type: text/xml`). Redirects are **not** followed.                                                          |
| 3 | GLPI server | GLPI server (local disk) | File system                                                              | The XML files are written then read back in `files/_plugins/sccm/xml/<configuration id>/`.                                                         |
| 4 | GLPI server | GLPI database            | TCP 3306 (MySQL/MariaDB)                                                 | Import of the computers into GLPI (usual GLPI flow).                                                                                               |

Points to note:

* **Flow 1**: if the SQL server uses a named instance, the dynamic port is announced by the SQL Server Browser service (UDP 1434). Prefer a fixed port. The SQL account only needs read rights (`SELECT`) on the SCCM database.
* **Flow 2**: the plugin calls GLPI **from the GLPI server**. The base URL must therefore be reachable from the inside, which is not always the case for the public URL (reverse proxy, port published by Docker). In a container, use for example `http://localhost`. Since redirects are not followed, do not enter an HTTP URL that redirects to HTTPS: use the final HTTPS URL directly.
* **Flow 3**: SCCMCollect and SCCMPush must see the same `files` folder (same server, or shared volume). With Docker, this folder is in the volume mounted on `/var/glpi`.
* **No other flow**: the plugin uses neither the SCCM console API, nor SMB, nor WMI, nor Internet access.

***

## Collected data

Depending on the data available on the SCCM server, the plugin collects the following for each computer:

* **Computer:** name, last logged-in user, UUID, user name, domain, serial number
* **Operating system:** name, architecture, version, service pack
* **BIOS:** tag, model, type, manufacturer, serial number, installation date, version
* **Processor (CPU):** description or name, manufacturer, frequency, architecture, number of cores and threads
* **Software:** name, version, publisher, installation date
* **Memory (RAM):** capacity, description, frequency, type
* **Graphics card:** name, chipset, memory
* **Sound card:** name, manufacturer
* **Network card:** name, MAC address, IP addresses (v4 and v6)
* **Volumes (disk partitions):** name, mount point, total size, free space and file system
* **Drives (CD/DVD):** name, model, manufacturer, type

***

## Troubleshooting

* **`could not find driver`** **or extension not found:** check with `php -m | grep -i sqlsrv` that `sqlsrv` and `pdo_sqlsrv` are loaded in the PHP used by GLPI (and not only on the command line).
* **SSL certificate error on connection:** with a self-signed certificate, clear **Verify SSL certificate**, or install a valid certificate.
* **Password not saved:** fixed in plugin version 2.5.1. Update the plugin.
* **"Verify SSL certificate" option has no effect:** fixed in version 2.5.1.
* **401 / 403 codes:** a push is counted as `Push OK` only on an HTTP 200 response; otherwise the log shows `Push KO - <id> -> STATUS: <code>` followed by the response body.
* **On an SQL error:**
  * SQL query error: `Collect ERROR: Query error: Array (...)`, with the SQL Server details (`inc/sccmdb.class.php:80`).
  * Connection failure: `Cannot connect to SCCM database`, preceded by `SQLSTATE` / `Code` / `Message` lines (`FormatErrors`, `inc/sccmdb.class.php:86`).
* **If GLPI cannot be reached** (DNS, TLS, connection refused, etc.): the log shows `cURL error: <message>` instead of `Push KO` (`inc/sccm.class.php:629`).

[^1]: FROM glpi/glpi:11.0\
    For GLPI 11

[^2]: Adjust according to your configuration

[^3]: For a standard installation; may differ from your specific setup. In a Docker environment, it can be found at `/var/glpi/logs/sccm.log`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.glpi-project.org/doc-plugins/plugins-glpi/sccm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
