I have a bunch of iSCSI drives mounted as NFTS folders (to avoid exhausting all the drive letters) acting as a mini SAN, and I would like to get the information about their free space. The basic reason is to get warnings when space gets below a certain threshold, as a part of a scheduled task which does a bunch of other checks.
Is there a way to do it, preferably using C# (through WMI, P/Invoke, or whatever)? Of course, any scripting solution would also be great, as I can probably invoke it anyway (PowerShell)? I tried the optimistic route first, using DriveInfo
initialized with using such a path, but it simply returns information about the root volume instead of the mount. I've also tried enumerating stuff like Win32_DiskPartition
, Win32_LogicalDisk
and Win32_MappedLogicalDisk
but didn't get those drives at all.