> For the complete documentation index, see [llms.txt](https://hub.equipme.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.equipme.io/documentation/automation/connectors/microsoft-entra-id-connector/directory-roles-and-deleted-items.md).

# Directory Roles and Deleted Items

Two related areas: who holds administrative roles in your directory, and what can still be recovered after deletion.

#### List Directory Roles

Returns the administrative roles currently activated in your tenant.

Each entry carries a role template identifier, which is what the assignment components need as input. In practice you run this component first and feed its output into an assignment.

#### Assign Directory Role

Grants an administrative role to a user.

If the role has not been activated in your tenant yet, it is activated as part of the assignment — so you do not need a separate preparation step for roles nobody has held before.

#### Remove Directory Role

Revokes an administrative role from a user.

#### List Deleted Items

Shows what is currently in the recycle bin. A selector decides whether you are looking at deleted users, groups or app registrations.

Microsoft keeps deleted objects for 30 days. After that they are purged and no longer recoverable, which makes this component worth checking on a schedule rather than only when something goes missing.

#### Restore Deleted Item

Restores an object from the recycle bin. The same component works for users, groups and app registrations alike.

This is the safety net behind every delete step in your flows. It is also the reason a staged approach — disable, wait, then delete — costs you very little: for 30 days after the delete, the decision is still reversible.


---

# 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://hub.equipme.io/documentation/automation/connectors/microsoft-entra-id-connector/directory-roles-and-deleted-items.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.
