Trying to use WMI root/MicrosoftIISv2

Started by seckner, October 22, 2015, 01:21:18 PM

Previous topic - Next topic

seckner

Found a script in the dbase that 'kind of' does what I need to do - stop and start AppPools on an IIS 7 (Server 2008 R2) server. Got the IIS WMI Ver 6 tools installed and I can now actually connect using    objService = objLocator.ConnectServer(sCompName,"root/microsoftiisv2","","")   with no errors. However whenever I query now  (query = "Select * From IIsApplicationPool") I get "SWbemServicesEx Access Denied" error.

I went digging and found a VB post stating I would need to do something like    Set objWMIService = GetObject("winmgmts:{authenticationLevel=Pkt}!\\" _  & strComputer & "\root\...") but can't figure out how to set it up to work with WB. Any help, advice or other method will be GREATLY appreciated!

td

Have you tried this

Code (winbatch) Select
objWMIService = GetObject("winmgmts:{authenticationLevel=Pkt}!\\":strComputer:"\root\...whatever goes here maybe microsoftiisv2 ...")


?
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade