| title | List cloudPCs |
|---|---|
| description | List properties and relationships of the cloudPC objects. |
| author | AshleyYangSZ |
| ms.localizationpriority | medium |
| ms.subservice | cloud-pc |
| doc_type | apiPageType |
| ms.date | 06/14/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
List the cloudPC devices in a tenant.
[!INCLUDE national-cloud-support]
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.
[!INCLUDE permissions-table]
GET /deviceManagement/virtualEndpoint/cloudPCsThis method supports $select, $filter, $count, and $top OData query parameters to help customize the response. For general information, see OData query parameters.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a collection of cloudPC objects in the response body.
The following example shows how to get a list of all cloudPC devices in a tenant.
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
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"
}
]
}The following example shows how to use the $top query parameter to get the top two cloudPC devices in a tenant.
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs?$top=2
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
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": []
}
]
}The following example shows how to list Cloud PCs filtered by disaster recovery capability type and select specific parameters.
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs?$select=id,displayName,disasterRecoveryCapability&$filter=disasterRecoveryCapability/capabilityType eq 'failover'
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/virtualEndpoint/cloudPCs(id,displayName,disasterRecoveryCapability)",
"value": [
{
"id": "662009bc-7732-4f6f-8726-25883518b33e",
"displayName": "Demo-0",
"disasterRecoveryCapability": {
"primaryRegion": "eastus",
"secondaryRegion": "westus",
"capabilityType": "failover"
}
},
{
"id": "ac74ae8b-85f7-4272-88cc-5419267403ed",
"displayName": "Demo-1",
"disasterRecoveryCapability": {
"primaryRegion": "eastus",
"secondaryRegion": "westus",
"capabilityType": "failover"
}
}
]
}The following example shows how to list Cloud PCs filtered by product type and select specific parameters.
The following example shows a request.
GET https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs?$select=id,displayName,productType&$filter=productType eq 'enterprise'
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/virtualEndpoint/cloudPCs(id,displayName,productType)",
"value": [
{
"id": "662009bc-7732-4f6f-8726-25883518b33e",
"displayName": "Demo-0",
"productType": "enterprise"
},
{
"id": "ac74ae8b-85f7-4272-88cc-5419267403ed",
"displayName": "Demo-1",
"productType": "enterprise"
}
]
}