APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
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
Indicates cross-region disaster recovery settings for the user's Cloud PC.
displayName
String
The setting name as it appears in the UI.
lastModifiedDateTime
DateTimeOffset
The last date and time the setting was 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.
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.
selfServiceEnabled (deprecated)
Boolean
To turn on the self service option, change this setting to true. The selfServiceEnabled property is deprecated and will stop returning data on December 1, 2023.
Response
If successful, this method returns a 201 Created response code and a cloudPcUserSetting object in the response body.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new CloudPcUserSetting
{
OdataType = "#microsoft.graph.cloudPcUserSetting",
DisplayName = "Example",
SelfServiceEnabled = false,
LocalAdminEnabled = true,
CrossRegionDisasterRecoverySetting = new CloudPcCrossRegionDisasterRecoverySetting
{
CrossRegionDisasterRecoveryEnabled = false,
MaintainCrossRegionRestorePointEnabled = true,
DisasterRecoveryNetworkSetting = new CloudPcDisasterRecoveryNetworkSetting
{
AdditionalData = new Dictionary<string, object>
{
{
"regionName" , "westus"
},
{
"regionGroup" , "usEast"
},
},
},
DisasterRecoveryType = CloudPcDisasterRecoveryType.Premium,
UserInitiatedDisasterRecoveryAllowed = true,
},
RestorePointSetting = new CloudPcRestorePointSetting
{
FrequencyInHours = 16,
FrequencyType = CloudPcRestorePointFrequencyType.SixteenHours,
UserRestoreEnabled = true,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.VirtualEndpoint.UserSettings.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCloudPcUserSetting()
displayName := "Example"
requestBody.SetDisplayName(&displayName)
selfServiceEnabled := false
requestBody.SetSelfServiceEnabled(&selfServiceEnabled)
localAdminEnabled := true
requestBody.SetLocalAdminEnabled(&localAdminEnabled)
crossRegionDisasterRecoverySetting := graphmodels.NewCloudPcCrossRegionDisasterRecoverySetting()
crossRegionDisasterRecoveryEnabled := false
crossRegionDisasterRecoverySetting.SetCrossRegionDisasterRecoveryEnabled(&crossRegionDisasterRecoveryEnabled)
maintainCrossRegionRestorePointEnabled := true
crossRegionDisasterRecoverySetting.SetMaintainCrossRegionRestorePointEnabled(&maintainCrossRegionRestorePointEnabled)
disasterRecoveryNetworkSetting := graphmodels.NewCloudPcDisasterRecoveryNetworkSetting()
additionalData := map[string]interface{}{
"regionName" : "westus",
"regionGroup" : "usEast",
}
disasterRecoveryNetworkSetting.SetAdditionalData(additionalData)
crossRegionDisasterRecoverySetting.SetDisasterRecoveryNetworkSetting(disasterRecoveryNetworkSetting)
disasterRecoveryType := graphmodels.PREMIUM_CLOUDPCDISASTERRECOVERYTYPE
crossRegionDisasterRecoverySetting.SetDisasterRecoveryType(&disasterRecoveryType)
userInitiatedDisasterRecoveryAllowed := true
crossRegionDisasterRecoverySetting.SetUserInitiatedDisasterRecoveryAllowed(&userInitiatedDisasterRecoveryAllowed)
requestBody.SetCrossRegionDisasterRecoverySetting(crossRegionDisasterRecoverySetting)
restorePointSetting := graphmodels.NewCloudPcRestorePointSetting()
frequencyInHours := int32(16)
restorePointSetting.SetFrequencyInHours(&frequencyInHours)
frequencyType := graphmodels.SIXTEENHOURS_CLOUDPCRESTOREPOINTFREQUENCYTYPE
restorePointSetting.SetFrequencyType(&frequencyType)
userRestoreEnabled := true
restorePointSetting.SetUserRestoreEnabled(&userRestoreEnabled)
requestBody.SetRestorePointSetting(restorePointSetting)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
userSettings, err := graphClient.DeviceManagement().VirtualEndpoint().UserSettings().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPcUserSetting cloudPcUserSetting = new CloudPcUserSetting();
cloudPcUserSetting.setOdataType("#microsoft.graph.cloudPcUserSetting");
cloudPcUserSetting.setDisplayName("Example");
cloudPcUserSetting.setSelfServiceEnabled(false);
cloudPcUserSetting.setLocalAdminEnabled(true);
CloudPcCrossRegionDisasterRecoverySetting crossRegionDisasterRecoverySetting = new CloudPcCrossRegionDisasterRecoverySetting();
crossRegionDisasterRecoverySetting.setCrossRegionDisasterRecoveryEnabled(false);
crossRegionDisasterRecoverySetting.setMaintainCrossRegionRestorePointEnabled(true);
CloudPcDisasterRecoveryNetworkSetting disasterRecoveryNetworkSetting = new CloudPcDisasterRecoveryNetworkSetting();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("regionName", "westus");
additionalData.put("regionGroup", "usEast");
disasterRecoveryNetworkSetting.setAdditionalData(additionalData);
crossRegionDisasterRecoverySetting.setDisasterRecoveryNetworkSetting(disasterRecoveryNetworkSetting);
crossRegionDisasterRecoverySetting.setDisasterRecoveryType(CloudPcDisasterRecoveryType.Premium);
crossRegionDisasterRecoverySetting.setUserInitiatedDisasterRecoveryAllowed(true);
cloudPcUserSetting.setCrossRegionDisasterRecoverySetting(crossRegionDisasterRecoverySetting);
CloudPcRestorePointSetting restorePointSetting = new CloudPcRestorePointSetting();
restorePointSetting.setFrequencyInHours(16);
restorePointSetting.setFrequencyType(CloudPcRestorePointFrequencyType.SixteenHours);
restorePointSetting.setUserRestoreEnabled(true);
cloudPcUserSetting.setRestorePointSetting(restorePointSetting);
CloudPcUserSetting result = graphClient.deviceManagement().virtualEndpoint().userSettings().post(cloudPcUserSetting);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CloudPcUserSetting;
use Microsoft\Graph\Beta\Generated\Models\CloudPcCrossRegionDisasterRecoverySetting;
use Microsoft\Graph\Beta\Generated\Models\CloudPcDisasterRecoveryNetworkSetting;
use Microsoft\Graph\Beta\Generated\Models\CloudPcDisasterRecoveryType;
use Microsoft\Graph\Beta\Generated\Models\CloudPcRestorePointSetting;
use Microsoft\Graph\Beta\Generated\Models\CloudPcRestorePointFrequencyType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CloudPcUserSetting();
$requestBody->setOdataType('#microsoft.graph.cloudPcUserSetting');
$requestBody->setDisplayName('Example');
$requestBody->setSelfServiceEnabled(false);
$requestBody->setLocalAdminEnabled(true);
$crossRegionDisasterRecoverySetting = new CloudPcCrossRegionDisasterRecoverySetting();
$crossRegionDisasterRecoverySetting->setCrossRegionDisasterRecoveryEnabled(false);
$crossRegionDisasterRecoverySetting->setMaintainCrossRegionRestorePointEnabled(true);
$crossRegionDisasterRecoverySettingDisasterRecoveryNetworkSetting = new CloudPcDisasterRecoveryNetworkSetting();
$additionalData = [
'regionName' => 'westus',
'regionGroup' => 'usEast',
];
$crossRegionDisasterRecoverySettingDisasterRecoveryNetworkSetting->setAdditionalData($additionalData);
$crossRegionDisasterRecoverySetting->setDisasterRecoveryNetworkSetting($crossRegionDisasterRecoverySettingDisasterRecoveryNetworkSetting);
$crossRegionDisasterRecoverySetting->setDisasterRecoveryType(new CloudPcDisasterRecoveryType('premium'));
$crossRegionDisasterRecoverySetting->setUserInitiatedDisasterRecoveryAllowed(true);
$requestBody->setCrossRegionDisasterRecoverySetting($crossRegionDisasterRecoverySetting);
$restorePointSetting = new CloudPcRestorePointSetting();
$restorePointSetting->setFrequencyInHours(16);
$restorePointSetting->setFrequencyType(new CloudPcRestorePointFrequencyType('sixteenHours'));
$restorePointSetting->setUserRestoreEnabled(true);
$requestBody->setRestorePointSetting($restorePointSetting);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->userSettings()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.cloud_pc_user_setting import CloudPcUserSetting
from msgraph_beta.generated.models.cloud_pc_cross_region_disaster_recovery_setting import CloudPcCrossRegionDisasterRecoverySetting
from msgraph_beta.generated.models.cloud_pc_disaster_recovery_network_setting import CloudPcDisasterRecoveryNetworkSetting
from msgraph_beta.generated.models.cloud_pc_disaster_recovery_type import CloudPcDisasterRecoveryType
from msgraph_beta.generated.models.cloud_pc_restore_point_setting import CloudPcRestorePointSetting
from msgraph_beta.generated.models.cloud_pc_restore_point_frequency_type import CloudPcRestorePointFrequencyType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CloudPcUserSetting(
odata_type = "#microsoft.graph.cloudPcUserSetting",
display_name = "Example",
self_service_enabled = False,
local_admin_enabled = True,
cross_region_disaster_recovery_setting = CloudPcCrossRegionDisasterRecoverySetting(
cross_region_disaster_recovery_enabled = False,
maintain_cross_region_restore_point_enabled = True,
disaster_recovery_network_setting = CloudPcDisasterRecoveryNetworkSetting(
additional_data = {
"region_name" : "westus",
"region_group" : "usEast",
}
),
disaster_recovery_type = CloudPcDisasterRecoveryType.Premium,
user_initiated_disaster_recovery_allowed = True,
),
restore_point_setting = CloudPcRestorePointSetting(
frequency_in_hours = 16,
frequency_type = CloudPcRestorePointFrequencyType.SixteenHours,
user_restore_enabled = True,
),
)
result = await graph_client.device_management.virtual_endpoint.user_settings.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.