Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created March 20, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PixelRobots/c9f19938dea0d42e9528044594d6714c to your computer and use it in GitHub Desktop.
Save PixelRobots/c9f19938dea0d42e9528044594d6714c to your computer and use it in GitHub Desktop.
// enter a GB value to check
let setgbvalue = 100;
// Query
Perf
| where TimeGenerated > ago(1h)
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes"
| where InstanceName !contains "D:"
| where InstanceName !contains "_Total"
| extend FreeSpaceGB = CounterValue/1024
| summarize FreeSpace = min(FreeSpaceGB) by Computer, InstanceName
| where FreeSpace < setgbvalue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment