Namespace: microsoft.graph
Update the properties of a cloudPcProvisioningPolicy 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
PATCH /deviceManagement/virtualEndpoint/provisioningPolicies/{id}
Request body
In the request body, supply a JSON representation of the cloudPcProvisioningPolicy object.
The following table shows the properties that can be updated for the cloudPcProvisioningPolicy.
Property |
Type |
Description |
autopatch |
cloudPcProvisioningPolicyAutopatch |
Indicates the Windows Autopatch settings for Cloud PCs using this provisioning policy. The settings take effect when the tenant enrolls in Autopatch and the managedType of the microsoftManagedDesktop property is set as starterManaged . |
cloudPcNamingTemplate |
String |
The template used to name Cloud PCs provisioned using this policy. The template can contain custom text and replacement tokens, including %USERNAME:x% and %RAND:x% , which represent the user's name and a randomly generated number, respectively. For example, CPC-%USERNAME:4%-%RAND:5% means that the name of the Cloud PC starts with CPC- , followed by a four-character username, a - character, and then five random characters. The total length of the text generated by the template can't exceed 15 characters. Supports $filter , $select , and $orderby . |
description |
String |
The provisioning policy description. |
displayName |
String |
The display name for the provisioning policy. |
domainJoinConfigurations |
cloudPcDomainJoinConfiguration collection |
Specifies a list ordered by priority on how Cloud PCs join Microsoft Entra ID. |
enableSingleSignOn |
Boolean |
True if the provisioned Cloud PC can be accessed by single sign-on. False indicates that the provisioned Cloud PC doesn't support this feature. The default value is false . Windows 365 users can use single sign-on to authenticate to Microsoft Entra ID with passwordless options (for example, FIDO keys) to access their Cloud PC. Optional. |
imageDisplayName |
String |
The display name for the OS image you're provisioning. |
imageId |
String |
The ID of the OS image you want to provision on Cloud PCs. The format for a gallery type image is: {publisher_offer_sku}. Supported values for each of the parameters are as follows: - publisher:
Microsoftwindowsdesktop . - offer:
windows-ent-cpc . - sku:
21h1-ent-cpc-m365 , 21h1-ent-cpc-os , 20h2-ent-cpc-m365 , 20h2-ent-cpc-os , 20h1-ent-cpc-m365 , 20h1-ent-cpc-os , 19h2-ent-cpc-m365 , and 19h2-ent-cpc-os .
|
imageType |
cloudPcProvisioningPolicyImageType |
The type of OS image (custom or gallery) you want to provision on Cloud PCs. Possible values are: gallery , custom , unknownFutureValue . |
microsoftManagedDesktop |
microsoftManagedDesktop |
The specific settings to microsoftManagedDesktop that enables Microsoft Managed Desktop customers to get device managed experience for Cloud PC. To enable microsoftManagedDesktop to provide more value, an admin needs to specify certain settings in it. Supports $filter , $select , and $orderBy . |
windowsSetting |
cloudPcWindowsSetting |
Indicates a specific Windows setting to configure during the creation of Cloud PCs for this provisioning policy. Supports $select . |
Response
If successful, this method returns a 204 No Content
response code.
Examples
Request
The following example shows a request.
PATCH https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/provisioningPolicies/1d164206-bf41-4fd2-8424-a3192d39ffff
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",
"displayName": "HR provisioning policy",
"description": "Provisioning policy for India HR employees",
"microsoftManagedDesktop": {
"managedType": "starterManaged",
"profile": null
},
"autopatch": {
"autopatchGroupId": "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new CloudPcProvisioningPolicy
{
OdataType = "#microsoft.graph.cloudPcProvisioningPolicy",
DisplayName = "HR provisioning policy",
Description = "Provisioning policy for India HR employees",
MicrosoftManagedDesktop = new MicrosoftManagedDesktop
{
ManagedType = MicrosoftManagedDesktopType.StarterManaged,
Profile = null,
},
Autopatch = new CloudPcProvisioningPolicyAutopatch
{
AutopatchGroupId = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb",
},
};
// 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.ProvisioningPolicies["{cloudPcProvisioningPolicy-id}"].PatchAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc device-management virtual-endpoint provisioning-policies patch --cloud-pc-provisioning-policy-id {cloudPcProvisioningPolicy-id} --body '{\
"@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",\
"displayName": "HR provisioning policy",\
"description": "Provisioning policy for India HR employees",\
"microsoftManagedDesktop": {\
"managedType": "starterManaged",\
"profile": null\
},\
"autopatch": {\
"autopatchGroupId": "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"\
}\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCloudPcProvisioningPolicy()
displayName := "HR provisioning policy"
requestBody.SetDisplayName(&displayName)
description := "Provisioning policy for India HR employees"
requestBody.SetDescription(&description)
microsoftManagedDesktop := graphmodels.NewMicrosoftManagedDesktop()
managedType := graphmodels.STARTERMANAGED_MICROSOFTMANAGEDDESKTOPTYPE
microsoftManagedDesktop.SetManagedType(&managedType)
profile := null
microsoftManagedDesktop.SetProfile(&profile)
requestBody.SetMicrosoftManagedDesktop(microsoftManagedDesktop)
autopatch := graphmodels.NewCloudPcProvisioningPolicyAutopatch()
autopatchGroupId := "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
autopatch.SetAutopatchGroupId(&autopatchGroupId)
requestBody.SetAutopatch(autopatch)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
provisioningPolicies, err := graphClient.DeviceManagement().VirtualEndpoint().ProvisioningPolicies().ByCloudPcProvisioningPolicyId("cloudPcProvisioningPolicy-id").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPcProvisioningPolicy cloudPcProvisioningPolicy = new CloudPcProvisioningPolicy();
cloudPcProvisioningPolicy.setOdataType("#microsoft.graph.cloudPcProvisioningPolicy");
cloudPcProvisioningPolicy.setDisplayName("HR provisioning policy");
cloudPcProvisioningPolicy.setDescription("Provisioning policy for India HR employees");
MicrosoftManagedDesktop microsoftManagedDesktop = new MicrosoftManagedDesktop();
microsoftManagedDesktop.setManagedType(MicrosoftManagedDesktopType.StarterManaged);
microsoftManagedDesktop.setProfile(null);
cloudPcProvisioningPolicy.setMicrosoftManagedDesktop(microsoftManagedDesktop);
CloudPcProvisioningPolicyAutopatch autopatch = new CloudPcProvisioningPolicyAutopatch();
autopatch.setAutopatchGroupId("91197a0b-3a74-408d-ba88-bce3fdc4e5eb");
cloudPcProvisioningPolicy.setAutopatch(autopatch);
CloudPcProvisioningPolicy result = graphClient.deviceManagement().virtualEndpoint().provisioningPolicies().byCloudPcProvisioningPolicyId("{cloudPcProvisioningPolicy-id}").patch(cloudPcProvisioningPolicy);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const cloudPcProvisioningPolicy = {
'@odata.type': '#microsoft.graph.cloudPcProvisioningPolicy',
displayName: 'HR provisioning policy',
description: 'Provisioning policy for India HR employees',
microsoftManagedDesktop: {
managedType: 'starterManaged',
profile: null
},
autopatch: {
autopatchGroupId: '91197a0b-3a74-408d-ba88-bce3fdc4e5eb'
}
};
await client.api('/deviceManagement/virtualEndpoint/provisioningPolicies/1d164206-bf41-4fd2-8424-a3192d39ffff')
.update(cloudPcProvisioningPolicy);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\CloudPcProvisioningPolicy;
use Microsoft\Graph\Generated\Models\MicrosoftManagedDesktop;
use Microsoft\Graph\Generated\Models\MicrosoftManagedDesktopType;
use Microsoft\Graph\Generated\Models\CloudPcProvisioningPolicyAutopatch;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CloudPcProvisioningPolicy();
$requestBody->setOdataType('#microsoft.graph.cloudPcProvisioningPolicy');
$requestBody->setDisplayName('HR provisioning policy');
$requestBody->setDescription('Provisioning policy for India HR employees');
$microsoftManagedDesktop = new MicrosoftManagedDesktop();
$microsoftManagedDesktop->setManagedType(new MicrosoftManagedDesktopType('starterManaged'));
$microsoftManagedDesktop->setProfile(null);
$requestBody->setMicrosoftManagedDesktop($microsoftManagedDesktop);
$autopatch = new CloudPcProvisioningPolicyAutopatch();
$autopatch->setAutopatchGroupId('91197a0b-3a74-408d-ba88-bce3fdc4e5eb');
$requestBody->setAutopatch($autopatch);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->provisioningPolicies()->byCloudPcProvisioningPolicyId('cloudPcProvisioningPolicy-id')->patch($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.cloudPcProvisioningPolicy"
displayName = "HR provisioning policy"
description = "Provisioning policy for India HR employees"
microsoftManagedDesktop = @{
managedType = "starterManaged"
profile = $null
}
autopatch = @{
autopatchGroupId = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
}
}
Update-MgDeviceManagementVirtualEndpointProvisioningPolicy -CloudPcProvisioningPolicyId $cloudPcProvisioningPolicyId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.cloud_pc_provisioning_policy import CloudPcProvisioningPolicy
from msgraph.generated.models.microsoft_managed_desktop import MicrosoftManagedDesktop
from msgraph.generated.models.microsoft_managed_desktop_type import MicrosoftManagedDesktopType
from msgraph.generated.models.cloud_pc_provisioning_policy_autopatch import CloudPcProvisioningPolicyAutopatch
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = CloudPcProvisioningPolicy(
odata_type = "#microsoft.graph.cloudPcProvisioningPolicy",
display_name = "HR provisioning policy",
description = "Provisioning policy for India HR employees",
microsoft_managed_desktop = MicrosoftManagedDesktop(
managed_type = MicrosoftManagedDesktopType.StarterManaged,
profile = None,
),
autopatch = CloudPcProvisioningPolicyAutopatch(
autopatch_group_id = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb",
),
)
result = await graph_client.device_management.virtual_endpoint.provisioning_policies.by_cloud_pc_provisioning_policy_id('cloudPcProvisioningPolicy-id').patch(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
The following example shows the response.
HTTP/1.1 204 No Content