> For the complete documentation index, see [llms.txt](https://help.nightfall.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.nightfall.ai/microsoft-365/getting_started/microsoft_tenant_setup.md).

# Setting up Microsoft Tenant

Learn how to setup Microsoft Tenant for Nightfall

{% hint style="info" %}
You must sign in as a Microsoft **Global Administrator** or **Privileged Role Administrator**. The sign-in gives Nightfall temporary access to create its app registrations in your tenant. Nightfall receives no refresh token, so this access ends shortly after you finish. For each permission and why it is needed, see [SaaS App Permissions Reference](/nightfall_integrations/saas-app-permissions-reference.md).
{% endhint %}

To set up a Microsoft tenant:

1. Click **Integrations** from the left menu.
2. Click **Manage** for **MS Teams**/**OneDrive** (depending on which app you are configuring).
3. Expand the required Microsoft tenant. If you cannot view your Microsoft tenant, click **Add Tenant**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FMulfVAoVYAn9aC3UqaGN%2Fimage.png?alt=media&#x26;token=56afd4e0-8601-4428-afc1-715777d03aa3" alt=""><figcaption></figcaption></figure>

4. Click **Update App Selection**.
5. Click **Connect**. The Microsoft sign-in page displays.
6. Enter the email address and password to sign in to Microsoft 365 administrator login. You may be prompted to perform multi-factor authentication on the Microsoft Authenticator app, if you have setup multi-factor authentication.
7. Upon successful authentication, Microsoft shows the permissions that Nightfall's setup app needs. Nightfall uses them only while you are signed in, to create and maintain its app registrations in your tenant. They are not used for scanning. See [SaaS App Permissions Reference](/nightfall_integrations/saas-app-permissions-reference.md) for what each permission is used for.
8. Click **Accept** and your Microsoft 365 tenant information is added to Nightfall.
9. Select the Microsoft applications you want to monitor. Currently, **OneDrive for Business** and **MS Teams** are the available applications.
10. Click **Save Changes.**
11. Click **Finish** to complete the tenant setup.

After a successful Directory Sync and M365 tenant registration, you can see that the selected apps (MS Teams, OneDrive) show a **Valid** status, which implies they are ready to be monitored for sensitive data. You may proceed with the policy creation for either MS Teams, or OneDrive.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FL7yrVVrM7jG5JdBKS8aD%2Fimage.png?alt=media&#x26;token=4c4bdf9f-d5f2-4b57-ac5d-1f6a8e829354" alt="" width="563"><figcaption></figcaption></figure>

If you have not enabled either the OneDrive or the MS Teams application, the **Connect** button is displayed against the app. You can click the **Update App Selection** button to enable to the app.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FE8otbUDtkq76yly6uWXQ%2Fimage.png?alt=media&#x26;token=3c94c544-931f-4feb-844a-149e315a7b07" alt="" width="563"><figcaption></figcaption></figure>

## Deleting a Tenant

You can delete a Microsoft tenant. Before you can delete a tenant, you must ensure that there are no active policies configured for that tenant. After you delete a tenant, you would not create any policies on the deleted tenant and Nightfall would not monitor the deleted tenant.

Deleting a tenant needs an admin sign-in, because Nightfall uses that temporary access to delete its app registrations and remove its setup app from your tenant.

To delete a tenant:

1. Click the delete icon for the required tenant. A delete confirmation window is displayed
2. Click **Yes, please.**
3. Click **Connect**.
4. Log in to Microsoft 365 by entering your admin credentials.
5. The Microsoft sign-in window pop-up is displayed. Select the required option.
6. The Nightfall delete confirmation window is displayed. Click **Yes, please delete**.
7. The delete confirmation window is displayed. Click **Finish**.


---

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.nightfall.ai/microsoft-365/getting_started/microsoft_tenant_setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
