Author Topic: Trying to use WMI root/MicrosoftIISv2  (Read 6383 times)


  • Jr. Member
  • **
  • Posts: 70
Trying to use WMI root/MicrosoftIISv2
« on: October 22, 2015, 01:21:18 pm »
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!


  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: Trying to use WMI root/MicrosoftIISv2
« Reply #1 on: October 22, 2015, 02:30:16 pm »
Have you tried this

Code: Winbatch
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