Create cloudPcUserSetting

Namespace: microsoft.graph

Create a new cloudPcUserSetting object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) CloudPC.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application CloudPC.ReadWrite.All Not available.

HTTP request

POST /deviceManagement/virtualEndpoint/userSettings

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the cloudPcUserSetting object.

The following table lists the properties that are required when you create the cloudPcUserSetting.

Property Type Description
displayName String The setting name as it appears in the UI.
lastModifiedDateTime DateTimeOffset The date and time when the setting was last modified. The timestamp type represents the date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. 
localAdminEnabled Boolean To turn on the local admin option, change this setting to true. 
restorePointSetting cloudPcRestorePointSetting Defines how frequently a restore point is created (that is, a snapshot is taken) for users' provisioned Cloud PCs (default is 12 hours), and whether the user is allowed to restore their own Cloud PCs to a backup made at a specific point in time.

Response

If successful, this method returns a 201 Created response code and a cloudPcUserSetting object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/userSettings
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.cloudPcUserSetting",
  "displayName": "Example",
  "localAdminEnabled": true,
  "restorePointSetting": {
    "frequencyType": "sixteenHours",
    "userRestoreEnabled": true
  }
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

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

{
  "@odata.type": "#microsoft.graph.cloudPcUserSetting",
  "id": "556092f8-92f8-5560-f892-6055f8926055",
  "displayName": "Example",
  "localAdminEnabled": true,
  "restorePointSetting": {
    "frequencyType": "sixteenHours",
    "userRestoreEnabled": true
  },
  "lastModifiedDateTime": "2021-02-01T10:29:57Z"
}