> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xdr-3.x/cortex-xdr-3.x-documentation/data-management/data-ingestion/external-data-ingestion/ingest-authentication-logs-and-data/ingest-logs-and-data-from-microsoft-365.md).

# Ingest logs and data from Microsoft 365

The Microsoft 365 email collector fetches email metadata through Microsoft Graph API, using an authorized app. A compliance mailbox is not required.

{% hint style="info" %}

### Notice

Ingestion of logs and data requires a Cortex XDR Pro per GB license.
{% endhint %}

{% hint style="warning" %}

### Danger

* A user account with the Microsoft Azure Account Administrator role is required to set up a new Microsoft 365 email collector.
* The following Microsoft Graph API permissions are required:
  * Mailbox access (read-write)
    * Read and write mail in all mailboxes
    * Read contacts in all mailboxes
    * Read all user mailbox settings
  * User information, groups, and directory data (read-only)
    * Read directory data
    * Read all groups
    * Read all users' full profiles
      {% endhint %}

<details>

<summary>Scoping</summary>

You can narrow down the scope of ingested mailboxes by:

* Microsoft 365 Group
* Distribution List
* Mail-enabled Security Group
* Mail-enabled Users

</details>

<details>

<summary>Datasets</summary>

The Microsoft 365 collector provides a comprehensive data stream by ingesting information into the following datasets.

* `msft_o365_emails_raw`: Metadata and logs for email traffic.
* `msft_o365_users_raw`: Information regarding user accounts and identities.
* `msft_o365_groups_raw`: Data related to Office 365 groups and distribution lists.
* `msft_o365_devices_raw`: Details on devices registered within the M365 environment.
* `msft_o365_mailboxes_raw`: Configuration and status logs for individual mailboxes.
* `msft_o365_rules_raw`: Logs for mail flow, transport, and inbox rules.
* `msft_o365_contacts_raw`: Organizational and user-defined contact information.

</details>

<details>

<summary>How to configure Microsoft 365 collection?</summary>

1. Navigate to data source.

   On the **Collection Integrations** page, locate **Microsoft 365**, and select **Add Instance** to begin a new connection.
2. Permissions verification

   In the wizard, review the required items on the **Permissions** page, and then click **Next**.
3. Authorization

   Click **OK** to confirm you understand that API authorization consent is required.
4. Microsoft Sign-in
   1. Select the Microsoft account for collection.
   2. Click **Next**.
   3. Enter your credentials for the Microsoft account and click **Sign in**.
   4. If you are asked to perform authentication using your organization's authentication tools, do so.
5. Accept permissions

   Review the list of of permissions requested by the collector and click **Accept**.
6. Define scope
   1. On the **Scope** page, select one of the following:
      * **Entire organization**: Emails will be collected from all mailboxes in your organization.
      * **Specific groups**: Enter the email addresses of group names, such as Microsoft 365 Groups, Mail-enabled Security Groups, Distribution Lists, or Mail-enabled Users.
   2. Click **Next**.
7. Finalize
   1. On the **Details** page, enter a meaningful instance name, and click **Next**.
   2. On the **Summary** page, check your configurations, and then click **Create**.

**Verification**

Once the configuration is complete, a green check mark will appear below the Microsoft 365 configuration, and the console will display the amount of data received. You can now run queries against the datasets listed above.

</details>


---

# 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://cortex-docs.paloaltonetworks.com/cortex-xdr-3.x/cortex-xdr-3.x-documentation/data-management/data-ingestion/external-data-ingestion/ingest-authentication-logs-and-data/ingest-logs-and-data-from-microsoft-365.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.
