How can I retrieve query raid status wmi

Asked By 40 points N/A Posted on -
qa-featured

I find it difficult to retrieve a query in certain programming languange, especially raid, the status is wmi. So, do I retrieve simple query raid status wmi ?

SHARE
Answered By 590495 points N/A #137095

How can I retrieve query raid status wmi

qa-featured

I found a post that uses WMI with JavaScript. I’m not sure how will this help you since it discusses a different thing on using WMI but this will surely give you an idea on how to use JavaScript with WMI. The complete script is displayed below but for your own personal understanding of the idea behind the code, you may visit Using WMI with Javascript.

var strComputer = ".";
var SWBemlocator = new ActiveXObject("WbemScripting.SWbemLocator");
var objWMIService = SWBemlocator.ConnectServer(strComputer, "/root/CIMV2");
var strProcess = "";
var colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem");

var e = new Enumerator(colItems);
for(; ! e.atEnd(); e.moveNext())
{
                strProcess += "UserName: "+ e.item().Username+ "<br>n";
}

colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=true");
e = new Enumerator(colItems);
for(; ! e.atEnd(); e.moveNext())
{
                strProcess += "IPAddress: "+ e.item().IPAddress(0)+ "<br>n";
}

document.getElementById('sys_info').innerHTML = strProcess;

Related Questions