RoleManagement.ReadWrite.Directory
Allows the app to read and manage the role-based access control (RBAC) settings for your company's directory, without a signed-in user. This includes instantiating directory roles and managing directory role membership, and reading directory role templates, directory roles and memberships.
In short
RoleManagement.ReadWrite.Directory is available as both an application permission and a delegated permission in the Microsoft Graph API, grouped under the RoleManagement category. Allows the app to read and manage the role-based access control (RBAC) settings for your company's directory, without a signed-in user. This includes instantiating directory roles and managing directory role membership, and reading directory role templates, directory roles and memberships. It grants read and write access to resources. Application permissions always require admin consent.
Permission Details
Read and write all directory RBAC settings
Allows the app to read and manage the role-based access control (RBAC) settings for your company's directory, without a signed-in user. This includes instantiating directory roles and managing directory role membership, and reading directory role templates, directory roles and memberships.
9e3f62cf-ca93-4989-b6ce-bf83c28f9fe8
Read and write directory RBAC settings
Allows the app to read and manage the role-based access control (RBAC) settings for your company's directory, on behalf of the signed-in user. This includes instantiating directory roles and managing directory role membership, and reading directory role templates, directory roles and memberships.
d01b97e9-cbc0-49fe-810a-750afd5527a3
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
directory |
object |
|
entitlementManagement |
object |
Container for roles and assignments for entitlement management resources. |
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"@odata.type": "#microsoft.graph.roleManagement"
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
directory |
rbacApplication |
Read-only. Nullable. |
entitlementManagement |
rbacApplication |
Container for roles and assignments for entitlement management resources. |
enterpriseApps |
rbacApplication collection |
Related enterpriseApps data exposed by this resource. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DirectoryRole
{
RoleTemplateId = "fe930be7-5e62-47db-91af-98c3a49a38b1",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DirectoryRoles.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const directoryRole = {
roleTemplateId: 'fe930be7-5e62-47db-91af-98c3a49a38b1'
};
await client.api('/directoryRoles')
.post(directoryRole);
Import-Module Microsoft.Graph.Identity.DirectoryManagement
$params = @{
roleTemplateId = "fe930be7-5e62-47db-91af-98c3a49a38b1"
}
New-MgDirectoryRole -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.directory_role import DirectoryRole
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DirectoryRole(
role_template_id = "fe930be7-5e62-47db-91af-98c3a49a38b1",
)
result = await graph_client.directory_roles.post(request_body)
App Registration
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions or delegated permissions and search for RoleManagement.ReadWrite.Directory
Grant Admin Consent
Application permissions always require admin consent.
Frequently asked questions
What is the RoleManagement.ReadWrite.Directory Microsoft Graph permission?
RoleManagement.ReadWrite.Directory is available as both an application permission and a delegated permission in the Microsoft Graph API, grouped under the RoleManagement category. Allows the app to read and manage the role-based access control (RBAC) settings for your company's directory, without a signed-in user. This includes instantiating directory roles and managing directory role membership, and reading directory role templates, directory roles and memberships. It grants read and write access to resources. Application permissions always require admin consent. It is mapped to the Microsoft Graph rolemanagement resource type. 159 documented Microsoft Graph REST methods require it. 127 Microsoft Graph PowerShell commands are documented for it.
Is RoleManagement.ReadWrite.Directory an application or a delegated permission?
RoleManagement.ReadWrite.Directory is available as both an application permission (app-only access, no signed-in user) and a delegated permission (access on behalf of a signed-in user).
Does RoleManagement.ReadWrite.Directory require admin consent?
Application permissions always require admin consent.
What is the permission ID (GUID) for RoleManagement.ReadWrite.Directory?
For RoleManagement.ReadWrite.Directory, the application (app role) ID is 9e3f62cf-ca93-4989-b6ce-bf83c28f9fe8, and the delegated (OAuth2 scope) ID is d01b97e9-cbc0-49fe-810a-750afd5527a3. These are the real Microsoft Graph identifiers and can be used directly in an app registration manifest.