Device Free Storage
Query
// Show the percentage of free storage on devices
IntuneDevices
| where OS == "Windows"
| where StorageFree != "0" and StorageTotal != "0"
| where DeviceName != "User deleted for this device" and DeviceName != ""
| extend ['Free Storage'] = StorageFree
| extend ['Total Storage'] = StorageTotal
| extend Percentage = round(todouble(StorageFree) * 100 / todouble(StorageTotal), 2)
| distinct DeviceName, ['Free Storage'], ['Total Storage'], Percentage, UPN
| sort by Percentage ascExplanation
This query is used to display the percentage of free storage on Windows devices. It filters out devices where the storage free or total storage is not zero and where the device name is not empty or "User deleted for this device". It then calculates the percentage of free storage by dividing the free storage by the total storage and multiplying by 100. The results are displayed in ascending order by the percentage of free storage. The output includes the device name, free storage, total storage, percentage of free storage, and the User Principal Name (UPN).
Details

Ugur Koc
Released: July 29, 2022
Tables
IntuneDevices
Keywords
IntuneDevicesOSWindowsStorageFreeStorageTotalDeviceNameUserFree StorageTotal StoragePercentageUPN
Operators
whereextendtodoublerounddistinctsort by