Skip to content

Latest commit

 

History

History
223 lines (159 loc) · 7.31 KB

File metadata and controls

223 lines (159 loc) · 7.31 KB
title Update groupSetting
description Update the properties of a specific group setting object.
author yuhko-msft
ms.reviewer mbhargav, khotzteam, aadgroupssg
ms.localizationpriority medium
ms.subservice entra-groups
doc_type apiPageType
ms.date 03/06/2024

Update groupSetting

Namespace: microsoft.graph

Update the properties of a groupSetting object for tenant-wide group settings or a specific group setting.

[!INCLUDE national-cloud-support]

Permissions

The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

For all settings except the Consent Policy Settings object

[!INCLUDE permissions-table]

For the Consent Policy Settings object

The following permissions are required to update the "Consent Policy Settings" directorySetting object.

[!INCLUDE permissions-table]

[!INCLUDE rbac-group-directorysettings-all]

HTTP request

Update a tenant-wide setting.

PATCH /groupSettings/{groupSettingId}

Update a group-specific setting.

PATCH /groups/{groupId}/settings/{groupSettingId}

Request headers

Name Description
Authorization {token}. Required.
Content-Type application/json

Request body

In the request body, supply the values for relevant fields that should be updated.

Property Type Description
values settingValue collection The updated set of values. You must include the entire collection set. You cannot update a single set of values.

Response

If successful, this method returns a 204 No Content response code.

Examples

Example 1: Update a tenant-wide group setting

In this example, 84af2ca5-c274-41bf-86e4-6e374ec4def6 is the identifier of the tenant-wide groupSetting object.

Request

PATCH https://graph.microsoft.com/v1.0/groupSettings/84af2ca5-c274-41bf-86e4-6e374ec4def6
Content-type: application/json

{
    "values": [
        {
            "name": "AllowToAddGuests",
            "value": "false"
        }
    ]
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

HTTP/1.1 204 No Content

Example 2: Update a specific group setting

In this example, 0167b5af-f3d1-4910-82d2-398747fa381c is the identifier of the group, and fa6df613-159b-4f94-add2-7093f961900b is the identifier of the groupSetting object.

Request

PATCH https://graph.microsoft.com/v1.0/groups/0167b5af-f3d1-4910-82d2-398747fa381c/settings/fa6df613-159b-4f94-add2-7093f961900b
Content-type: application/json

{
  "values": [
    {
      "name": "AllowToAddGuests",
      "value": "true"
    }
  ]
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

HTTP/1.1 204 No Content