1

I need to get software RAID configuration info from a remote windows server (2003, 2008, 2012) on a local linux system. I have searched and searched, but have been unsuccessful at finding a solution, as has, it seems, anyone else trying to do a similar thing. (I would have included other similar links, but serverfault forbids me.)

WMI is the preferred method of retrieving this info because it requires no additional, non-default software to be installed on the remote windows server, but any other windows non-install solutions are also acceptable.

I have also looked through and searched the WMI reference without success on this topic. (http:// msdn.microsoft.com/en-us/library/aa394572%28v=vs.85%29.aspx)

Edit:

I'm thinking that winexe(1) is the answer. I have seen and considered the link to the vb script(2) in the accepted answer of the duplicate question. I consider that question to be similar enough to mine to be a real duplicate.

(1): http:// winexe.sourceforge.net/
(2): http:// www.anchor.com.au/hosting/dedicated/monitoring_windows_software_raid

jxqz
  • 11

1 Answers1

1

As Evan mentioned, the info you want isn't exposed via WMI and the highest level way you're going to be able to access it is via the diskpart utility.

However, if you've got a bit of AppDev knowledge and the will to slog through some poor API documentation, you can also query the info directly using the same API that diskpart uses which is the VDS (Virtual Disk Service) API.

Normally, it's accessed via COM. But there is a relatively unknown managed .NET wrapper called System.Microsoft.Vds.dll that only lives on the Server OSes. That DLL plus PowerShell would hypothetically enable you to directly query the information you're looking for. But it's probably going to be a rough ride and might end up being easier just parsing diskpart output.

Here's a blog article I found that talks about using that DLL from C#. But the basic concepts could be translated to PowerShell without too much difficulty.
http://1-800-magic.blogspot.com/2010/10/windows-disk-management-with-net.html

Ryan Bolger
  • 17,010