POST https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/provisioningPolicies
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",
"description": "Description value",
"displayName": "Display Name value",
"domainJoinConfigurations": [
{
"onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff",
"domainJoinType": "hybridAzureADJoin"
},
{
"onPremisesConnectionId": "26e16c71-f210-438b-88ac-d481ccafffff",
"domainJoinType": "hybridAzureADJoin"
}
],
"id": "1d164206-bf41-4fd2-8424-a3192d39ffff",
"enableSingleSignOn": true,
"imageDisplayName": "Windows-10 19h1-evd",
"imageId": "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
"imageType":"gallery",
"windowsSetting": {
"locale": "en-US"
},
"provisioningType": "dedicated"
}
// 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",
Description = "Description value",
DisplayName = "Display Name value",
DomainJoinConfigurations = new List<CloudPcDomainJoinConfiguration>
{
new CloudPcDomainJoinConfiguration
{
OnPremisesConnectionId = "16ee6c71-fc10-438b-88ac-daa1ccafffff",
DomainJoinType = CloudPcDomainJoinType.HybridAzureADJoin,
},
new CloudPcDomainJoinConfiguration
{
OnPremisesConnectionId = "26e16c71-f210-438b-88ac-d481ccafffff",
DomainJoinType = CloudPcDomainJoinType.HybridAzureADJoin,
},
},
Id = "1d164206-bf41-4fd2-8424-a3192d39ffff",
EnableSingleSignOn = true,
ImageDisplayName = "Windows-10 19h1-evd",
ImageId = "MicrosoftWindowsDesktop_Windows-10_19h1-evd",
ImageType = CloudPcProvisioningPolicyImageType.Gallery,
WindowsSetting = new CloudPcWindowsSetting
{
Locale = "en-US",
},
ProvisioningType = CloudPcProvisioningType.Dedicated,
};
// 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);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc device-management virtual-endpoint provisioning-policies create --body '{\
"@odata.type": "#microsoft.graph.cloudPcProvisioningPolicy",\
"description": "Description value",\
"displayName": "Display Name value",\
"domainJoinConfigurations": [\
{\
"onPremisesConnectionId": "16ee6c71-fc10-438b-88ac-daa1ccafffff",\
"domainJoinType": "hybridAzureADJoin"\
},\
{\
"onPremisesConnectionId": "26e16c71-f210-438b-88ac-d481ccafffff",\
"domainJoinType": "hybridAzureADJoin"\
}\
],\
"id": "1d164206-bf41-4fd2-8424-a3192d39ffff",\
"enableSingleSignOn": true,\
"imageDisplayName": "Windows-10 19h1-evd",\
"imageId": "MicrosoftWindowsDesktop_Windows-10_19h1-evd",\
"imageType":"gallery",\
"windowsSetting": {\
"locale": "en-US"\
},\
"provisioningType": "dedicated"\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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()
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)
domainJoinType := graphmodels.HYBRIDAZUREADJOIN_CLOUDPCDOMAINJOINTYPE
cloudPcDomainJoinConfiguration.SetDomainJoinType(&domainJoinType)
cloudPcDomainJoinConfiguration1 := graphmodels.NewCloudPcDomainJoinConfiguration()
onPremisesConnectionId := "26e16c71-f210-438b-88ac-d481ccafffff"
cloudPcDomainJoinConfiguration1.SetOnPremisesConnectionId(&onPremisesConnectionId)
domainJoinType := graphmodels.HYBRIDAZUREADJOIN_CLOUDPCDOMAINJOINTYPE
cloudPcDomainJoinConfiguration1.SetDomainJoinType(&domainJoinType)
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)
windowsSetting := graphmodels.NewCloudPcWindowsSetting()
locale := "en-US"
windowsSetting.SetLocale(&locale)
requestBody.SetWindowsSetting(windowsSetting)
provisioningType := graphmodels.DEDICATED_CLOUDPCPROVISIONINGTYPE
requestBody.SetProvisioningType(&provisioningType)
// 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)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// 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.setDomainJoinType(CloudPcDomainJoinType.HybridAzureADJoin);
domainJoinConfigurations.add(cloudPcDomainJoinConfiguration);
CloudPcDomainJoinConfiguration cloudPcDomainJoinConfiguration1 = new CloudPcDomainJoinConfiguration();
cloudPcDomainJoinConfiguration1.setOnPremisesConnectionId("26e16c71-f210-438b-88ac-d481ccafffff");
cloudPcDomainJoinConfiguration1.setDomainJoinType(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);
CloudPcWindowsSetting windowsSetting = new CloudPcWindowsSetting();
windowsSetting.setLocale("en-US");
cloudPcProvisioningPolicy.setWindowsSetting(windowsSetting);
cloudPcProvisioningPolicy.setProvisioningType(CloudPcProvisioningType.Dedicated);
CloudPcProvisioningPolicy result = graphClient.deviceManagement().virtualEndpoint().provisioningPolicies().post(cloudPcProvisioningPolicy);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const cloudPcProvisioningPolicy = {
'@odata.type': '#microsoft.graph.cloudPcProvisioningPolicy',
description: 'Description value',
displayName: 'Display Name value',
domainJoinConfigurations: [
{
onPremisesConnectionId: '16ee6c71-fc10-438b-88ac-daa1ccafffff',
domainJoinType: 'hybridAzureADJoin'
},
{
onPremisesConnectionId: '26e16c71-f210-438b-88ac-d481ccafffff',
domainJoinType: 'hybridAzureADJoin'
}
],
id: '1d164206-bf41-4fd2-8424-a3192d39ffff',
enableSingleSignOn: true,
imageDisplayName: 'Windows-10 19h1-evd',
imageId: 'MicrosoftWindowsDesktop_Windows-10_19h1-evd',
imageType: 'gallery',
windowsSetting: {
locale: 'en-US'
},
provisioningType: 'dedicated'
};
await client.api('/deviceManagement/virtualEndpoint/provisioningPolicies')
.post(cloudPcProvisioningPolicy);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\CloudPcProvisioningPolicy;
use Microsoft\Graph\Generated\Models\CloudPcDomainJoinConfiguration;
use Microsoft\Graph\Generated\Models\CloudPcDomainJoinType;
use Microsoft\Graph\Generated\Models\CloudPcProvisioningPolicyImageType;
use Microsoft\Graph\Generated\Models\CloudPcWindowsSetting;
use Microsoft\Graph\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->setDomainJoinType(new CloudPcDomainJoinType('hybridAzureADJoin'));
$domainJoinConfigurationsArray []= $domainJoinConfigurationsCloudPcDomainJoinConfiguration1;
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2 = new CloudPcDomainJoinConfiguration();
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2->setOnPremisesConnectionId('26e16c71-f210-438b-88ac-d481ccafffff');
$domainJoinConfigurationsCloudPcDomainJoinConfiguration2->setDomainJoinType(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'));
$windowsSetting = new CloudPcWindowsSetting();
$windowsSetting->setLocale('en-US');
$requestBody->setWindowsSetting($windowsSetting);
$requestBody->setProvisioningType(new CloudPcProvisioningType('dedicated'));
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->provisioningPolicies()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.cloudPcProvisioningPolicy"
description = "Description value"
displayName = "Display Name value"
domainJoinConfigurations = @(
@{
onPremisesConnectionId = "16ee6c71-fc10-438b-88ac-daa1ccafffff"
domainJoinType = "hybridAzureADJoin"
}
@{
onPremisesConnectionId = "26e16c71-f210-438b-88ac-d481ccafffff"
domainJoinType = "hybridAzureADJoin"
}
)
id = "1d164206-bf41-4fd2-8424-a3192d39ffff"
enableSingleSignOn = $true
imageDisplayName = "Windows-10 19h1-evd"
imageId = "MicrosoftWindowsDesktop_Windows-10_19h1-evd"
imageType = "gallery"
windowsSetting = @{
locale = "en-US"
}
provisioningType = "dedicated"
}
New-MgDeviceManagementVirtualEndpointProvisioningPolicy -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# 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.cloud_pc_domain_join_configuration import CloudPcDomainJoinConfiguration
from msgraph.generated.models.cloud_pc_domain_join_type import CloudPcDomainJoinType
from msgraph.generated.models.cloud_pc_provisioning_policy_image_type import CloudPcProvisioningPolicyImageType
from msgraph.generated.models.cloud_pc_windows_setting import CloudPcWindowsSetting
from msgraph.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",
domain_join_type = CloudPcDomainJoinType.HybridAzureADJoin,
),
CloudPcDomainJoinConfiguration(
on_premises_connection_id = "26e16c71-f210-438b-88ac-d481ccafffff",
domain_join_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_setting = CloudPcWindowsSetting(
locale = "en-US",
),
provisioning_type = CloudPcProvisioningType.Dedicated,
)
result = await graph_client.device_management.virtual_endpoint.provisioning_policies.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。