Tuesday 15 January 2013

c# - Trying to programmatically shutdown a farm server in ARR throws "Query not supported" error -



c# - Trying to programmatically shutdown a farm server in ARR throws "Query not supported" error -

i'm trying "shutdown gracefuly" sample server in server farm using microsoft.web.administration api. found similar solution on internet, did not work me.

var mgr = new servermanager(); var conf = mgr.getapplicationhostconfiguration(); var sect = conf.getsection("webfarms"); var webfarms = sect.getcollection(); var farm = webfarms[0]; var servers = farm.getcollection(); var server = servers[0]; var arr = server.getchildelement("applicationrequestrouting"); var counters = arr.getchildelement("counters"); //console.writeline(counters.attributes); // gives error "not supported" var method = arr.methods["setstate"]; var instance = method.createinstance(); instance.input.attributes[0].value = 2; //shutdown gracefully instance.execute(); // exception hresult: 0x80070032

c# arr remote-control

No comments:

Post a Comment