Access Denied access errors to the WMI WIS provider from ASP

I have a Windows 2003 server with IIS 6 and some scripts that do the automatic setup and creation of websites. They do not work on the new commissioning server (they already work on 3 other W2K3 servers). The problem seems to boil down to WMI security for the IIS provider. Below is the ASP code below (although this is not the source code causing the problem - this is a simplified demonstration of the problem).

Set wmiProvider = GetObject("winmgmts:\\.\root\MicrosoftIISv2")
If wmiProvider is Nothing Then
Response.Write "Failed to get WMI provider MicrosoftIISv2<br>"
End If

Response.Write "Querying for IISWebService...<br>"
Set colItems = wmiProvider.ExecQuery("Select * From IISWebServer",,0)
Response.Write "Error: " & Hex(Err.Number) & " (" & Err.Description & ")<br>"

If I run this in my browser, I get an access error message reported after calling ExecQuery. I set WMI access for user IUSR_ from the root branch all the way down. In fact, I can request IP address information using the CIMV2 provider, quite happily. If I put the IUSR user in the computer administrators group, it all works, but I really don't want to.

This should be a DCOM / WMI security issue, but I can't figure out what else is. Can anyone shed some light?

+5
source share
3 answers

. , - Windows, , IIS WMI, , :

root\WebAdministration , RequiresEncryption, script Pkt_Privacy. Pkt_Privacy script .

SO # - " " WMI.

#, , , , :

ConnectionOptions options = new ConnectionOptions();
options.Authentication = AuthenticationLevel.PacketPrivacy;
ManagementScope managementScope = new ManagementScope(@"\\remote-server\root\WebAdministration", options);
// ...
+1

, ( ), (YMMV):

  • - (,/SiteCreate) WMI.
  • Windows, (, , , )
  • , 1, , 2 ( )

, , . /, 2, script WMI.

0

DCOM, WMI. GetObject, pktPrivacy, :

Set wmiProvider = GetObject("winmgmts:{impersonationLevel=impersonate;authenticationLevel=pktPrivacy}!\root\MicrosoftIISv2")

MS : http://msdn.microsoft.com/en-us/library/aa393618 (v = vs .85).aspx

0

All Articles