PATCH https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/userSettings/b0c2d35f-3385-46c8-a6f5-6c3dfad7ffff
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPcUserSetting",
"displayName": "Example",
"selfServiceEnabled": true,
"restorePointSetting": {
"frequencyInHours": 16,
"frequencyType": "sixteenHours",
"userRestoreEnabled": true
},
"localAdminEnabled": false,
"resetEnabled": true
}
// 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 = true,
RestorePointSetting = new CloudPcRestorePointSetting
{
FrequencyInHours = 16,
FrequencyType = CloudPcRestorePointFrequencyType.SixteenHours,
UserRestoreEnabled = true,
},
LocalAdminEnabled = false,
ResetEnabled = 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["{cloudPcUserSetting-id}"].PatchAsync(requestBody);
mgc-beta device-management virtual-endpoint user-settings patch --cloud-pc-user-setting-id {cloudPcUserSetting-id} --body '{\
"@odata.type": "#microsoft.graph.cloudPcUserSetting",\
"displayName": "Example",\
"selfServiceEnabled": true,\
"restorePointSetting": {\
"frequencyInHours": 16,\
"frequencyType": "sixteenHours",\
"userRestoreEnabled": true\
},\
"localAdminEnabled": false,\
"resetEnabled": true\
}\
'
// 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 := true
requestBody.SetSelfServiceEnabled(&selfServiceEnabled)
restorePointSetting := graphmodels.NewCloudPcRestorePointSetting()
frequencyInHours := int32(16)
restorePointSetting.SetFrequencyInHours(&frequencyInHours)
frequencyType := graphmodels.SIXTEENHOURS_CLOUDPCRESTOREPOINTFREQUENCYTYPE
restorePointSetting.SetFrequencyType(&frequencyType)
userRestoreEnabled := true
restorePointSetting.SetUserRestoreEnabled(&userRestoreEnabled)
requestBody.SetRestorePointSetting(restorePointSetting)
localAdminEnabled := false
requestBody.SetLocalAdminEnabled(&localAdminEnabled)
resetEnabled := true
requestBody.SetResetEnabled(&resetEnabled)
// 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().ByCloudPcUserSettingId("cloudPcUserSetting-id").Patch(context.Background(), requestBody, nil)
// 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(true);
CloudPcRestorePointSetting restorePointSetting = new CloudPcRestorePointSetting();
restorePointSetting.setFrequencyInHours(16);
restorePointSetting.setFrequencyType(CloudPcRestorePointFrequencyType.SixteenHours);
restorePointSetting.setUserRestoreEnabled(true);
cloudPcUserSetting.setRestorePointSetting(restorePointSetting);
cloudPcUserSetting.setLocalAdminEnabled(false);
cloudPcUserSetting.setResetEnabled(true);
CloudPcUserSetting result = graphClient.deviceManagement().virtualEndpoint().userSettings().byCloudPcUserSettingId("{cloudPcUserSetting-id}").patch(cloudPcUserSetting);
const options = {
authProvider,
};
const client = Client.init(options);
const cloudPcUserSetting = {
'@odata.type': '#microsoft.graph.cloudPcUserSetting',
displayName: 'Example',
selfServiceEnabled: true,
restorePointSetting: {
frequencyInHours: 16,
frequencyType: 'sixteenHours',
userRestoreEnabled: true
},
localAdminEnabled: false,
resetEnabled: true
};
await client.api('/deviceManagement/virtualEndpoint/userSettings/b0c2d35f-3385-46c8-a6f5-6c3dfad7ffff')
.version('beta')
.update(cloudPcUserSetting);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CloudPcUserSetting;
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(true);
$restorePointSetting = new CloudPcRestorePointSetting();
$restorePointSetting->setFrequencyInHours(16);
$restorePointSetting->setFrequencyType(new CloudPcRestorePointFrequencyType('sixteenHours'));
$restorePointSetting->setUserRestoreEnabled(true);
$requestBody->setRestorePointSetting($restorePointSetting);
$requestBody->setLocalAdminEnabled(false);
$requestBody->setResetEnabled(true);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->userSettings()->byCloudPcUserSettingId('cloudPcUserSetting-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.cloudPcUserSetting"
displayName = "Example"
selfServiceEnabled = $true
restorePointSetting = @{
frequencyInHours = 16
frequencyType = "sixteenHours"
userRestoreEnabled = $true
}
localAdminEnabled = $false
resetEnabled = $true
}
Update-MgBetaDeviceManagementVirtualEndpointUserSetting -CloudPcUserSettingId $cloudPcUserSettingId -BodyParameter $params
# 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_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 = True,
restore_point_setting = CloudPcRestorePointSetting(
frequency_in_hours = 16,
frequency_type = CloudPcRestorePointFrequencyType.SixteenHours,
user_restore_enabled = True,
),
local_admin_enabled = False,
reset_enabled = True,
)
result = await graph_client.device_management.virtual_endpoint.user_settings.by_cloud_pc_user_setting_id('cloudPcUserSetting-id').patch(request_body)