创建 windows10MobileCompliancePolicyCreate windows10MobileCompliancePolicy

命名空间:microsoft.graphNamespace: microsoft.graph

注意: 适用于 Intune 的 Microsoft Graph API 需要适用于租户的活动 Intune 许可证Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.

创建新的 windows10MobileCompliancePolicy 对象。Create a new windows10MobileCompliancePolicy object.

先决条件Prerequisites

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最高特权到最低特权)Permissions (from most to least privileged)
委派(工作或学校帐户)Delegated (work or school account) DeviceManagementConfiguration.ReadWrite.AllDeviceManagementConfiguration.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application 不支持。Not supported.

HTTP 请求HTTP Request

POST /deviceManagement/deviceCompliancePolicies

请求标头Request headers

标头Header Value
AuthorizationAuthorization Bearer <token>。必需。Bearer <token> Required.
接受Accept application/jsonapplication/json

请求正文Request body

在请求正文中,提供 windows10MobileCompliancePolicy 对象的 JSON 表示形式。In the request body, supply a JSON representation for the windows10MobileCompliancePolicy object.

下表显示了创建 windows10MobileCompliancePolicy 时所需的属性。The following table shows the properties that are required when you create the windows10MobileCompliancePolicy.

属性Property 类型Type 说明Description
idid StringString 实体的键。Key of the entity. 继承自 deviceCompliancePolicyInherited from deviceCompliancePolicy
createdDateTimecreatedDateTime DateTimeOffsetDateTimeOffset 创建对象的日期/时间。DateTime the object was created. 继承自 deviceCompliancePolicyInherited from deviceCompliancePolicy
descriptiondescription StringString 管理员提供的设备配置的说明。Admin provided description of the Device Configuration. 继承自 deviceCompliancePolicyInherited from deviceCompliancePolicy
lastModifiedDateTimelastModifiedDateTime DateTimeOffsetDateTimeOffset 上次修改对象的日期/时间。DateTime the object was last modified. 继承自 deviceCompliancePolicyInherited from deviceCompliancePolicy
displayNamedisplayName StringString 管理员提供的设备配置的名称。Admin provided name of the device configuration. 继承自 deviceCompliancePolicyInherited from deviceCompliancePolicy
versionversion Int32Int32 设备配置的版本。Version of the device configuration. 继承自 deviceCompliancePolicyInherited from deviceCompliancePolicy
passwordRequiredpasswordRequired BooleanBoolean 需要密码才可解锁 Windows Phone 设备。Require a password to unlock Windows Phone device.
passwordBlockSimplepasswordBlockSimple BooleanBoolean 是否阻止同步日历。Whether or not to block syncing the calendar.
passwordMinimumLengthpasswordMinimumLength Int32Int32 最短密码长度。Minimum password length. 有效值为 4 至 16Valid values 4 to 16
passwordMinimumCharacterSetCountpasswordMinimumCharacterSetCount Int32Int32 密码中必需的字符集数。The number of character sets required in the password.
passwordRequiredTypepasswordRequiredType requiredPasswordTyperequiredPasswordType 必需的密码类型。The required password type. 可取值为:deviceDefaultalphanumericnumericPossible values are: deviceDefault, alphanumeric, numeric.
passwordPreviousPasswordBlockCountpasswordPreviousPasswordBlockCount Int32Int32 防止重复使用的先前密码的数量。The number of previous passwords to prevent re-use of.
passwordExpirationDayspasswordExpirationDays Int32Int32 密码过期前的天数。Number of days before password expiration. 有效值为 1 至 255Valid values 1 to 255
passwordMinutesOfInactivityBeforeLockpasswordMinutesOfInactivityBeforeLock Int32Int32 在需要密码之前不活动的分钟数。Minutes of inactivity before a password is required.
passwordRequireToUnlockFromIdlepasswordRequireToUnlockFromIdle BooleanBoolean 需要密码才可解锁空闲设备。Require a password to unlock an idle device.
osMinimumVersionosMinimumVersion StringString 最低 Windows Phone 版本。Minimum Windows Phone version.
osMaximumVersionosMaximumVersion StringString 最高 Windows Phone 版本。Maximum Windows Phone version.
earlyLaunchAntiMalwareDriverEnabledearlyLaunchAntiMalwareDriverEnabled BooleanBoolean 要求设备由 Windows 设备运行状况证明报告为正常 - 提前启动反恶意驱动程序已启用。Require devices to be reported as healthy by Windows Device Health Attestation - early launch antimalware driver is enabled.
bitLockerEnabledbitLockerEnabled BooleanBoolean 要求设备由 Windows 设备运行状况证明报告为正常 - bit locker 已启用。Require devices to be reported healthy by Windows Device Health Attestation - bit locker is enabled
secureBootEnabledsecureBootEnabled BooleanBoolean 要求设备由 Windows 设备运行状况证明报告为正常 - 安全启动已启用。Require devices to be reported as healthy by Windows Device Health Attestation - secure boot is enabled.
codeIntegrityEnabledcodeIntegrityEnabled BooleanBoolean 要求设备由 Windows 设备运行状况证明报告为正常。Require devices to be reported as healthy by Windows Device Health Attestation.
storageRequireEncryptionstorageRequireEncryption BooleanBoolean 要求对 Windows 设备加密。Require encryption on windows devices.

响应Response

如果成功,此方法将在响应正文中返回 201 Created 响应代码和 windows10MobileCompliancePolicy 对象。If successful, this method returns a 201 Created response code and a windows10MobileCompliancePolicy object in the response body.

示例Example

请求Request

下面是一个请求示例。Here is an example of the request.

POST https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicies
Content-type: application/json
Content-length: 792

{
  "@odata.type": "#microsoft.graph.windows10MobileCompliancePolicy",
  "description": "Description value",
  "displayName": "Display Name value",
  "version": 7,
  "passwordRequired": true,
  "passwordBlockSimple": true,
  "passwordMinimumLength": 5,
  "passwordMinimumCharacterSetCount": 0,
  "passwordRequiredType": "alphanumeric",
  "passwordPreviousPasswordBlockCount": 2,
  "passwordExpirationDays": 6,
  "passwordMinutesOfInactivityBeforeLock": 5,
  "passwordRequireToUnlockFromIdle": true,
  "osMinimumVersion": "Os Minimum Version value",
  "osMaximumVersion": "Os Maximum Version value",
  "earlyLaunchAntiMalwareDriverEnabled": true,
  "bitLockerEnabled": true,
  "secureBootEnabled": true,
  "codeIntegrityEnabled": true,
  "storageRequireEncryption": true
}

响应Response

下面是一个响应示例。注意:为了简单起见,可能会将此处所示的响应对象截断。将从实际调用中返回所有属性。Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 964

{
  "@odata.type": "#microsoft.graph.windows10MobileCompliancePolicy",
  "id": "3d4237b0-37b0-3d42-b037-423db037423d",
  "createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
  "description": "Description value",
  "lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
  "displayName": "Display Name value",
  "version": 7,
  "passwordRequired": true,
  "passwordBlockSimple": true,
  "passwordMinimumLength": 5,
  "passwordMinimumCharacterSetCount": 0,
  "passwordRequiredType": "alphanumeric",
  "passwordPreviousPasswordBlockCount": 2,
  "passwordExpirationDays": 6,
  "passwordMinutesOfInactivityBeforeLock": 5,
  "passwordRequireToUnlockFromIdle": true,
  "osMinimumVersion": "Os Minimum Version value",
  "osMaximumVersion": "Os Maximum Version value",
  "earlyLaunchAntiMalwareDriverEnabled": true,
  "bitLockerEnabled": true,
  "secureBootEnabled": true,
  "codeIntegrityEnabled": true,
  "storageRequireEncryption": true
}