Set up authentication credentials and a scheduled job to import Microsoft Intune data into your CMDB.
Antes de Iniciar
Importante: The guided setup method is deprecated from version 2.7.0 of the Service Graph Connector for Microsoft Intune. Use the SGC Central view in the Service Graph Workspace or CMDB Workspace to configure the connection for the connector.
To use this Service Graph Connector, you need a subscription to a Subscription Unit that is based in the IT Operations Management (ITOM) Visibility application or in the ITOM Discovery application. As defined in the section titled "Managed IT Resource Types" in ServiceNow Subscription Unit Overview for your subscription, for managed IT resources that are created or modified in the CMDB by this Service Graph Connector, but that aren’t yet managed by ITOM Visibility or ITOM Discovery, these resources will increase Subscription Unit consumption from that application. Review your current Subscription Unit consumption within ITOM
Visibility or ITOM Discovery to ensure available capacity.
Obtain the following information from your
Microsoft Intune administrator:
For the connector to access the data in
Microsoft Intune, the credential information is required to use the Microsoft Graph API. Therefore, you must grant the following Graph API permissions from the App registrations page in the
Microsoft portal:
For more details on permissions, see Service Graph Connector for Microsoft Intune - Troubleshooting connection issues on ServiceNow Community and Microsoft Graph permissions reference on the Microsoft documentation site.
Dependencies and requirements:
Multi-instance is supported for importing data from multiple Microsoft Intune instances in Service Graph Connector for Microsoft Intune version 2.1.1 and later. This feature involves dynamically creating data sources and scheduled imports, which requires the granting of additional permissions. The guided setup includes
additional steps for this feature.
Role required: admin
Role required: SGC-Admin (sn_cmdb_int_util.sgc_admin) or admin
Nota: The admin user role is required to run background scripts and to provide access to global tables to the SGC-Admin user. For
information about the user roles for
Service Graph Connectors, see
Service Graph Connector user roles.
Procedimento
-
Navigate to .
-
On the Getting Started page, select Get started.
-
Configure the credentials.
-
On the Service Graph Connector for Microsoft Intune page, in the Configure the connection section, select the task Configure credentials.
-
On the next page, in the Configure credentials task section, select Configure.
-
On the form, fill in the fields.
-
Click Update if necessary.
-
Select Edit and Get OAuth Token.
-
Go back to the guided setup page and for the Configure credentials task, select Mark as Complete.
- Opcional:
If needed, configure the MID Server.
-
In the Configure MID Server section, select Configure.
-
Select the Use MID server check box.
-
Select Update to save the record.
Nota: You do not need to update the other fields.
-
Test the connection to the Microsoft Intune API.
-
In the Test the connection section, select Configure.
-
On the form, review the fields.
- Opcional:
Modify the properties in the Service Graph Connection Properties related list of the connection record.
Nota: Try to retain the default value of the software_path property to ensure the proper retrieval of software details.
-
Select the Test Connection related link to start the testing process.
Testing the connection takes a few moments, after which the page refreshes to show the test results.
Nota: The connection is successful if the HTTP Status is
200. If there is an Error Code and Error Message, the connection failed and further troubleshooting is required. Do not click Load
All Records during this step.
-
When the Status field is set to Success, return to the guided setup page.
If any of the tests have errors, follow the suggestions for remediation.
-
In the Test the connection task section, select Mark as Complete.
-
Add multiple instances.
-
On the left sidebar, select the Add Multiple Instances icon (
).
-
On the Service Graph Connector for Microsoft Intune page, in the Add Multiple Instances section, select the Update Data Source Access task.
-
Select the Global application scope by using the application picker.
-
In the Application Access related list, select the Can create, Can update, and Can delete check boxes, if not already selected.
-
Select Update to close the tab and return to the guided setup.
-
Modify the application scope again to Service Graph Connector for Microsoft Intune by using the application picker.
-
Set the Update Data Source Access task to complete by selecting Mark as Complete.
-
Repeat the steps 6.c to 6.f for the Update Scheduled data import access task with the Scheduled data import [scheduled_data_set] table and set the task to complete by selecting Mark as Complete.
-
Clear the cache for the new connection.
-
In the Clear Cache for Datasource and Import set section, select
Configure.
-
In the Run script text box of the background script
page, enter the following script:
GlideTableManager.invalidateTable("sys_data_source");
GlideCacheManager.flushTable("sys_data_source");
GlideTableManager.invalidateTable("scheduled_import_set");
GlideCacheManager.flushTable("scheduled_import_set");
GlideTableManager.invalidateTable("sys_db_object");
GlideCacheManager.flushTable("sys_db_object");
-
Select Run Script to run the background script in the
global scope.
The script may take several minutes to execute.
-
After the script is executed, select Close.
-
From the application picker, select the Service Graph Connector
for Microsoft Intune application.
-
Select Mark as Complete.
-
To either add or save the connection, select Configure for the Create or Edit connection task.
Nota: Obtain the following information from your
Microsoft Intune administrator:
When a Microsoft Intune administrator registers an application, the Client ID, Client Secret, and Token URL will be available. To get more information about how to register an application, see the Microsoft Intune documentation site.
-
On the form, fill in the fields or edit as needed.
-
Either add or save the connection.
-
Navigate back to the guided setup and select Mark as Complete.
- Opcional:
Set up the MID Server for the connection you created.
- In the Configure Mid Servers section, select Configure.
- Select the name of the connection you created.
- Select the Use MID server check box.
- Select Update.
- When you're finished with the task, select Mark as Complete
-
Test the API connection to import data from the Microsoft Intune application.
-
Test the connection, in the Test New Connections section, by selecting Configure.
- Select the name of the data source associated with the newly created connection.
- Select the Test Connection related link to start the process.
- Optionally modify the properties in the Service Graph Connection Properties related list.
Nota: The properties in the Service Graph Connection Properties related list of the connection record are modifiable. However, try to retain the default value of the
software_path property to ensure the proper retrieval of software details.
- When the Status field is set to Success, return to the guided setup page.
Nota: If any of the tests have errors, follow the suggestions for
remediation.
- Click the Test Load 20 Records related link.
Nota: If the displayed completion code is Success, then the sources are validated.
But if the displayed completion code is Error, then there is an error that you must fix.
- Return to the guided setup and select Mark as Complete for the Test New Connections task.
-
Set up the scheduled import jobs.
-
For the Configure scheduled jobs task in the Set up scheduled import jobs section, select Configure.
-
Select the name of the scheduled import you want to run.
-
On the Scheduled Data Import form, verify the field values for the scheduled job and select the Active check box.
-
Select Update.
-
Set the Configure scheduled jobs task to complete by selecting Mark as Complete.
-
Use advanced options to resolve server errors and improve performance with the SG-Intune Computer, SG-Intune Devices, and SG-Intune Software data sources while importing a large number of devices into the Microsoft Intune portal.
-
Configure the scheduled jobs to import data using the SG-Intune Device Reports and SG-Intune Software Reports data sources.
- In the Advanced [Beta] section, for the Configure scheduled jobs for advanced data sources task, select Configure.
- In the Scheduled jobs list, select SG-Intune Trigger Device Reports job.
- On the Scheduled Script Execution form, verify the field values for the scheduled job and select the Active check box.
For more information, see Schedule script execution form.
- Select Update.
- To activate the scheduled job for the SG-Intune Software Reports data source, repeat steps 11.a.ii to 11.a.iv by selecting the SG-Intune Trigger Software Reports scheduled job.
- Return to the guided setup page and set the Configure scheduled jobs for advanced data sources task to complete by selecting Mark as Complete.
-
Configure the scheduled import for the SG-Intune Device Reports and SG-Intune Software Reports data sources.
- In the Advanced [Beta] section, for the Configure the scheduled import for advanced data sources task, select Configure.
- In the Scheduled Data Imports list, select the SG-Intune Device Reports scheduled import.
- On the Scheduled Data Import form, verify the field values for the scheduled data import and select the Active check box.
For more information, see Schedule a data import.
- Select Update.
- Return to the guided setup page and set the Configure the scheduled import for advanced data sources task to complete by selecting Mark as Complete.
Importante: Verify that the SG-Intune Device Reports scheduled import is configured to run 3 hours after the SG-Intune Trigger Device Reports and SG-Intune Trigger Software Reports scheduled jobs.
Example: If
the SG-Intune Trigger Device Reports job is set for 9 a.m. and SG-Intune Trigger Software Reports for 10 a.m. daily, schedule the SG-Intune Device Reports scheduled import for 1 p.m. daily.
-
When using multiple instances, update the permissions on the Scheduled Script Execution [sys_autoscript] table so that you can add scheduled jobs for the new connections.
- For the Update scheduled job access task, select Configure.
- Select the Global application scope from the application picker.
- In the Application Access related list, select the Can create, Can update, and Can delete check boxes.
- Select Update.
- Switch back to the Service Graph Connector for Microsoft Intune application scope using the application picker.
- Return to the guided setup page and set the Update scheduled job access task to complete by selecting Mark as Complete.
-
When using multiple instances, clear the Scheduled Script Execution (sysauto_script) table cache to configure scheduled jobs for the new connections.
- For the Clear cache for scheduled job task, select Configure.
- Select the Global application scope from the application picker.
- In the Run script field, enter the following code:
GlideTableManager.invalidateTable("sysauto_script");
GlideCacheManager.flushTable("sysauto_script");
GlideTableManager.invalidateTable("sys_db_object");
GlideCacheManager.flushTable("sys_db_object");
- Select Run Script.
- Switch back to the Service Graph Connector for Microsoft Intune application scope using the application picker.
- Return to the guided setup page and set the Clear cache for scheduled job task to complete by selecting Mark as Complete.
-
When using multiple instances, create advanced data sources, scheduled jobs, and scheduled imports for the new connections.
Dica: You can create additional connections for multiple instances by following the instructions in the
Add Multiple Instances section of the guided setup.
- For the Set up advanced data sources for multiple instances task, select Configure.
- On the form, fill in the fields to configure your scheduled job details for the new connection.
- Select Submit to create scheduled imports for your new connection.
- To activate any newly created scheduled jobs, repeat steps 11.a.ii to 11.a.iv.
- To activate any newly created parent scheduled import, repeat steps 11.b.ii to 11.b.iv.
- Return to the guided setup page and set the Set up advanced data sources for multiple instances task to complete by selecting Mark as Complete.