viewpoint-particle

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

seckner

  • Jr. Member
  • **
  • Posts: 51
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!

td

  • Tech Support
  • *****
  • Posts: 1957
    • 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 ...")
 

?
"DON'T PANIC”
The Hitchhiker's Guide to the Galaxy, Douglas Adams