Today’s post is a quick one that came out of a conversation on Twitter. To make a long story short, somebody was having trouble with mount points filling up because they were not being caught by their current monitoring script. I offered to look up how my monitoring was doing this and post it here.
After some digging through various VBScript files I was able to confirm that I use a WMI query of Win32_Volume. The query I have is in a highly custom script that does not lend itself to being understandable if taken out of context so I went ahead and converted the logic to PowerShell, then messed with it a bit to come up with something human readable. Here is that script:
So there is the code as promised. The next logical step would be to add a call inside the loop to insert this information into a table for trending and alerting.
Please do not run this on an important machine before reviewing it thuroughly. I offer no warranty beyond a sympathetic ear if this script breaks something.