Inventory and reporting
Use the read commands to build a current picture of the Windows 365 estate before taking action. The module returns objects so you can filter, sort, export, or pipe them into other commands.
Cloud PC inventory
Get-CloudPC |
Sort-Object Name |
Format-Table Name,ProvisioningStatus,ProvisioningType,AssignedUserUpn
Filter by user or provisioning policy when you already know the scope.
Get-CloudPC -Id '<cloud-pc-id>'
Get-CloudPC -Name 'CPC-brad-*'
Get-CloudPC -ProvisioningStatus inGracePeriod
Get-CloudPC -ProvisioningStatus inGracePeriod,deprovisioning
Get-CloudPC -UserPrincipalName user@contoso.com
Get-CloudPC -ProvisioningPolicyId '<policy-id>'
Provisioning policies
Get-CloudPCByProvisioningPolicy groups Cloud PCs under their provisioning policy so you can see the shape of the fleet.
Get-CloudPCByProvisioningPolicy |
Format-Table DisplayName,ProvisioningType,CloudPCCount,AssignedGroupCount
Use Get-CloudPCProvisioningPolicy when you need policy details and assignment metadata.
Get-CloudPCProvisioningPolicy |
Select-Object DisplayName,Id,ProvisioningType,ImageDisplayName,ManagedBy
Service plans
Get-CloudPCServicePlan lists the Windows 365 Cloud PC service plans available to the tenant. Use it before resize planning or SKU comparisons.
Get-CloudPCServicePlan |
Sort-Object Type,VCpuCount,RamGB,StorageGB |
Format-Table DisplayName,Type,VCpuCount,RamGB,StorageGB
Filter by plan type or exact display name:
Get-CloudPCServicePlan -Type enterprise
Get-CloudPCServicePlan -DisplayName 'Cloud PC Enterprise 4vCPU/16GB/128GB'
Organization settings
Get-CloudPCOrganizationSetting reads the tenant-wide Windows 365 organization defaults. These include OS version, user account type, Microsoft Endpoint Manager auto-enrollment, single sign-on, and Windows language.
Get-CloudPCOrganizationSetting |
Select-Object OsVersion,UserAccountType,MEMAutoEnrollEnabled,SingleSignOnEnabled,WindowsLanguage
Grace period
Cloud PCs in grace period can be found with Get-CloudPC -ProvisioningStatus inGracePeriod, which maps to the Graph status eq 'inGracePeriod' filter. You can pass multiple statuses, such as inGracePeriod,deprovisioning, to watch the full deprovisioning flow. Ending grace period immediately deprovisions the Cloud PC through the Graph beta endGracePeriod action, so preview with -WhatIf.
Get-CloudPC -ProvisioningStatus inGracePeriod,deprovisioning |
Format-Table Name,AssignedUserUpn,ProvisioningStatus
Invoke-CloudPCEndGracePeriod -All -WhatIf
The endGracePeriod action is asynchronous. After Graph accepts the request, a Cloud PC can still appear as inGracePeriod for several minutes while Windows 365 updates state. Use -PassThru for a verification command and expected lag, or add -Wait to poll until the Cloud PC leaves inGracePeriod or the timeout is reached.
Invoke-CloudPCEndGracePeriod -CloudPC 'CPC-GRACE-01' -Force -PassThru -Wait
Export and recreate provisioning policies
Export a provisioning policy to JSON when you want to back it up, review the create body, or create a copy.
Export-CloudPCProvisioningPolicy -Id '<policy-id>' -Path .\policy-export.json
The export separates the create-safe policy body from assignment targets. Create can be previewed first:
New-CloudPCProvisioningPolicy -Path .\policy-export.json `
-DisplayName 'Copied Policy' `
-WhatIf
Create the policy and recreate exported assignment targets:
New-CloudPCProvisioningPolicy -Path .\policy-export.json `
-DisplayName 'Copied Policy' `
-Assign `
-Force
For Flex Shared policies, the assignment reserves an allotment count. If the source policy reserves more Cloud PCs than the tenant has remaining, lower the assignment count while importing:
New-CloudPCProvisioningPolicy -Path .\policy-export.json `
-DisplayName 'Copied Flex Shared Policy' `
-RegionName eastus2 `
-AllotmentLicensesCount 1 `
-Assign `
-Force
Assignments are applied after the new policy is created because Microsoft Graph uses a separate /assign action.
Delete provisioning policies
Delete copied or unused provisioning policies by ID or from the pipeline. Microsoft Graph cannot delete a policy that is still in use.
Remove-CloudPCProvisioningPolicy -Id '<policy-id>' -WhatIf
Remove-CloudPCProvisioningPolicy -Id '<policy-id>' -Force -PassThru
Pipeline usage:
Get-CloudPCProvisioningPolicy -Id '<policy-id>' |
Remove-CloudPCProvisioningPolicy -Force -PassThru
Usage reporting
Get-CloudPCUsage combines Cloud PC inventory with managed device state so you can see active and idle Cloud PCs.
Get-CloudPCUsage |
Sort-Object DaysSinceLastSignIn -Descending |
Format-Table CloudPcName,AssignedUserUpn,UsageStatus,DaysSinceLastSignIn
Common follow-up filters:
# Idle for at least 14 days
Get-CloudPCUsage | Where-Object DaysSinceLastSignIn -ge 14
# Currently unavailable or stale
Get-CloudPCUsage | Where-Object UsageStatus -ne 'InUse'
Disk space reporting
Get-CloudPCDiskSpace joins Cloud PC inventory to the matching Intune managed device record and reports OS disk totals from Intune inventory. Use LastSyncDateTime to understand how fresh the storage data is.
Get-CloudPCDiskSpace |
Sort-Object PercentFree |
Format-Table CloudPcName,AssignedUserUpn,FreeStorageGB,TotalStorageGB,PercentFree,LastSyncDateTime
Common low-space filter:
Get-CloudPCDiskSpace |
Where-Object PercentFree -lt 15 |
Format-Table CloudPcName,AssignedUserUpn,FreeStorageGB,PercentFree,LastSyncDateTime
Launch details
Use launch details when troubleshooting the user connection path for one or more Cloud PCs.
Get-CloudPC |
Get-CloudPCLaunchDetail |
Format-Table CloudPcName,UserPrincipalName,State,LastLoginDateTime
The module uses the newer retrieveCloudPcLaunchDetail Graph action, not the deprecated getCloudPcLaunchInfo action.
Graph Cloud PC report streams
Get-CloudPCReport retrieves Windows 365 Cloud PC report streams from Microsoft Graph beta and parses the downloaded Schema and Values file into typed PowerShell rows.
$pc = Get-CloudPC | Select-Object -First 1
Get-CloudPCReport -ReportName remoteConnectionHistoricalReports -CloudPcId $pc.Id -Top 50 |
Format-Table ManagedDeviceName,SignInDateTime,SignOutDateTime,UsageInHour
Use -Select, -Filter, -Search, -GroupBy, -OrderBy, -Skip, and -Top to pass Graph report query options when the target report action supports them. The command intentionally exposes only reports that returned successfully in live testing. Deprecated reports, tenant-state-dependent aliases that returned Graph 400s, and enum values without callable actions are excluded from -ReportName.
Get-CloudPCReport -ReportName regionalConnectionQualityTrendReport -Top 50 |
Format-Table GatewayRegionName,WeeklyAvgRoundTripTimeInMs,WeeklyAvgAvailableBandwidthInMbps
realTimeRemoteConnectionStatus uses the Graph report stream payload shape, but it is a GET function scoped to a Cloud PC ID. Omit -CloudPcId to query every Cloud PC in the tenant.
Get-CloudPCReport -ReportName realTimeRemoteConnectionStatus |
Format-Table ManagedDeviceName,SignInStatus,DaysSinceLastSignIn,LastActiveTime
For large tenants, the cmdlet honors Graph Retry-After responses for 429 throttling and retries transient 503/504 responses. You can also add a small delay between per-Cloud-PC calls to proactively pace the tenant-wide loop.
Get-CloudPCReport -ReportName realTimeRemoteConnectionStatus -RequestDelayMilliseconds 100
Use -OutputFilePath to keep the raw Graph report file for audit or troubleshooting, or -Raw to inspect the parsed payload and schema directly.
Some Graph reports require scoped filters. Use -CloudPcId for remoteConnectionHistoricalReports, and use an ActivityId from that history when drilling into rawRemoteConnectionReports.
$activity = Get-CloudPCReport -ReportName remoteConnectionHistoricalReports -CloudPcId $pc.Id -Top 1
Get-CloudPCReport -ReportName rawRemoteConnectionReports `
-ActivityId $activity.ActivityId `
-Select Timestamp,RoundTripTimeInMs,AvailableBandwidthInMBps
Remote action history
After restart, reprovision, restore, or snapshot-related actions, use remote action history to check what Graph reports for the device.
Get-CloudPCRemoteActionResult -CloudPC '<cloud-pc-id>' |
Sort-Object StartDateTime -Descending |
Format-Table ActionName,ActionState,StartDateTime,LastUpdatedDateTime
Rename Cloud PCs
Rename-CloudPC updates the Cloud PC display name through Microsoft Graph v1.0. Preview the target first with -WhatIf.
Rename-CloudPC -CloudPC 'CPC-USER-01' -NewDisplayName 'Finance-CloudPC-01' -WhatIf
To also rename the linked Intune managed device, provide -ManagedDeviceName. This calls the managed device setDeviceName action and requires the additional DeviceManagementManagedDevices.PrivilegedOperations.All scope.
Rename-CloudPC -CloudPC 'CPC-USER-01' `
-NewDisplayName 'Finance-CloudPC-01' `
-ManagedDeviceName 'Finance-CloudPC-01' `
-WhatIf
Export reports
Get-CloudPCUsage |
Select-Object CloudPcName,AssignedUserUpn,UsageStatus,DaysSinceLastSignIn,LastSignInDateTime |
Export-Csv .\cloudpc-usage.csv -NoTypeInformation