cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ErikT
Lansweeper Tech Support
Lansweeper Tech Support
Sending emails using a Microsoft Cloud Services application was introduced in Lansweeper 8.3. If you are using an older Lansweeper release, you will need to update by following the instructions in this knowledge base article.

Using Lansweeper it's possible to send emails in the context of both the helpdesk module and to send report and event alerts. Since Lansweeper 8.3, O365 with modern authentication is supported as a mail provider. To do this a Microsoft Cloud Services application is required. This article explains what is required to set this up, which permissions to add to your Microsoft Cloud Services application and how to configure your email account in the helpdesk email configuration or email alert configuration.

Prerequisites

To use an O365 email account to send or receive emails in Lansweeper, make sure that:

Adding permissions to the Microsoft Graph application to send and receive emails

 

Step 1: API permissions in the Azure Portal

Open your companies' Azure portal, navigate to app registration and click on the API permissions tab in the left-hand menu.

Scanning_with_a_Microsoft_cloud_credential_5.jpg

On the API permissions page, click on the Add permission button and select the Microsoft Graph from the API list. Scanning_M365_with_a_Microsoft_cloud_credential_6.jpg As we are setting up the Graph API to enforce modern authentication, you will need to add Application permissions. Therefore, click the Application permissions button. Scanning_with_a_Microsoft_cloud_credential_6.jpg Add the API permissions listed in the table below. These are all required to send and receive emails.

Mail.ReadWrite

Read and write mail in all mailboxes

Mail.Send

Send mail as any user

User.Read.All

Read all users' full profiles

Once the permissions are added, click the save button on the bottom of the page and double-check that the permissions that are listed. How-to-setup-a-MS-graph-email-configuration-4.jpg

Step 2: Grant admin consent

The permissions are added but admin consent must still be granted. To do this, click the button Grant admin consent for <organization> and click the Grant button in the resulting pop-up. How-to-setup-a-MS-graph-email-configuration-5.jpg All added permissions should now show Granted for <organization> How-to-setup-a-MS-graph-email-configuration-6.jpg

By default, when using the settings above, your application will have access to all mailboxes in your O365 tenant. You can restrict this further by configuring "ApplicationAccessPolicy".

How to configure your email account in the helpdesk email configuration

Navigate to Configuration\Email Settings and click the add E-mail account button. You can also change an existing configuration by hitting the edit button. Fill out DisplayName and E-mail address in the General Settings tab.

The email address entered in the General Settings tab will be the email address used for sending and receiving email.
Next, click on the incoming tab and select Microsoft Graph (REST API) as protocol. Fill in the Client ID, Tenant ID, and Client Secret. These values can be gathered when creating the Microsoft Cloud Services application.

How_to_setup_a_MS_graph_email_configuration_1.jpg Last, click on the outgoing tab and select the Microsoft Graph (REST API) as protocol. Fill out the Client ID, Tenant ID, and Client Secret, and click the OK button to save your helpdesk email account. How_to_setup_a_MS_graph_email_configuration_2.jpg

The Client Secret entered in the Incoming and Outgoing tabs should contain the Secret Value and not the Secret ID.

How to configure your email account to send Email Alerts

Navigate to Configuration\Email Alerts and select the Microsoft Graph (REST API) protocol in the E-mail Server section. Fill in the From address, Client ID, Tenant ID, and Client Secret. These values can be gathered when creating the Microsoft Cloud Services application.

How_to_setup_a_MS_graph_email_configuration_3.jpg

The email address entered in the From address field will be used to send the Email alerts.
Comments
SRT
Engaged Sweeper

This article is great, thanks.

I can get working with my email account, however, I can't get working for a shared mailbox - receive the following error when attempting to send using a shared mailbox.

Are you able to provide advice on how to get working for a shared mailbox, please?

The E-mail server has not been configured correctly: Http call to MS Graph has failed with status code NotFound: {"error":{"code":"Request_ResourceNotFound","message":"Resource 'sharedmailbox@mydomain.com' does not exist or one of its queried reference-property objects are not present.","innerError":{"date":"2023-03-23T02:07:43","request-id":"3ffb110d-94e0-4efd-9c47-921304d052d5","client-request-id":"3ffb110d-94e0-4efd-9c47-921304d052d5"}}} (Last tried: 23/03/2023 10:07:41)

New to Lansweeper?
Article Dashboard
Version history
Last update:
‎12-01-2022 01:50 PM
Updated by: