Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Read the properties and relationships of a specific cloudPC 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.Read.All |
CloudPC.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
CloudPC.Read.All |
CloudPC.ReadWrite.All |
HTTP request
To get the cloudPC of the specified user (who is the signed-in user) in the organization using delegated permission:
GET /me/cloudPCs/{id}
GET /users/{userId}/cloudPCs/{id}
To get the specified cloudPC in the organization, using either delegated permission (the signed-in user should be the administrator) or application permission:
GET /deviceManagement/virtualEndpoint/cloudPCs/{id}
Optional query parameters
This method supports the $select
OData query parameter to help customize the response.
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a cloudPC object in the response body.
Examples
Example 1: Get the default properties of a Cloud PC
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs/9ec90ff8-fd63-4fb9-ab5a-aa4fdcc43ec9
// Code snippets are only available for the latest version. Current version is 5.x
// 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.CloudPCs["{cloudPC-id}"].GetAsync();
mgc-beta device-management virtual-endpoint cloud-pcs get --cloud-pcid {cloudPC-id}
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
cloudPCs, err := graphClient.DeviceManagement().VirtualEndpoint().CloudPCs().ByCloudPCId("cloudPC-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPC result = graphClient.deviceManagement().virtualEndpoint().cloudPCs().byCloudPCId("{cloudPC-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let cloudPC = await client.api('/deviceManagement/virtualEndpoint/cloudPCs/9ec90ff8-fd63-4fb9-ab5a-aa4fdcc43ec9')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->cloudPCs()->byCloudPCId('cloudPC-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.DeviceManagement.Administration
Get-MgBetaDeviceManagementVirtualEndpointCloudPc -CloudPCId $cloudPCId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.device_management.virtual_endpoint.cloud_p_cs.by_cloud_p_c_id('cloudPC-id').get()
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPC",
"aadDeviceId": "f5ff445f-7488-40f8-8ab9-ee784a9c1f33",
"id": "ac74ae8b-85f7-4272-88cc-54192674ffff",
"displayName": "Demo-0",
"imageDisplayName": "Windows-10 19h1-evd",
"managedDeviceId": "e87f50c7-fa7f-4687-aade-dd45f3d6ffff",
"managedDeviceName": "A00002GI001",
"provisioningPolicyId": "13fa0778-ba00-438a-96d3-488c8602ffff",
"provisioningPolicyName": "Marketing provisioning policy",
"onPremisesConnectionName": "Azure network connection for Marketing",
"servicePlanId": "da5615b4-a484-4742-a019-2d52c91cffff",
"servicePlanName": "standard",
"servicePlanType": "enterprise",
"status": "failed",
"statusDetails": {
"@odata.type": "microsoft.graph.cloudPcStatusDetails",
"code": "internalServerError",
"message": "There was an internal server error. Please contact support xxx.",
"additionalInformation": [
{
"@odata.type": "microsoft.graph.keyValuePair",
"name": "correlationId",
"value": "52367774-cfb7-4e9c-ab51-1b864c31f2d1"
}
]
},
"userPrincipalName": "[email protected]",
"lastModifiedDateTime": "2020-11-03T18:14:34Z",
"gracePeriodEndDateTime": "2020-11-010T20:00:34Z",
"provisioningType": "sharedByUser",
"diskEncryptionState": "notAvailable"
}
Example 2: Get the selected properties of a Cloud PC
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs/40cee9d2-03fb-4066-8d35-dbdf2875c33f?$select=id,displayName,imageDisplayName,lastModifiedDateTime,lastRemoteActionResult,lastLoginResult,connectivityResult,allotmentDisplayName,deviceRegionName,productType
// Code snippets are only available for the latest version. Current version is 5.x
// 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.CloudPCs["{cloudPC-id}"].GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "id","displayName","imageDisplayName","lastModifiedDateTime","lastRemoteActionResult","lastLoginResult","connectivityResult","allotmentDisplayName","deviceRegionName","productType" };
});
mgc-beta device-management virtual-endpoint cloud-pcs get --cloud-pcid {cloudPC-id} --select "id,displayName,imageDisplayName,lastModifiedDateTime,lastRemoteActionResult,lastLoginResult,connectivityResult,allotmentDisplayName,deviceRegionName,productType"
// 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"
graphdevicemanagement "github.com/microsoftgraph/msgraph-beta-sdk-go/devicemanagement"
//other-imports
)
requestParameters := &graphdevicemanagement.VirtualEndpointCloudPCsItemRequestBuilderGetQueryParameters{
Select: [] string {"id","displayName","imageDisplayName","lastModifiedDateTime","lastRemoteActionResult","lastLoginResult","connectivityResult","allotmentDisplayName","deviceRegionName","productType"},
}
configuration := &graphdevicemanagement.VirtualEndpointCloudPCsItemRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
cloudPCs, err := graphClient.DeviceManagement().VirtualEndpoint().CloudPCs().ByCloudPCId("cloudPC-id").Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPC result = graphClient.deviceManagement().virtualEndpoint().cloudPCs().byCloudPCId("{cloudPC-id}").get(requestConfiguration -> {
requestConfiguration.queryParameters.select = new String []{"id", "displayName", "imageDisplayName", "lastModifiedDateTime", "lastRemoteActionResult", "lastLoginResult", "connectivityResult", "allotmentDisplayName", "deviceRegionName", "productType"};
});
const options = {
authProvider,
};
const client = Client.init(options);
let cloudPC = await client.api('/deviceManagement/virtualEndpoint/cloudPCs/40cee9d2-03fb-4066-8d35-dbdf2875c33f')
.version('beta')
.select('id,displayName,imageDisplayName,lastModifiedDateTime,lastRemoteActionResult,lastLoginResult,connectivityResult,allotmentDisplayName,deviceRegionName,productType')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\DeviceManagement\VirtualEndpoint\CloudPCs\Item\CloudPCItemRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new CloudPCItemRequestBuilderGetRequestConfiguration();
$queryParameters = CloudPCItemRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->select = ["id","displayName","imageDisplayName","lastModifiedDateTime","lastRemoteActionResult","lastLoginResult","connectivityResult","allotmentDisplayName","deviceRegionName","productType"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->deviceManagement()->virtualEndpoint()->cloudPCs()->byCloudPCId('cloudPC-id')->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.DeviceManagement.Administration
Get-MgBetaDeviceManagementVirtualEndpointCloudPc -CloudPCId $cloudPCId -Property "id,displayName,imageDisplayName,lastModifiedDateTime,lastRemoteActionResult,lastLoginResult,connectivityResult,allotmentDisplayName,deviceRegionName,productType"
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.device_management.virtual_endpoint.cloud_p_cs.item.cloud_p_c_item_request_builder import CloudPCItemRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = CloudPCItemRequestBuilder.CloudPCItemRequestBuilderGetQueryParameters(
select = ["id","displayName","imageDisplayName","lastModifiedDateTime","lastRemoteActionResult","lastLoginResult","connectivityResult","allotmentDisplayName","deviceRegionName","productType"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.device_management.virtual_endpoint.cloud_p_cs.by_cloud_p_c_id('cloudPC-id').get(request_configuration = request_configuration)
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPC",
"id": "ac74ae8b-85f7-4272-88cc-54192674ffff",
"displayName": "Demo-0",
"imageDisplayName": "Windows-10 19h1-evd",
"lastModifiedDateTime": "2020-11-03T18:14:34Z",
"lastLoginResult": {
"time": "2021-06-23T09:28:32.8260335Z"
},
"lastRemoteActionResult": {
"actionName": "Reboot",
"actionState": "done",
"startDateTime": "2021-06-23T09:28:32.8260335Z",
"lastUpdatedDateTime": "2021-06-23T09:28:32.8260338Z",
"cloudPcId": "662009bc-7732-4f6f-8726-25883518b33e",
"managedDeviceId": "bdc8e6dd-0455-4412-83d9-c818664fe1f1",
"statusDetails": null
},
"connectivityResult": {
"status": "unavailable",
"updatedDatetime": "2022-03-22T10:28:32.8260335Z",
"failedHealthCheckItems": [
{
"displayName": "DomainJoinCheck",
"result": "failure",
"lastHealthCheckDateTime": "2022-03-22T10:28:32.8260335Z",
"additionalDetails": "SessionHost unhealthy: SessionHost is not joined to a domain"
}
]
},
"allotmentDisplayName": null,
"deviceRegionName": "eastus2",
"productType": null
}
Exmaple 3: Get the default properties of a Cloud PC of the signed-in user
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/me/cloudPCs/36bd4942-0ca8-11ed-861d-0242ac120002
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.CloudPCs["{cloudPC-id}"].GetAsync();
mgc-beta users cloud-pcs get --user-id {user-id} --cloud-pcid {cloudPC-id}
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
cloudPCs, err := graphClient.Me().CloudPCs().ByCloudPCId("cloudPC-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
CloudPC result = graphClient.me().cloudPCs().byCloudPCId("{cloudPC-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let cloudPC = await client.api('/me/cloudPCs/36bd4942-0ca8-11ed-861d-0242ac120002')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->me()->cloudPCs()->byCloudPCId('cloudPC-id')->get()->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.me.cloud_p_cs.by_cloud_p_c_id('cloudPC-id').get()
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudPC",
"aadDeviceId": "61204a22-0ca8-11ed-861d-0242ac120002",
"id": "36bd4942-0ca8-11ed-861d-0242ac120002",
"displayName": "Demo-1",
"imageDisplayName": "Windows-10 19h1-evd",
"managedDeviceId": "70341bb0-0ca8-11ed-861d-0242ac120002",
"managedDeviceName": "A00002GI001",
"provisioningPolicyId": "7a3bdee0-0ca8-11ed-861d-0242ac120002",
"provisioningPolicyName": "Marketing provisioning policy",
"onPremisesConnectionName": "Azure network connection for Marketing",
"servicePlanId": "83fca22a-0ca8-11ed-861d-0242ac120002",
"servicePlanName": "standard",
"servicePlanType": "enterprise",
"status": "failed",
"statusDetails": {
"@odata.type": "microsoft.graph.cloudPcStatusDetails",
"code": "internalServerError",
"message": "There was an internal server error. Please contact support xxx.",
"additionalInformation": [
{
"@odata.type": "microsoft.graph.keyValuePair",
"name": "correlationId",
"value": "8fea34e4-0ca8-11ed-861d-0242ac120002"
}
]
},
"userPrincipalName": "[email protected]",
"lastModifiedDateTime": "2020-11-03T18:14:34Z",
"gracePeriodEndDateTime": "2020-11-010T20:00:34Z",
"provisioningType": "dedicated",
"diskEncryptionState": "notAvailable"
}