Update administrativeunit
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Update the properties of an administrativeUnit object.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | AdministrativeUnit.ReadWrite.All | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | AdministrativeUnit.ReadWrite.All | Not available. |
To update an administrative unit, the calling principal must be assigned at least the Privileged Role Administrator Microsoft Entra role.
HTTP request
PATCH /administrativeUnits/{id}
PATCH /directory/administrativeUnits/{id}
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
In the request body, supply the values for relevant fields that should be updated. Existing properties that aren't included in the request body maintains their previous values or be recalculated based on changes to other property values. For best performance, you shouldn't include existing values that haven't changed.
Property | Type | Description |
---|---|---|
description | String | Description for the administrative unit. |
displayName | String | Display name for the administrative unit. |
membershipRule | String | Dynamic membership rule for the administrative unit. For more about the rules that you can use for dynamic administrative units and dynamic groups, see Using attributes to create advanced rules. |
membershipRuleProcessingState | String | Used to control whether the dynamic membership rule is actively processed. Set to On when you want the dynamic membership rule to be active and Paused if you want to stop updating membership dynamically. |
membershipType | String | Membership type for the administrative unit. Can be dynamic or assigned . |
visibility | String | Visibility for the administrative unit. If not set, then the default is public . Can be set to HiddenMembership , which hides the membership from nonmembers. |
Since the administrativeUnit resource supports extensions, you can use the PATCH
operation to add, update, or delete your own app-specific data in custom properties of an extension in an existing administrativeUnit instance.
Response
If successful, this method returns a 204 No Content
response code.
Examples
The following example sets a dynamic membership rule on an existing administrative unit to include all users whose country is United States. It also updates the administrative unit display name.
Request
PATCH https://graph.microsoft.com/beta/administrativeUnits/4d7ea995-bc0f-45c0-8c3e-132e93bf95f8
Content-type: application/json
{
"displayName": "Executive Division",
"membershipType": "Dynamic",
"membershipRule": "(user.country -eq \"United States\")",
"membershipRuleProcessingState": "On"
}
Response
HTTP/1.1 204 No Content
Related content
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기