Previous Next

Thread: Access Denied

Last post 09-17-2008 11:13 AM by gsullivan. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 09-15-2008, 3:59 PM

    Access Denied

    The installer for our application includes the following bit of code:

    public static ArrayList PopulateSites(string serverName)

    {

    ArrayList sites = new ArrayList();

    DirectoryEntry w3svc = new DirectoryEntry("IIS://" + serverName + "/w3svc");

    DirectoryEntries webSites = w3svc.Children;

    int id =0;

    foreach(DirectoryEntry entry in webSites)

    <snip>

     

    Everything runs fine on our Windows 2003 servers, but now we are attempting to run our installer on a new Windows 2008 server with IIS7.  When the code hits the last line above, it throws an Access Denied exception.  The serverName variable is "localhost".  The account I am logged in with is an adminstrator account.  I have attempted to add II6 Metabase Compatability.  Ive tried adding write permissions on the wwwroot directory to IIS_IUSRS.  No change.  At this point I'm stumped. 

     Any thoughts or suggestions?

     

  • 09-15-2008, 9:13 PM In reply to

    • mukhtard
    • Top 25 Contributor
    • Joined on 07-07-2008, 9:13 PM
    • Redmond, WA
    • Posts 165

    Re: Access Denied

    What identity is the code running as?
    Can you try the overload of the DirectoryEntry constructor that takes a username and password?

    Thanks,
    Mukhtar Desai
    IIS Performance Team

     

  • 09-17-2008, 11:13 AM In reply to

    Re: Access Denied

    Well, it seems that our IT guy was able to make the problem go away by re-configuring IIS 7, but I haven't been able to divine exactly what he changed that made it work.  I will report back when I find out.  The good news is that our code now runs with IIS 7 without modification.  I am finding it strange that even though an account may be an administrator on a Win2008 box, there are still a lot of things off limits. 

     

Page 1 of 1 (3 items)
Page view counter