# Add Or Remove Tenant Allow Block List

### Description

Adds or removes entries from the Tenant Allow/Block List in Microsoft Defender for Office 365. The runbook supports senders, URLs, and file hashes and sets new entries to expire after 30 days by default.

### Location

Organization → Mail → Add Or Remove Tenant Allow Block List

**Full Runbook name**

rjgit-org\_mail\_add-or-remove-tenant-allow-block-list

### Permissions

#### Application permissions

* **Type**: Office 365 Exchange Online
  * Exchange.ManageAsApp

#### RBAC roles

* Exchange administrator

### Parameters

#### Entry

The entry to add or remove (for example: domain, email address, URL, or file hash).

| Property      | Value  |
| ------------- | ------ |
| Required      | true   |
| Default Value |        |
| Type          | String |

#### ListType

Type of entry to manage.

| Property      | Value  |
| ------------- | ------ |
| Required      | false  |
| Default Value | Sender |
| Type          | String |

#### Block

"Block List (block entry)" (final value: $true) or "Allow List (permit entry)" (final value: $false) can be selected as list type.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | True    |
| Type          | Boolean |

#### Remove

"Add entry to the list" (final value: $false) or "Remove entry from the list" (final value: $true) can be selected as action to perform.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | False   |
| Type          | Boolean |

#### DaysToExpire

Number of days until a newly added entry expires.

| Property      | Value |
| ------------- | ----- |
| Required      | false |
| Default Value | 30    |
| Type          | Int32 |

[Back to Runbook Reference overview](/automation/runbooks/runbook-references.md)


---

# Agent Instructions: 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:

```
GET https://docs.realmjoin.com/automation/runbooks/runbook-references/org/mail/add-or-remove-tenant-allow-block-list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
