更新 tenantAppManagementPolicy

命名空间:microsoft.graph

重要

Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

更新 tenantAppManagementPolicy 对象 的属性。

权限

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

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

HTTP 请求

PATCH /policies/defaultAppManagementPolicy

请求标头

名称 说明
Authorization Bearer {token}。必需。
Content-Type application/json. Required.

请求正文

在请求正文中,提供 tenantAppManagementPolicy 中应更新的相关字段的值。 请求正文中未包含的现有属性将保留其以前的值。 为获得最佳性能,请勿在请求有效负载中包括未更改的值。

属性 类型 说明
applicationRestrictions appManagementConfiguration 应用于租户中所有应用程序对象的默认限制。
displayName String 默认显示名称的默认值。 继承自 policyBase
说明 String 默认策略的说明。 继承自 policyBase
isEnabled Boolean 表示策略是否已启用。 默认值为 false。
servicePrincipalRestrictions appManagementConfiguration 应用于租户中所有服务主体对象的默认限制。

响应

如果成功,此方法返回 204 No Content 响应代码。它不在响应正文中返回任何内容。

示例

请求

下面展示了示例请求。

PATCH https://graph.microsoft.com/beta/policies/defaultAppManagementPolicy
Content-Type: application/json

{
    "isEnabled": true,
    "applicationRestrictions": {
        "passwordCredentials": [
            {
                "restrictionType": "passwordAddition",
                "maxLifetime": null,
                "restrictForAppsCreatedAfterDateTime": "2021-01-01T10:37:00Z"
            },
            {
                "restrictionType": "passwordLifetime",
                "maxLifetime": "P4DT12H30M5S",
                "restrictForAppsCreatedAfterDateTime": "2017-01-01T10:37:00Z"
            },
            {
                "restrictionType": "symmetricKeyAddition",
                "maxLifetime": null,
                "restrictForAppsCreatedAfterDateTime": "2021-01-01T10:37:00Z"
            },
            {
                "restrictionType": "customPasswordAddition",
                "maxLifetime": null,
                "restrictForAppsCreatedAfterDateTime": "2015-01-01T10:37:00Z"
            },
            {
                "restrictionType": "symmetricKeyLifetime",
                "maxLifetime": "P40D",
                "restrictForAppsCreatedAfterDateTime": "2015-01-01T10:37:00Z"
            }
        ],
        "keyCredentials":[
            {
                "restrictionType": "asymmetricKeyLifetime",
                "maxLifetime": "P30D",
                "restrictForAppsCreatedAfterDateTime": "2015-01-01T10:37:00Z"
            },
        ]
    }
}

响应

下面展示了示例响应。

HTTP/1.1 204 No Content