分配操作

命名空间:microsoft.graph

重要: Microsoft Graph 中 /beta 版本下的 API 可能会发生更改,这可能会中断应用程序。 虽然 Microsoft 支持Intune /beta API,但你应自行决定使用这些 API。 通常,建议不要在生产应用程序中使用 /beta API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

注意:适用于 Intune 的 Microsoft Graph API 需要适用于租户的活动 Intune 许可证

    ## Permissions

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

权限类型 权限(从最高特权到最低特权)
委派(工作或学校帐户)
    注册 DeviceManagementServiceConfig.ReadWrite.All
    策略集 DeviceManagementServiceConfig.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序
    注册 DeviceManagementServiceConfig.ReadWrite.All
    策略集 DeviceManagementServiceConfig.ReadWrite.All

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

HTTP 请求

POST /deviceManagement/windowsAutopilotDeploymentProfiles/{windowsAutopilotDeploymentProfileId}/assign
POST /deviceManagement/windowsAutopilotDeviceIdentities/{windowsAutopilotDeviceIdentityId}/deploymentProfile/assign
POST /deviceManagement/windowsAutopilotDeviceIdentities/{windowsAutopilotDeviceIdentityId}/intendedDeploymentProfile/assign

请求标头

标头
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
接受 application/json

请求正文

在请求正文中,提供参数的 JSON 表示形式。

下表显示了可用于此操作的参数。

属性 类型 说明
deviceIds String collection

响应

如果成功,此操作返回 204 No Content 响应代码。

示例

请求

下面是一个请求示例。

POST https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles/{windowsAutopilotDeploymentProfileId}/assign

Content-type: application/json
Content-length: 51

{
  "deviceIds": [
    "Device Ids value"
  ]
}

响应

下面是一个响应示例。 注意:为简洁起见,可能会截断此处显示的响应对象。 将从实际调用中返回所有属性。

HTTP/1.1 204 No Content