POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/provisioningPolicies
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",
"description": "Description value",
"displayName": "Display Name value",
"domainJoinConfiguration": {
"domainJoinType": "hybridAzureADJoin",
"onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff"
},
"domainJoinConfigurations": [
{
"onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff",
"type": "hybridAzureADJoin"
},
{
"onPremisesConnectionId": "26e16c71-f210-438b-88ac-d481ccafffff",
"type": "hybridAzureADJoin"
}
],
"id": "1d164206-bf41-4fd2-8424-a3192d39ffff",
"enableSingleSignOn": true,
"imageDisplayName": "Windows-10 19h1-evd",
"imageId": "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
"imageType":"gallery",
"onPremisesConnectionId": "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
"windowsSettings": {
"language": "en-US"
},
"windowsSetting": {
"locale": "en-US"
},
"provisioningType": "dedicated"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new CloudPcProvisioningPolicy
{
OdataType = "#microsoft.graph.cloudPcProvisioningPolicy",
Description = "Description value",
DisplayName = "Display Name value",
DomainJoinConfigurations = new List<CloudPcDomainJoinConfiguration>
{
new CloudPcDomainJoinConfiguration
{
OnPremisesConnectionId = "16ee6c71-fc10-438b-88ac-daa1ccafffff",
Type = CloudPcDomainJoinType.HybridAzureADJoin,
},
new CloudPcDomainJoinConfiguration
{
OnPremisesConnectionId = "26e16c71-f210-438b-88ac-d481ccafffff",
Type = CloudPcDomainJoinType.HybridAzureADJoin,
},
},
Id = "1d164206-bf41-4fd2-8424-a3192d39ffff",
EnableSingleSignOn = true,
ImageDisplayName = "Windows-10 19h1-evd",
ImageId = "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
ImageType = CloudPcProvisioningPolicyImageType.Gallery,
WindowsSettings = new CloudPcWindowsSettings
{
Language = "en-US",
},
WindowsSetting = new CloudPcWindowsSetting
{
Locale = "en-US",
},
ProvisioningType = CloudPcProvisioningType.Dedicated,
AdditionalData = new Dictionary<string, object>
{
{
"domainJoinConfiguration" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"domainJoinType", new UntypedString("hybridAzureADJoin")
},
{
"onPremisesConnectionId", new UntypedString("16ee6c71-fc10-438b-88ac-daa1ccafffff")
},
})
},
{
"onPremisesConnectionId" , "4e47d0f6-6f77-44f0-8893-c0fe1701ffff"
},
},
};
// 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.PostAsync(requestBody);
mgc-beta device-management virtual-endpoint provisioning-policies create --body '{\
"@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",\
"description": "Description value",\
"displayName": "Display Name value",\
"domainJoinConfiguration": {\
"domainJoinType": "hybridAzureADJoin",\
"onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff"\
},\
"domainJoinConfigurations": [\
{\
"onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff",\
"type": "hybridAzureADJoin"\
},\
{\
"onPremisesConnectionId": "26e16c71-f210-438b-88ac-d481ccafffff",\
"type": "hybridAzureADJoin"\
}\
],\
"id": "1d164206-bf41-4fd2-8424-a3192d39ffff",\
"enableSingleSignOn": true,\
"imageDisplayName": "Windows-10 19h1-evd",\
"imageId": "MicrosoftWindowsDesktop_Windows-10_19h1-evd",\
"imageType":"gallery",\
"onPremisesConnectionId": "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",\
"windowsSettings": {\
"language": "en-US"\
},\
"windowsSetting": {\
"locale": "en-US"\
},\
"provisioningType": "dedicated"\
}\
'
// 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.NewCloudPcProvisioningPolicy()
description := "Description value"
requestBody.SetDescription(&description)
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
cloudPcDomainJoinConfiguration := graphmodels.NewCloudPcDomainJoinConfiguration()
onPremisesConnectionId := "16ee6c71-fc10-438b-88ac-daa1ccafffff"
cloudPcDomainJoinConfiguration.SetOnPremisesConnectionId(&onPremisesConnectionId)
type := graphmodels.HYBRIDAZUREADJOIN_CLOUDPCDOMAINJOINTYPE
cloudPcDomainJoinConfiguration.SetType(&type)
cloudPcDomainJoinConfiguration1 := graphmodels.NewCloudPcDomainJoinConfiguration()
onPremisesConnectionId := "26e16c71-f210-438b-88ac-d481ccafffff"
cloudPcDomainJoinConfiguration1.SetOnPremisesConnectionId(&onPremisesConnectionId)
type := graphmodels.HYBRIDAZUREADJOIN_CLOUDPCDOMAINJOINTYPE
cloudPcDomainJoinConfiguration1.SetType(&type)
domainJoinConfigurations := []graphmodels.CloudPcDomainJoinConfigurationable {
cloudPcDomainJoinConfiguration,
cloudPcDomainJoinConfiguration1,
}
requestBody.SetDomainJoinConfigurations(domainJoinConfigurations)
id := "1d164206-bf41-4fd2-8424-a3192d39ffff"
requestBody.SetId(&id)
enableSingleSignOn := true
requestBody.SetEnableSingleSignOn(&enableSingleSignOn)
imageDisplayName := "Windows-10 19h1-evd"
requestBody.SetImageDisplayName(&imageDisplayName)
imageId := "MicrosoftWindowsDesktop_Windows-10_19h1-evd"
requestBody.SetImageId(&imageId)
imageType := graphmodels.GALLERY_CLOUDPCPROVISIONINGPOLICYIMAGETYPE
requestBody.SetImageType(&imageType)
windowsSettings := graphmodels.NewCloudPcWindowsSettings()
language := "en-US"
windowsSettings.SetLanguage(&language)
requestBody.SetWindowsSettings(windowsSettings)
windowsSetting := graphmodels.NewCloudPcWindowsSetting()
locale := "en-US"
windowsSetting.SetLocale(&locale)
requestBody.SetWindowsSetting(windowsSetting)
provisioningType := graphmodels.DEDICATED_CLOUDPCPROVISIONINGTYPE
requestBody.SetProvisioningType(&provisioningType)
additionalData := map[string]interface{}{
domainJoinConfiguration := graph.New()
domainJoinType := "hybridAzureADJoin"
domainJoinConfiguration.SetDomainJoinType(&domainJoinType)
onPremisesConnectionId := "16ee6c71-fc10-438b-88ac-daa1ccafffff"
domainJoinConfiguration.SetOnPremisesConnectionId(&onPremisesConnectionId)
requestBody.SetDomainJoinConfiguration(domainJoinConfiguration)
"onPremisesConnectionId" : "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
}
requestBody.SetAdditionalData(additionalData)
// 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().Post(context.Background(), requestBody, nil)
// 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.setDescription("Description value");
cloudPcProvisioningPolicy.setDisplayName("Display Name value");
LinkedList<CloudPcDomainJoinConfiguration> domainJoinConfigurations = new LinkedList<CloudPcDomainJoinConfiguration>();
CloudPcDomainJoinConfiguration cloudPcDomainJoinConfiguration = new CloudPcDomainJoinConfiguration();
cloudPcDomainJoinConfiguration.setOnPremisesConnectionId("16ee6c71-fc10-438b-88ac-daa1ccafffff");
cloudPcDomainJoinConfiguration.setType(CloudPcDomainJoinType.HybridAzureADJoin);
domainJoinConfigurations.add(cloudPcDomainJoinConfiguration);
CloudPcDomainJoinConfiguration cloudPcDomainJoinConfiguration1 = new CloudPcDomainJoinConfiguration();
cloudPcDomainJoinConfiguration1.setOnPremisesConnectionId("26e16c71-f210-438b-88ac-d481ccafffff");
cloudPcDomainJoinConfiguration1.setType(CloudPcDomainJoinType.HybridAzureADJoin);
domainJoinConfigurations.add(cloudPcDomainJoinConfiguration1);
cloudPcProvisioningPolicy.setDomainJoinConfigurations(domainJoinConfigurations);
cloudPcProvisioningPolicy.setId("1d164206-bf41-4fd2-8424-a3192d39ffff");
cloudPcProvisioningPolicy.setEnableSingleSignOn(true);
cloudPcProvisioningPolicy.setImageDisplayName("Windows-10 19h1-evd");
cloudPcProvisioningPolicy.setImageId("MicrosoftWindowsDesktop_Windows-10_19h1-evd");
cloudPcProvisioningPolicy.setImageType(CloudPcProvisioningPolicyImageType.Gallery);
CloudPcWindowsSettings windowsSettings = new CloudPcWindowsSettings();
windowsSettings.setLanguage("en-US");
cloudPcProvisioningPolicy.setWindowsSettings(windowsSettings);
CloudPcWindowsSetting windowsSetting = new CloudPcWindowsSetting();
windowsSetting.setLocale("en-US");
cloudPcProvisioningPolicy.setWindowsSetting(windowsSetting);
cloudPcProvisioningPolicy.setProvisioningType(CloudPcProvisioningType.Dedicated);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
domainJoinConfiguration = new ();
domainJoinConfiguration.setDomainJoinType("hybridAzureADJoin");
domainJoinConfiguration.setOnPremisesConnectionId("16ee6c71-fc10-438b-88ac-daa1ccafffff");
additionalData.put("domainJoinConfiguration", domainJoinConfiguration);
additionalData.put("onPremisesConnectionId", "4e47d0f6-6f77-44f0-8893-c0fe1701ffff");
cloudPcProvisioningPolicy.setAdditionalData(additionalData);
CloudPcProvisioningPolicy result = graphClient.deviceManagement().virtualEndpoint().provisioningPolicies().post(cloudPcProvisioningPolicy);
const options = {
authProvider,
};
const client = Client.init(options);
const cloudPcProvisioningPolicy = {
'@odata.type': '#microsoft.graph.cloudPcProvisioningPolicy',
description: 'Description value',
displayName: 'Display Name value',
domainJoinConfiguration: {
domainJoinType: 'hybridAzureADJoin',
onPremisesConnectionId: '16ee6c71-fc10-438b-88ac-daa1ccafffff'
},
domainJoinConfigurations: [
{
onPremisesConnectionId: '16ee6c71-fc10-438b-88ac-daa1ccafffff',
type: 'hybridAzureADJoin'
},
{
onPremisesConnectionId: '26e16c71-f210-438b-88ac-d481ccafffff',
type: 'hybridAzureADJoin'
}
],
id: '1d164206-bf41-4fd2-8424-a3192d39ffff',
enableSingleSignOn: true,
imageDisplayName: 'Windows-10 19h1-evd',
imageId: 'MicrosoftWindowsDesktop_Windows-10_19h1-evd',
imageType: 'gallery',
onPremisesConnectionId: '4e47d0f6-6f77-44f0-8893-c0fe1701ffff',
windowsSettings: {
language: 'en-US'
},
windowsSetting: {
locale: 'en-US'
},
provisioningType: 'dedicated'
};
await client.api('/deviceManagement/virtualEndpoint/provisioningPolicies')
.version('beta')
.post(cloudPcProvisioningPolicy);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\CloudPcProvisioningPolicy;
use Microsoft\Graph\Beta\Generated\Models\CloudPcDomainJoinConfiguration;
use Microsoft\Graph\Beta\Generated\Models\CloudPcDomainJoinType;
use Microsoft\Graph\Beta\Generated\Models\CloudPcProvisioningPolicyImageType;
use Microsoft\Graph\Beta\Generated\Models\CloudPcWindowsSettings;
use Microsoft\Graph\Beta\Generated\Models\CloudPcWindowsSetting;
use Microsoft\Graph\Beta\Generated\Models\CloudPcProvisioningType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CloudPcProvisioningPolicy();
$requestBody->setOdataType('#microsoft.graph.cloudPcProvisioningPolicy');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration1 = new CloudPcDomainJoinConfiguration();
$domainJoinConfigurationsCloudPcDomainJoinConfiguration1->setOnPremisesConnectionId('16ee6c71-fc10-438b-88ac-daa1ccafffff');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration1->setType(new CloudPcDomainJoinType('hybridAzureADJoin'));
$domainJoinConfigurationsArray []= $domainJoinConfigurationsCloudPcDomainJoinConfiguration1;
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2 = new CloudPcDomainJoinConfiguration();
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2->setOnPremisesConnectionId('26e16c71-f210-438b-88ac-d481ccafffff');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2->setType(new CloudPcDomainJoinType('hybridAzureADJoin'));
$domainJoinConfigurationsArray []= $domainJoinConfigurationsCloudPcDomainJoinConfiguration2;
$requestBody->setDomainJoinConfigurations($domainJoinConfigurationsArray);
$requestBody->setId('1d164206-bf41-4fd2-8424-a3192d39ffff');
$requestBody->setEnableSingleSignOn(true);
$requestBody->setImageDisplayName('Windows-10 19h1-evd');
$requestBody->setImageId('MicrosoftWindowsDesktop_Windows-10_19h1-evd');
$requestBody->setImageType(new CloudPcProvisioningPolicyImageType('gallery'));
$windowsSettings = new CloudPcWindowsSettings();
$windowsSettings->setLanguage('en-US');
$requestBody->setWindowsSettings($windowsSettings);
$windowsSetting = new CloudPcWindowsSetting();
$windowsSetting->setLocale('en-US');
$requestBody->setWindowsSetting($windowsSetting);
$requestBody->setProvisioningType(new CloudPcProvisioningType('dedicated'));
$additionalData = [
'domainJoinConfiguration' => [
'domainJoinType' => 'hybridAzureADJoin',
'onPremisesConnectionId' => '16ee6c71-fc10-438b-88ac-daa1ccafffff',
],
'onPremisesConnectionId' => '4e47d0f6-6f77-44f0-8893-c0fe1701ffff',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->provisioningPolicies()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.cloudPcProvisioningPolicy"
description = "Description value"
displayName = "Display Name value"
domainJoinConfiguration = @{
domainJoinType = "hybridAzureADJoin"
onPremisesConnectionId = "16ee6c71-fc10-438b-88ac-daa1ccafffff"
}
domainJoinConfigurations = @(
@{
onPremisesConnectionId = "16ee6c71-fc10-438b-88ac-daa1ccafffff"
type = "hybridAzureADJoin"
}
@{
onPremisesConnectionId = "26e16c71-f210-438b-88ac-d481ccafffff"
type = "hybridAzureADJoin"
}
)
id = "1d164206-bf41-4fd2-8424-a3192d39ffff"
enableSingleSignOn = $true
imageDisplayName = "Windows-10 19h1-evd"
imageId = "MicrosoftWindowsDesktop_Windows-10_19h1-evd"
imageType = "gallery"
onPremisesConnectionId = "4e47d0f6-6f77-44f0-8893-c0fe1701ffff"
windowsSettings = @{
language = "en-US"
}
windowsSetting = @{
locale = "en-US"
}
provisioningType = "dedicated"
}
New-MgBetaDeviceManagementVirtualEndpointProvisioningPolicy -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_provisioning_policy import CloudPcProvisioningPolicy
from msgraph_beta.generated.models.cloud_pc_domain_join_configuration import CloudPcDomainJoinConfiguration
from msgraph_beta.generated.models.cloud_pc_domain_join_type import CloudPcDomainJoinType
from msgraph_beta.generated.models.cloud_pc_provisioning_policy_image_type import CloudPcProvisioningPolicyImageType
from msgraph_beta.generated.models.cloud_pc_windows_settings import CloudPcWindowsSettings
from msgraph_beta.generated.models.cloud_pc_windows_setting import CloudPcWindowsSetting
from msgraph_beta.generated.models.cloud_pc_provisioning_type import CloudPcProvisioningType
# 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",
description = "Description value",
display_name = "Display Name value",
domain_join_configurations = [
CloudPcDomainJoinConfiguration(
on_premises_connection_id = "16ee6c71-fc10-438b-88ac-daa1ccafffff",
type = CloudPcDomainJoinType.HybridAzureADJoin,
),
CloudPcDomainJoinConfiguration(
on_premises_connection_id = "26e16c71-f210-438b-88ac-d481ccafffff",
type = CloudPcDomainJoinType.HybridAzureADJoin,
),
],
id = "1d164206-bf41-4fd2-8424-a3192d39ffff",
enable_single_sign_on = True,
image_display_name = "Windows-10 19h1-evd",
image_id = "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
image_type = CloudPcProvisioningPolicyImageType.Gallery,
windows_settings = CloudPcWindowsSettings(
language = "en-US",
),
windows_setting = CloudPcWindowsSetting(
locale = "en-US",
),
provisioning_type = CloudPcProvisioningType.Dedicated,
additional_data = {
"domain_join_configuration" : {
"domain_join_type" : "hybridAzureADJoin",
"on_premises_connection_id" : "16ee6c71-fc10-438b-88ac-daa1ccafffff",
},
"on_premises_connection_id" : "4e47d0f6-6f77-44f0-8893-c0fe1701ffff",
}
)
result = await graph_client.device_management.virtual_endpoint.provisioning_policies.post(request_body)