c# - Running WMI Query results in COMException (0x80080005) -
i have been working on small wmi info grabber job work hundreds of servers , being able grab information can quite beneficial when having on more 5 servers.
list<string> output = new list<string>(); objectquery query = new objectquery("select * computersystem"); managementobjectsearcher objectsearcher = new managementobjectsearcher(serverconnect.hardwarescope, query); managementobjectcollection retobject = objectsearcher.get(); foreach (managementobject manobj in retobject) { string[] data = ((string)manobj["description"]).split('-'); string ipmi = data[1].substring(7); string firmware = data[2].substring(5); output.add("ipmi version: " + ipmi); output.add("bmc firmware version: " + firmware); } return output;
this using grab basic data computersystem, works on servers crashes on others obtains correct information wanting; however, need prevent crashing comexception.
it says breaks out system.runtime.interopservices.comexception @ following line of code:
foreach (managementobject manobj in retobject)
i have been trying solve issue why servers exception returned rather being able grab information , if possible fix it.
i have been trying fix last couple weeks , have decided ask specific problem having.
update
i have ran same name space , selection servers giving me issues in wmi code creator ( http://www.microsoft.com/en-us/download/confirmation.aspx?id=8572 ) , able obtain data need when ran through program gives comexception. have gone on code code creator makes, , code , have modified of , still gives me error.
Comments
Post a Comment