IIS 401 Unauthorized

Posted on 2004-11-22
Last Modified: 2011-08-18
I am invoking an IIS hosted remote object on a local machine running XP pro.
I'm using Visual Studio .NET to build it.

Every time I execute the applicaition, I get a 401 unauthorised error.

I am using MSDE as a database to return results, and I have set the MACHINE\ASPNET account up.
I don't do servers.
What gives?

Question by:JonnyMX
    LVL 1

    Expert Comment

    did you set up the acess rights for your page in the IIS correctly ?

    i guess you have to allow scripts on the page.

    Author Comment

    I'm only using IIS as an activation agent for a server process, so there isn't really a 'page' in the conventional ASP.NET sense. The WWWroot only holds a config file with a system.runtime.remoting element.

    I don't know if it is IIS denying me - like I said, not good with servers, or if MSDE is denying IIS.
    MSDE is a pig to administer.
    LVL 7

    Accepted Solution

      Error 401 is an IIS unauthorized error, however, it is possible it occured from your remote connection.  Most likely, it is because the web browser/client is not authenticating to the wwwroot.  In Administrative tools, open your IIS manager.  Expand "Web Sites" and find yours.  If you're using the free IIS on WinXP Pro you whould only have one and it would be called "default web site."  Right click on your web site and go to properties.  Click on the "Directory Security" tab there and then click on the "Edit" button under the heading "Anonymous Access and Authentication Control."  Make sure "Anonymous Access" is checked, Allow IIS to Control Password, and toward the bottom, Integrated Windows Authentication.  That should open up your basic read anonymous accesss.  Now what your problem may be, rather than disallowed anonymous access, is that you probably haven't granted rights for users to execute, which you need to do if your root web is executing some sort of .Net app/control for remote connection.  

    Back in your default web site properties window (or which ever site this is if it's on a full IIS version) go to the "Home Directory" tab. Set "Script Source Access" to enabled (if your script/app for remote connection requires such, it may or may not depending on the code itself and how it works, but I would set to enable to begin with until you get it working, then try to disable that feature and see if it breaks).  Now in the same window, Set the "Execute Permissions" listbox to "Scripts and Executables." A remote object is usually going to be an executable, and even if someone is authenticated to the home directory, it would probably return a 401 page if the home page attempts to run an executable for which you have not granted permission.  Try those things and post back...

    I am using a similar setup on this work computer of mine right now (I work in applications development at a large law enforcement agency).  I have my IIS set up as described above and have no problems connecting to remote objects, and I have a SQLremote connection object on mine working fine for anyone to whom I've granted the required SQL access rights in SQL Server.  In other words, the IIS and remote object connections work.

    Author Comment

    Woo Yay.
    Thank you for an excellent and in depth answer. Now working OK.
    I ran the IIS lockdown tool recently, which may have scrambled my settings.
    Thank you kindly.

    Now if you could just do something about my wife's parking tickets...  ;->
    LVL 7

    Expert Comment

    Well, I am doing about 5 jobs right now, one of which is technical writer, so I guess detailed walkthru descriptions are what I do half the day.  Sorry about the tickets though, I'm in the Corrections agency, not the state police...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Phishing is at the top of most security top 10 efforts you should be pursuing in 2016 and beyond. If you don't have phishing incorporated into your Security Awareness Program yet, now is the time. Phishers, and the scams they use, are only going to …
    Ransomware continues to be a growing problem for both personal and business users alike and Antivirus companies are still struggling to find a reliable way to protect you from this dangerous threat.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now