Summary
When a license is removed from a user, Windows 365 Business Cloud PCs enter a seven-day grace period before permanent removal. This article explains how to manually remove Cloud PCs from grace to reassign licenses and avoid provisioning issues.
This article provides step-by-step instructions for using Microsoft Graph Explorer and the Microsoft Graph API to perform this deprovision.
Note: For most scenarios, administrators can now end the grace period and deprovision Windows 365 Business Cloud PCs directly from the Microsoft 365 admin center or Intune by using the Deprovision now option. This article describes how to perform the same action by using Microsoft Graph and is intended for automation or advanced troubleshooting scenarios.
Prerequisites
-
Administrator access to your Microsoft 365 tenant
-
Permissions to use Microsoft Graph API (Cloud PC administrator or equivalent)
-
Access to Microsoft Graph Explorer
-
Cloud PCs in
inGracePeriodstatus in your Windows 365 environment
Step 1: Sign in to Graph Explorer
-
Go to Graph Explorer.
-
Select Sign in to Graph Explorer (top right corner).
-
Authenticate by using your administrator credentials and set the tenant.
Step 2: Identify Cloud PCs in grace period
-
In the query box, set the following
GETrequest:https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs?$filter=status eq 'inGracePeriod' -
In Graph Explorer, select Modify Permissions.
-
Consent to the following permissions for your session:
-
CloudPC.Read.All
-
CloudPC.ReadWrite.All
-
-
If not already granted, select Consent to add these permissions.
-
Select Run Query.
-
Review the results to locate the Cloud PCs you want to remove. Note the id value for each relevant Cloud PC.
Step 3: Remove a Cloud PC from grace
-
For each Cloud PC, send a
POSTrequest to remove it from grace. In the query box, select POST and use the following request:https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs/{cloudPCId}/endGracePeriod -
Replace
{cloudPCId}by using the actual ID of the Cloud PC. For example:https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/cloudPCs/4b18de4b-ab05-4059-8c61-0323a7df4ced/endGracePeriod -
Leave the request body empty.
-
Select Run Query.
-
If successful, you receive a
No Content - 204response.
Step 4: Verify removal
-
To confirm removal from grace, repeat the
GETrequest from Step 3. -
The Cloud PC shouldn't appear with status eq 'inGracePeriod'.
Troubleshooting and notes
-
If you receive a permissions error, verify that you have the correct roles and all necessary permissions are consented.
-
Changes made through the Graph API might take a few minutes to reflect in the Windows 365 portal.
-
Removing a Cloud PC from grace permanently deletes the Cloud PC and any associated user data.
More information
-
Microsoft Graph Cloud PC Documentation
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
