命名空间:microsoft.graph
列出租户中的 cloudPC 设备。
此 API 可用于以下国家级云部署。
| 全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
| ✅ |
❌ |
❌ |
❌ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 |
最低特权权限 |
更高特权权限 |
| 委派(工作或学校帐户) |
CloudPC.Read.All |
CloudPC.ReadWrite.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
| 应用程序 |
CloudPC.Read.All |
CloudPC.ReadWrite.All |
HTTP 请求
GET /deviceManagement/virtualEndpoint/cloudPCs
可选的查询参数
此方法支持 $select、 $filter、 $count和 $top OData 查询参数来帮助自定义响应。 若要了解一般信息,请参阅 OData 查询参数。
| 名称 |
说明 |
| Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回响应 200 OK 代码和 cloudPC 对象集合。
示例
示例 1:列出租户中的所有 cloudPC 设备
以下示例演示如何获取租户中所有 cloudPC 设备的列表。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/cloudPCs
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.VirtualEndpoint.CloudPCs.GetAsync();
有关如何将 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"
//other-imports
)
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=go
cloudPCs, err := graphClient.DeviceManagement().VirtualEndpoint().CloudPCs().Get(context.Background(), nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPCCollectionResponse result = graphClient.deviceManagement().virtualEndpoint().cloudPCs().get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let cloudPCs = await client.api('/deviceManagement/virtualEndpoint/cloudPCs')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->cloudPCs()->get()->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.DeviceManagement.Administration
Get-MgDeviceManagementVirtualEndpointCloudPc
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.device_management.virtual_endpoint.cloud_p_cs.get()
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.cloudPC",
"aadDeviceId": "f5ff445f-7488-40f8-8ab9-ee784a9c1f33",
"id": "662009bc-7732-4f6f-8726-25883518ffff",
"displayName": "Demo-1",
"imageDisplayName": "Windows-10 19h1-evd",
"managedDeviceId": "bdc8e6dd-0455-4412-83d9-c818664fffff",
"managedDeviceName": "A00002GI001",
"provisioningPolicyId": "7ed725ad-0a00-4117-b557-d965c373ffff",
"provisioningPolicyName": "HR provisioning policy",
"onPremisesConnectionName": "Azure network connection for HR",
"servicePlanId": "dbb9148c-ff83-4a4c-8d7f-28752e93ffff",
"servicePlanName": "lite",
"userPrincipalName": "dujanjic@contoso.com",
"lastModifiedDateTime": "2020-11-03T10:29:57Z",
"gracePeriodEndDateTime": "2020-11-010T20:00:34Z",
"provisioningType": "dedicated"
}
]
}
示例 2:获取租户中前两个 cloudPC 设备
以下示例演示如何使用 $top 查询参数获取租户中前两个 cloudPC 设备。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/cloudPCs?$top=2
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.VirtualEndpoint.CloudPCs.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Top = 2;
});
有关如何将 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"
graphdevicemanagement "github.com/microsoftgraph/msgraph-sdk-go/devicemanagement"
//other-imports
)
requestTop := int32(2)
requestParameters := &graphdevicemanagement.VirtualEndpointCloudPCsRequestBuilderGetQueryParameters{
Top: &requestTop,
}
configuration := &graphdevicemanagement.VirtualEndpointCloudPCsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=go
cloudPCs, err := graphClient.DeviceManagement().VirtualEndpoint().CloudPCs().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPCCollectionResponse result = graphClient.deviceManagement().virtualEndpoint().cloudPCs().get(requestConfiguration -> {
requestConfiguration.queryParameters.top = 2;
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let cloudPCs = await client.api('/deviceManagement/virtualEndpoint/cloudPCs')
.top(2)
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\DeviceManagement\VirtualEndpoint\CloudPCs\CloudPCsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new CloudPCsRequestBuilderGetRequestConfiguration();
$queryParameters = CloudPCsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->top = 2;
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->cloudPCs()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.DeviceManagement.Administration
Get-MgDeviceManagementVirtualEndpointCloudPc -Top 2
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.device_management.virtual_endpoint.cloud_p_cs.cloud_p_cs_request_builder import CloudPCsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = CloudPCsRequestBuilder.CloudPCsRequestBuilderGetQueryParameters(
top = 2,
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.device_management.virtual_endpoint.cloud_p_cs.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/virtualEndpoint/cloudPCs",
"@odata.count": 200,
"@odata.nextLink": "https://graph.microsoft.com/v1.0/deviceManagement/virtualEndpoint/cloudPCs?$top=2&$skiptoken=7d4e1527-fe5a-4d86-81eb-2c532ac567ce",
"value": [
{
"id": "fd0230cd-4e05-4ecd-ad05-72f8a30042f1",
"displayName": "RMS-Resize-policy - RMS-Resize-user-05",
"imageDisplayName": "Windows 11 Enterprise + Microsoft 365 Apps 22H2",
"provisioningPolicyId": "7f247338-3d25-4bcf-11a0-fe6fba68f41c",
"provisioningPolicyName": "RMS-Resize-policy",
"onPremisesConnectionName": "",
"servicePlanId": "23a25099-1b2f-4e07-84bd-b81606109438",
"servicePlanName": "Cloud PC Enterprise 2vCPU/4GB/64GB",
"userPrincipalName": "RMS-Resize-user-05@contoso.com",
"lastModifiedDateTime": "2023-04-25T06:24:02Z",
"managedDeviceId": null,
"managedDeviceName": null,
"aadDeviceId": null,
"gracePeriodEndDateTime": null,
"provisioningType": "dedicated"
},
{
"id": "69621742-aad4-4976-990c-d10ff6d73fc1",
"displayName": "TestSweden - Akhilesh Khare",
"imageDisplayName": "TestSweden",
"provisioningPolicyId": "5865dd09-797d-4885-85ab-bb96594b5f1b",
"provisioningPolicyName": "TestSweden",
"onPremisesConnectionName": "TestSweden",
"servicePlanId": "0e837228-8250-4047-8a80-d4a34ba11618",
"servicePlanName": "Cloud PC Enterprise 8vCPU/32GB/512GB",
"userPrincipalName": "akhkhare_contoso.com#EXT#@contoso.com",
"lastModifiedDateTime": "2023-04-25T06:12:10Z",
"managedDeviceId": null,
"managedDeviceName": null,
"aadDeviceId": null,
"gracePeriodEndDateTime": null,
"provisioningType": "dedicated"
}
]
}