Remote Support Software

Provide instant remote support to customers and employees:

Click here for a free trial

WMI query not working outside IDE

I tested this in the IDE and it worked fine. When I pushed the EXE to a live machine it did absolutely nothing.

Is there a service that needs to be running? Permissions are set correctly for the administrator and I even granted full permissions to Everyone on the server. Is there something I am missing?
Dim objWmiService As Object Dim colItems As Object Dim strComputer As String strComputer = "." Set objWmiService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftIISv2") Set colItems = objWmiService.ExecQuery("SELECT * FROM IISWebServerSetting", , 48)

There is an amazing pack of free network admin tools. click here to download it






May 15th, 2012 9:46am
You may need to trap errors to check if there is a permission problem. IIS may require permissions granted to a builtin user, perhaps IUSR_ServerName or IWAN_ServerName. See this link:


http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/3648346f-e4f5-474b-86c7-5a86e85fa1ff.mspx?mfr=true

Otherwise, for best compatibility I specify impersonationLevel and authenticationLevel in the WMI binding string. For example (one line):

Set objWmiService = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer &
"\root\MicrosoftIISv2")

-----

Richard Mueller - MVP Directory Services

There is an amazing pack of free network admin tools. click here to download it






May 15th, 2012 10:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics