How to Set Up Microsoft Exchange Online IntegrationHub SpokeSummary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } The Microsoft Exchange Online spoke allows you to create and manage calendar events and mail in Microsoft Exchange Online. User and group management is not supported in this spoke; for creating, managing, or deleting users and groups, use the Microsoft Azure AD spoke. This KB article provides step-by-step guidance to set up and test the Microsoft Exchange Online spoke. For detailed information on dependencies, subscription setup, available flow actions, and required permissions, refer to the official documentation: Official Documentation: Microsoft Exchange Online Spoke DocumentationStore Link: Microsoft Exchange Online Spoke on ServiceNow Store Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } N/A Instructions<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Step 1: Register an Application in Microsoft Azure Portal To enable ServiceNow to access Microsoft Exchange Online via OAuth 2.0, you need to register a custom application in Azure AD and configure the required permissions. Follow these steps: Log in to Azure Portal Open Microsoft Azure Portal and sign in using your organization credentials. Register a New Application Navigate to Azure Active Directory > App registrations > New registration. Enter the Application nameSelect the Supported account type based on your organization's requirements.Provide the Redirect URI in the following format:https://<instance>.service-now.com/oauth_redirect.doClick Register. Record Application Details After registration, copy the Application (Client) ID and Directory (Tenant) ID. You will need these values when configuring the ServiceNow spoke. Create a Client Secret Navigate to Manage > Certificates & Secrets.Click New client secret.Provide a Description and select an Expiration period.Click Add.Copy the client secret value immediately and store it securely. It cannot be retrieved later. Enable Required API Permissions You can refer to the article KB2608496 : Permissions required for the Microsoft Exchange Online IntegrationHub spoke actions for detailed information on the API permissions needed for Microsoft Exchange Online. Navigate to Manage > API permissions.Click Add a permission, then select the Microsoft Graph tile.Choose the necessary permissions.Click Add permissions.Click Grant admin consent to approve the permissions for your tenant. Once completed, the Azure AD application is registered and ready to be used with the Microsoft Exchange Online spoke in ServiceNow. Step 2: Register Microsoft Exchange Online as an OAuth Provider To allow the ServiceNow instance to request OAuth 2.0 tokens from Microsoft Exchange Online, you need to register it as an OAuth provider. Register Microsoft Exchange Online (Authorization Code Flow) Navigate to All > System OAuth > Application Registry.Open the record named Microsoft Exchange Online.Fill in the following fields using the values obtained from Azure AD: Client ID: Application (Client) ID from Azure AD.Client Secret: Client secret created in Azure AD.Authorization URL:https://login.microsoftonline.com/<Directory-ID>/oauth2/v2.0/authorizeToken URL:https://login.microsoftonline.com/<Directory-ID>/oauth2/v2.0/tokenToken Revocation URL: OAuth server token revocation endpoint (optional).Redirect URL:https://<instance-name>.service-now.com/oauth_redirect.doClick Save. Register Microsoft Exchange Online (Client Credentials Flow) Navigate to System OAuth > Application Registry.Open the record named Microsoft Exchange Online_clientCredentials.Fill in the following fields: Client ID: Application (Client) ID from Azure AD.Client Secret: Client secret created in Azure AD.Default Grant Type: Select Client Credentials.Token URL:https://login.microsoftonline.com/<Directory-ID>/oauth2/v2.0/tokenRedirect URL:https://<instance-name>.service-now.com/oauth_redirect.doClick Save. Step 3: Create Credential Records for the Microsoft Exchange Online Spoke To authorize actions in the Microsoft Exchange Online spoke, you need to create credential records using the Azure AD application registered earlier. The spoke connection and credential alias use these credentials to perform actions securely. Create OAuth 2.0 Credential (Authorization Code Flow) Navigate to All > Connections & Credentials > Credentials.Click New. The system prompts: What type of credentials would you like to create?Select OAuth 2.0 Credentials.Fill in the following fields: FieldDescriptionNameUnique name to identify the record, e.g., Exchange_Online_Credentials.ActiveSelect to actively use the credential record.OAuth Entity Profile Select the OAuth profile created for Microsoft Exchange Online with Default Grant Type set to Authorization Code.Applies ToSelect the MID Servers that can use this credential, e.g., All MID Servers.OrderEnter the order of use for credentials, e.g., 100. Right-click the form header and select Save.To generate the OAuth token, click the Get OAuth Token related link. Create OAuth 2.0 Credential (Client Credentials Flow) Navigate to All > Connections & Credentials > Credentials.Click New.Select OAuth 2.0 Credentials.Fill in the following fields: FieldDescriptionNameUnique name to identify the record, e.g., Exchange_Online_Client_Credential.ActiveSelect to actively use the credential record.OAuth Entity Profile Select the OAuth profile created for Microsoft Exchange Online_clientCredentials with Default Grant Type set to Client Credentials. Applies ToSelect the MID Servers that can use this credential, e.g., All MID Servers.OrderEnter the order of use for credentials, e.g., 100. Right-click the form header and select Save.To generate the OAuth token, click the Get OAuth Token related link. Verify Tokens Navigate to All > System OAuth > Manage Tokens. You will see: Access and Refresh Tokens for the Authorization Code grant type.Access Token only for the Client Credentials grant type. Step 4: Create Connection Records for the Microsoft Exchange Online Spoke To perform actions in Microsoft Exchange Online, you need to create connection records. These connections, along with credential aliases, allow the Microsoft Exchange Online spoke to execute actions securely. Create Connection Record (Authorization Code Flow) Navigate to All > Connections & Credentials > Connection & Credential Aliases.Open the record Microsoft_Exchange_Online.In the Connections related list, click New.Fill in the following fields: FieldDescriptionNameUnique name to identify the connection, e.g., Exchange_Online_Connection.CredentialSelect the credential record created for Microsoft Exchange Online, e.g., Exchange_Online_Credentials.Connection alias Alias record associated with this connection.URL builderDo not select the checkbox.Connection URLEnter https://graph.microsoft.com.Use MID ServerOptional. If selected, define fields in the Advanced MID Server Configuration related list.ActiveSelect to actively use the connection.DomainDomain in which the action or activity runs. Click Update to save the connection. Create Connection Record (Client Credentials Flow) Navigate to Connections & Credentials > Connection & Credential Aliases.Open the record Microsoft_Exchange_Online_clientCred.In the Connections related list, click New.Fill in the following fields: FieldDescriptionNameUnique name to identify the connection, e.g., Exchange_Online_Connection_clientCred.CredentialSelect the credential record created for Microsoft Exchange Online, e.g., Exchange_Online_Credentials_clientCred.Connection alias Alias record associated with this connection.URL builderDo not select the checkbox.Connection URLEnter https://graph.microsoft.com.Use MID ServerOptional. If selected, define fields in the Advanced MID Server Configuration related list.ActiveSelect to actively use the connection.DomainDomain in which the action or activity runs. Click Update to save the connection. Note: If you plan to use Microsoft Exchange Online spoke Mailbox actions, additional setup is required: Ensure that a MID Server is installed and configured.Install PowerShell with the EXO V2 module on the MID Server. For detailed guidance on setting up the credentials and connection records for Mailbox actions, refer to the official documentation:Setup Microsoft Exchange Online Spoke Steps to refer to in the above document: Create a credential record specifically for Mailbox actions.Create a connection record for the Mailbox actions using the MID Server. These steps ensure that the Mailbox actions can run securely and properly through the MID Server using the required PowerShell module. The Microsoft Exchange Online Spoke is now successfully set up and integrated with your ServiceNow instance. You may proceed to the bonus step to test the integration using spoke actions. Bonus Step: Test the Integration with Spoke Actions After setting up the Microsoft Exchange Online spoke, you can verify the integration by testing actions such as Create Calendar Event or Look Up Calendar Events by User ID. Navigate to Flow Designer > Actions.Search for the action you want to test, for example, Create Calendar Event. This action creates an event in the user’s default calendar and allows you to specify the time zone for the start and end times. Click on Test > Provide the required inputs > Run Test You can also use the Look Up Calendar Events by User ID action to retrieve the list of event objects from the user’s mailbox. Successfully performing these actions confirms the integration is working as expected. If you encounter any issues, please revisit the steps above or contact us for assistance whenever needed.