Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 13015
  • Last Modified:

IIS 401 Unauthorized

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?

  • 2
  • 2
1 Solution
did you set up the acess rights for your page in the IIS correctly ?

i guess you have to allow scripts on the page.
JonnyMXAuthor Commented:
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.
  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.
JonnyMXAuthor Commented:
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...  ;->
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...

Featured Post

Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now