列出设置

命名空间:microsoft.graph

检索租户级别或特定于组的组设置对象的列表。

权限

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限

列出租户范围的设置

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) Directory.Read.All、Directory.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 Directory.Read.All、Directory.ReadWrite.All

列出特定于组的设置

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) Group.Read.All、Group.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
Application Group.Read.All、Group.ReadWrite.All

HTTP 请求

列出租户范围的设置。

GET /groupSettings

列出特定于组的设置

GET /groups/{groupId}/settings

可选的查询参数

此方法支持 $select OData 查询参数 ,以帮助自定义响应。

请求标头

名称 说明
Authorization Bearer {token}。必需。

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法在响应正文中返回一个 200 OK 响应代码和 groupSetting 对象集合。

示例

示例:检索租户级组设置

请求

GET https://graph.microsoft.com/v1.0/groupSettings

响应

注意: 为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groupSettings",
  "value": [
    {
      "id": "f0b2d6f5-097d-4177-91af-a24e530b53cc",
      "displayName": "Group.Unified",
      "templateId": "62375ab9-6b52-47ed-826b-58e47e0e304b",
      "values": [
        {
          "name": "EnableMIPLabels",
          "value": "true"
        },
        {
          "name": "CustomBlockedWordsList",
          "value": ""
        },
        {
          "name": "EnableMSStandardBlockedWords",
          "value": "true"
        },
        {
          "name": "ClassificationDescriptions",
          "value": ""
        },
        {
          "name": "DefaultClassification",
          "value": ""
        },
        {
          "name": "PrefixSuffixNamingRequirement",
          "value": "[Contoso-][GroupName]"
        },
        {
          "name": "AllowGuestsToBeGroupOwner",
          "value": "false"
        },
        {
          "name": "AllowGuestsToAccessGroups",
          "value": "true"
        },
        {
          "name": "GuestUsageGuidelinesUrl",
          "value": "https://privacy.contoso.com/privacystatement"
        },
        {
          "name": "GroupCreationAllowedGroupId",
          "value": ""
        },
        {
          "name": "AllowToAddGuests",
          "value": "true"
        },
        {
          "name": "UsageGuidelinesUrl",
          "value": ""
        },
        {
          "name": "ClassificationList",
          "value": ""
        },
        {
          "name": "EnableGroupCreation",
          "value": "true"
        }
      ]
    }
  ]
}

示例 2:检索特定组的组设置

请求

GET https://graph.microsoft.com/v1.0/groups/05aa6a98-956a-45c0-b13b-88076a23f2cd/settings

响应

注意: 为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groupSettings",
    "value": [
        {
            "id": "a06fa228-3042-4662-bd09-33e298da1afe",
            "displayName": "Group.Unified.Guest",
            "templateId": "08d542b9-071f-4e16-94b0-74abb372e3d9",
            "values": [
                {
                    "name": "AllowToAddGuests",
                    "value": "false"
                }
            ]
        }
    ]
}