So this blog was requested a lot lately – I’m not a big fan of using Windows RAID anywhere but Storage Spaces is becoming more relevant each day, with S2D and larger deployments. Storage Spaces is Microsoft’s successor to the classical Windows Software RAID options.
I’ve made some scripts for both options, but I sure advise to look into Storage Spaces over classical Windows software RAID in any case.
Windows RAID Monitoring
So let’s start with the one I do not prefer, just to get it out of the way 😉 Monitoring Windows RAID is not really as straightforward as you’d expect. The issue is that it’s quite OS dependent on what data is returned via the wmi instances. To avoid using WMI/CIM we’re using diskpart instead. Diskpart prints to the console and the content is not easily converted into a PowerShell object.
So in comes regex. I found another blogger that had a visual basic script to monitor Windows RAID and used his regular expression, but converted to PowerShell instead;
|
|
And that’s it for this one. This will show the state of each disk and alert is if it anything but OK.
Monitoring Storage Spaces and physical disks
So monitoring Storage Spaces is a lot easier; the cmdlets are the same everywhere and it doesn’t require extracting information from other sources. All you need is to monitor both the physical disk, and the storage pool;
|
|
This script would show the current physical disk health status, this is a combination of write-endurance on SSDs, SMART status for HDDs and other info that windows collects by default. You don’t need storage spaces for that portion, really.
|
|
And this one reports on the exact state of the virtual drive, thus if anything is wrong you’ll get an alert stating what happened. And that’s it for now! I hope you enjoyed and as always, Happy PowerShelling and I hope to see some of you at the #CyberDrainCTF!