> For the complete documentation index, see [llms.txt](https://support.meetuma.ai/uma-knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.meetuma.ai/uma-knowledgebase/integrations/calendar/microsoft-365/limit-access-to-mailboxes.md).

# Limit access to mailboxes

<figure><img src="https://627748108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0shDrJltbdGiCRz6ip4Z%2Fuploads%2F0U1G9m57W0d8fQjxdhHJ%2Flogo_microsoft365.webp?alt=media&amp;token=efd6e5ec-67ec-4bb7-89ec-19183a1cc0ed" alt=""><figcaption></figcaption></figure>

To enhance security and control over UMA's access to Microsoft 365, we allow organisations to limit access to specific users and resources.

This setup is optional, and UMA will function as expected without changes if the existing authorisation process has been applied.&#x20;

We only access data configured by you via our admin portal, including users, room calendars and security groups.

### **Create a mail enabled security group**

Login to Microsoft 365 and create a mail enabled security group.

### **Add resources and mailboxes**

Add all users and resources intended for use in UMA.

### **Connect with PowerShell**

Launch PowerShell and connect using modern authentication:

```powershell
Connect-ExchangeOnline -UserPrincipalName {Microsoft 365 admin email address}
```

### **Apply application access policy**

Apply the application access policy to the UMA Vision enterprise application using the provided script:

```powershell
New-ApplicationAccessPolicy -AccessRight RestrictAccess -AppId "bea520a4-6256-441d-90af-37598ba710fd" -PolicyScopeGroupId "mail_enabled_security_email -Description "Restrict UMA to members of Mail Enabled Security Group (mail_enabled_security_name)."
```

Parameters:

* <mark style="color:blue;">AppId:</mark> UMA Vision enterprise application ID.
* <mark style="color:blue;">mailenabledsecurityemail:</mark> Email address set up in Step 1.
* <mark style="color:blue;">Description:</mark> A description of the policy.

### **Test the policy**

Test the newly created application access policy:

```powershell
Test-ApplicationAccessPolicy -Identity {EmailAddressInGroup} -AppId bea520a4-6256-441d-90af-37598ba710fd
```

An AccessCheckResult of "Granted" should be displayed.

```powershell
Test-ApplicationAccessPolicy -Identity {EmailAddressNotInGroup} -AppId bea520a4-6256-441d-90af-37598ba710fd
```

An AccessCheckResult of "Denied" should be displayed.

{% hint style="info" %}
Changes to application access policies may take over 1 hour to take effect with Microsoft Graph REST API calls. Even if Test-ApplicationAccessPolicy shows positive results.
{% endhint %}


---

# 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://support.meetuma.ai/uma-knowledgebase/integrations/calendar/microsoft-365/limit-access-to-mailboxes.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.
