List cloudPCs
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.
List the cloudPC devices in a tenant.
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
GET /deviceManagement/virtualEndpoint/cloudPCs
Optional query parameters
This method supports $select
, $filter
, $count
, and $top
OData query parameters to help customize the response. For general information, see OData query parameters.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of cloudPC objects in the response body.
Examples
Example 1: List all cloudPC devices in a tenant
The following example shows how to get a list of all cloudPC devices in a tenant.
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
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",
"servicePlanType": "enterprise",
"status": "provisioned",
"userPrincipalName": "dujanjic@contoso.com",
"lastModifiedDateTime": "2020-11-03T10:29:57Z",
"statusDetails": null,
"gracePeriodEndDateTime": "2020-11-010T20:00:34Z",
"provisioningType": "dedicated",
"deviceRegionName": "eastus2",
"diskEncryptionState": "encryptedUsingPlatformManagedKey"
}
]
}
Example 2: Get the top two cloudPC devices in a tenant
The following example shows how to use the $top
query parameter to get the top two cloudPC devices in a tenant.
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs?$top=2
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/testprodbeta_cpc_int/$metadata#deviceManagement/virtualEndpoint/cloudPCs",
"@odata.count": 200,
"@odata.nextLink": "https://graph.microsoft.com/testprodbeta_cpc_int/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",
"status": "failed",
"userPrincipalName": "RMS-Resize-user-05@contoso.com",
"lastModifiedDateTime": "2023-04-25T06:24:02Z",
"managedDeviceId": null,
"managedDeviceName": null,
"aadDeviceId": null,
"gracePeriodEndDateTime": null,
"servicePlanType": "enterprise",
"diskEncryptionState": "notAvailable",
"provisioningType": "dedicated",
"deviceRegionName": "eastus2",
"statusDetails": {
"code": "intuneEnrollFailed",
"message": "We can’t complete MEM enrollment of this Cloud PC. Check MEM policy settings and retry. If that doesn’t work, contact Customer support.",
"additionalInformation": [
{
"name": "retriable",
"value": "true"
},
{
"name": "failedAction",
"value": "Provision"
},
{
"name": "rawError",
"value": "Run Intune enrollment extension failed."
}
]
},
"partnerAgentInstallResults": []
},
{
"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",
"status": "failed",
"userPrincipalName": "akhkhare_contoso.com#EXT#@contoso.com",
"lastModifiedDateTime": "2023-04-25T06:12:10Z",
"managedDeviceId": null,
"managedDeviceName": null,
"aadDeviceId": null,
"gracePeriodEndDateTime": null,
"servicePlanType": "enterprise",
"diskEncryptionState": "notAvailable",
"provisioningType": "dedicated",
"deviceRegionName": "eastus2",
"statusDetails": {
"code": "intuneEnrollFailed",
"message": "We can’t complete MEM enrollment of this Cloud PC. Check MEM policy settings and retry. If that doesn’t work, contact Customer support.",
"additionalInformation": [
{
"name": "retriable",
"value": "true"
},
{
"name": "failedAction",
"value": "Provision"
},
{
"name": "rawError",
"value": "Run Intune enrollment extension failed."
}
]
},
"partnerAgentInstallResults": []
}
]
}