Skip to main content

Get-CloudPCDiskSpace

Reports OS disk capacity and free space for Windows 365 Cloud PCs.

Description

Joins Windows 365 Cloud PC inventory with the associated Intune managedDevice record and calculates total storage, free storage, used storage, percent free, and percent used for the Cloud PC OS disk.

Microsoft Graph exposes disk metrics on the https://graph.microsoft.com/beta/deviceManagement/managedDevices endpoint, not on the cloudPC resource. The values come from Intune inventory and reflect the device's last check-in time, shown as LastSyncDateTime.

Syntax


Get-CloudPCDiskSpace [[-CloudPC] <Object[]>] [[-ProvisioningPolicyId] <string>] [[-Type] <string>] [<CommonParameters>]

Parameters

NameTypeRequiredAliasesDescription
CloudPCObject[]NoPipe in WindowsCloudPC.CloudPC objects from Get-CloudPC, or pass one or
more Cloud PC IDs or names. String values are resolved against Get-CloudPC
using exact matches on Id, Name, managedDeviceId, managedDeviceName, or
displayName.
ProvisioningPolicyIdStringNoLimit the report to a single provisioning policy.
TypeStringNoShared, Dedicated, or All (default).

Output

CloudPcName : CPC-USER-01
ManagedDeviceName : CPC-USER-01
ProvisioningType : Dedicated
ProvisioningPolicyName : W365-Enterprise-Dev
AssignedUserUpn : user@contoso.com
TotalStorageGB : 127.45
FreeStorageGB : 88.90
UsedStorageGB : 38.54
PercentFree : 69.80
PercentUsed : 30.20
LastSyncDateTime : 6/19/2026 11:30:00 AM
CloudPcId : 00000000-0000-0000-0000-000000000000
ManagedDeviceId : 00000000-0000-0000-0000-000000000000

Graph endpoints

/beta/deviceManagement/managedDevices

Example 1

Get-CloudPCDiskSpace |
Sort-Object PercentFree |
Format-Table CloudPcName,FreeStorageGB,TotalStorageGB,PercentFree,LastSyncDateTime

Example 2

Get-CloudPC -Type Dedicated | Get-CloudPCDiskSpace

Example 3

Get-CloudPCDiskSpace -CloudPC '<cloud-pc-id-or-name>'

Example 4

Get-CloudPCDiskSpace |
Where-Object PercentFree -lt 15 |
Format-Table CloudPcName,AssignedUserUpn,FreeStorageGB,PercentFree

Source

View Get-CloudPCDiskSpace.ps1 on GitHub