Question : Access Denied accessing IIS api

I'm trying to use wix installer to create a setup project for my web app. WIX has built in scripting for deploying the app. One of the scripts checks IIS for users and also queries the websites. One of these scripts is below.

When I run the installer I get an error that access is denied. It is the same on XP, 7 and 2K3 OS.

I don't get the option to run as administrator on 7.

Anyone get an idea why this is happening?

Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Function checkIUSR ()
    Dim oThisServer, oWebsite , iCount, sQuery, oView
    iCount = 0
    
    ' IIS internet guest account
    On Error Resume Next 
    Set oThisServer = GetObject( "IIS://localhost/W3SVC" ) 
      
    ' Set default
    Session.Property("IUSRCheck") = "BAD"
    checkIUSR = ERROR_INSTALL_FAILURE

    If( Err.Number <> 0 ) Then 
        MsgBox "Unable to retrieve IIS Websites - Please verify that the IIS is running! " & vbCrLf & _ 
               "Error Details: " & Err.Description & " [Number:" & Hex(Err.Number) & "]", vbCritical, "Error" 
        GetWebSites = ERROR_INSTALL_FAILURE 
        Exit Function 
    Else	
    	  Session.Property("IUSRCheck") = "OK"
        Session.Property("INTERNETGUESTACCOUNT") = oThisServer.AnonymousUserName
        If Session.Property("INTERNETGUESTACCOUNT") = "IUSR" Then
          Session.Property("INTERNETGUESTDOMAIN") = "NT AUTHORITY"
        Else
          Session.Property("INTERNETGUESTDOMAIN") = Session.Property("ComputerName")
        End if
        checkIUSR = ERROR_SUCCESS
    End If
End Function

Answer : Access Denied accessing IIS api

try disable UAC in win7 and check if it runs.
run regedit, goto HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
Set the value of EnableLUA to 0
Set the value of ConsentPromptBehaviorAdmin to 0
restart the computer
Random Solutions  
 
programming4us programming4us