Overview
For some SCCM/MECM clients the hardware inventory may fail to report application usage. This will result in missing user-device links for those devices. It's possible to fill these gaps using SCCM/MECM's "Most Recent User" data as this may be present even when hardware inventory fails.
This article describes how to automatically use that data to populate missing user-device links using a REST API connector.
Prerequisits
- The MECM/SCCM connector must be installed and configured
- Make a note of the following:
- The ProjectId from Administration -> Project Settings
- The Most Recent User FieldId (open any device record -> Connectors tab -> MECM -> hover over the Most Recent User text to see the FieldId, 336 in the example below)
- The Last Updated FieldId from the same tab
- The domain name

Setup
Step 1 – Create the connector
- Navigate to
Administration → Extensions → Connectors - Click Add New Connector
- Name it (e.g.
MECM Recent User) - Disable Import #1 (toggle to off)
- Enable Import Links (toggle to on)
- Configure as below (explanation of settings below image)

Step 2 – Configure the Import Links section
| Setting | Value | Description |
|---|---|---|
| Link Action | Create | Creates new links. Do not use 'Reject' or 'Delete. |
| Link Tag | (Blank) | Leave blank as the name of the connector will be used for Link Tags |
| Rest Api Endpoint Url | https://<mstudio-server>/<ProjectId>/p/ report/datamining/0/ prefilename/json | The URL of the datamining report that returns your device + Most Recent User data. Replace `<mstudio-server>` with your server's URL and `<ProjectId>` with your project id. |
| Request Type | Get | Standard HTTP GET. |
| Adv. Options | Toggle on |
Step 3 – Configure the Headers
| Header | Value | Purpose |
|---|---|---|
| auth-token | [importer-auth-token] | Authenticates the connectors request to the API. |
| datamining-tier1-module | devices | Tells the report to return Device data as the top tier. |
| datamining-tier1-fields | deviceId, hostname | Returns the Device ID and Hostname columns — these identify each device. |
| datamining-tier1-customfields | <MostRecentUserFieldId>, <LastUpdatedFieldId> | Returns the MECM connectors **Most Recent User** and **Last Updated** fields. Use the FieldIds you noted in Prerequisites (e.g. 3430, 3420). |
| datasource-filterexpression | CustomField_<MostRecentUserFieldId> <> "" | Only return rows where the Most Recent User field is populated — skips devices with no data. |
Note: The datasource-filterexpression uses the internal custom-field name format. If your Most Recent User FieldId is 3430, the filter expression is CustomField_3430 <> "".
Step 4 – Configure the Link Mapping table
This is the critical part. The Link Mapping table tells ManagementStudio how to map the fields in the JSON response to the fields needed to create a link between a Device and a User. Each row in the table maps one source field from the API response to a ManagementStudio field. The columns are:
| Column | Meaning |
| Src. Field | The field name as it appears in the JSON response (e.g. Devices_DeviceId, CustomField_343) |
| Apps | Maps to an Application field (leave blank for this use case) |
| Users | Maps to a User Migration field (e.g. SamAccount [F] to match by SamAccount name) |
| Devices | Maps to a Device field (e.g. DeviceId [A] to identify the device by its internal Id) |
| Maps to a Mailbox field (leave blank) | |
| Bespoke | Maps to a Bespoke field (leave blank) |
| Special | Special handling options (e.g. Static:, Clone:, LastUsedDate) |
| Options | Additional per-row options |
| Src. Field | Users | Devices | Special | Options | Description |
| Devices_DeviceId | (blank) | DeviceId [A] | (blank) | *(blank)* | Identifies the **Device** side of the link. [A] means "match by internal Application/Device Id". |
| Domain *(or your domain field name)* | Domain [F] | (blank) | (blank) | Static:MYDOMAIN | Supplies the **domain** needed to resolve the user. Static: means the value is fixed for every row — replace MYDOMAIN with your actual domain. [F] means "match by field value". |
| CustomField_<Most RecentUserFieldId> | SamAccount [F] | (blank) | (blank) | (blank) | Maps the **Most Recent User** value (which is a SamAccountName) to the Users side of the link. [F] means "match the user by their SamAccount field". |
| CustomField_<Last UpdatedFieldId> | (blank) | (blank) | (blank) | (blank) | Required for the clone on the next row. |
| LastUsedDate | (blank) | (blank) | LastUsedDate | Clone:CustomField_ <LastUpdatedFieldId> | Sets the **Last Used Date** on the created link so that link age / recency tracking works correctly. |
Important: Replace <MostRecentUserFieldId> and <LastUpdatedFieldId> with the actual FieldId numbers you noted in Prerequisites. For example, if Most Recent User is FieldId 3430 and Last Updated is FieldId 3420, the rows become CustomField_3430 and CustomField_3420.
Step 5 – Test and Save
- Click Test Retrieval - confirm the JSON response returns rows with DeviceId, hostname, and your two custom fields populated. A CSV file will be created. Review this and ensure the data is correct before proceeding.
- Click Test Import - this will test the import file without creating links. The log shows the link count to be created.
- Click Save Changes at the top of the connector screen.
- Click Rest Api Import to run the connector. The links will be created.
Step 6 – Schedule
Set the connector to run on your desired schedule (e.g. daily at 8pm). The Link Action = Create setting means it will only add links that don't already exist — it will not duplicate or overwrite existing user-device links created by other connectors (e.g. the MECM connector's hardware inventory).
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article