> For the complete documentation index, see [llms.txt](https://docs.expel.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.expel.io/more-features/expel-managed-phishing/setup-guides/microsoft-365-message-trace-setup.md).

# Microsoft 365 Message Trace Setup

This procedure enables the Message Trace API for an Microsoft 365 installation, which helps Expel investigate phishing submissions. This procedure varies depending on which option you selected while connecting your Microsoft 365 installation to Workbench:

* If you chose to [enable the Expel O365 integration](/connect-your-technology/l-p-integrations/microsoft/microsoft-365-setup-for-workbench.md#option-1-enable-the-expel-o365-integration-recommended) during your onboarding, follow the steps in [Option 1.](#option-1-expel-o365-integrations)
* If you chose to [create a custom Entra ID app](/connect-your-technology/l-p-integrations/microsoft/microsoft-365-setup-for-workbench.md#option-2-create-a-custom-entra-id-app) during your onboarding, follow the steps in [Option 2](#option-2-custom-entra-id-apps).

{% hint style="info" %}
If you need additional help, [contact Support](/support/how-to-reach-us.md).
{% endhint %}

## Option 1 (Expel O365 Integrations)

<details>

<summary>New Installation</summary>

1. Navigate to **Azure Ad roles and administrators**.
2. Search for and select the following roles:
   * Global reader
   * Security reader
3. Select **Add assignments**.

<div align="left"><figure><img src="/files/1pqcMjryYILZ7l4UBD1K" alt="Image of the Assignments page." width="368"><figcaption></figcaption></figure></div>

4. Search for the **Expel Microsoft 365 integration** enterprise app and select it.
5. Select **Add**.

</details>

<details>

<summary>Existing Installation</summary>

1. Navigate to **Expel Microsoft 365 Integration > API Permissions**, and then select **Grant admin consent**.
2. Consent to the new API permissions.
3. Navigate to **Azure Ad roles and administrators**.
4. Search for and select the following roles:
   * Global reader
   * Security reader
5. Select **Add assignments**.

<div align="left"><figure><img src="/files/1pqcMjryYILZ7l4UBD1K" alt="Image of the Assignments page." width="368"><figcaption></figcaption></figure></div>

6. Search for the **Expel Microsoft 365 integration** enterprise app and select it.
7. Select **Add**.

</details>

## Option 2 (Custom Entra ID Apps)&#x20;

{% hint style="info" %}
These steps apply to both new and existing installations.
{% endhint %}

1. Follow all previous API permission steps for the custom app in [Microsoft 365 Setup for Workbench](/connect-your-technology/l-p-integrations/microsoft/microsoft-365-setup-for-workbench.md#option-2-create-a-custom-entra-id-app).
2. Navigate to the custom app and select **API Permissions**.
3. On the APIs my organization uses tab, select **Add a permission**.
4. Search for and select **Microsoft 365 Exchange Online**.

<div align="left"><figure><img src="/files/ULElIADFxOJwqaxteamJ" alt="Image showing the search field and results." width="375"><figcaption></figcaption></figure></div>

5. Select **Application permissions**, and then, in the **Select permissions** search field, search for `ReportingWebService`.

<div align="left"><figure><img src="/files/dle1Xoqun8zkLBIwOGg9" alt="Image of the Request API Permissions screen." width="563"><figcaption></figcaption></figure></div>

6. Select the `ReportingWebService.Read.All` permission, and then select **Add permissions**.
7. In the confirmation, select **Grant admin consent for Expel** and then select Yes.
8. Confirm that consent is granted for the added permission in the **Status** column.
9. Navigate to **Azure Ad roles and administrators**.
10. Search for and select the following roles:
    * Global reader
    * Security reader
11. Select **Add assignments**.

<div align="left"><figure><img src="/files/1pqcMjryYILZ7l4UBD1K" alt="Image of the Assignments page." width="368"><figcaption></figcaption></figure></div>

12. Search for the **custom app** and select it.
13. Select **Add**.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.expel.io/more-features/expel-managed-phishing/setup-guides/microsoft-365-message-trace-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
