tags:

views:

468

answers:

5

I have an asp page that saves a file to disk.

Currently it works locally, but I need to save the file to a share and I get permission denied.

I had assumed I could just set the app pool to the user that has access to the folder, but it doesn't seem to work.

How do you make classic asp run as a specific user?

A: 

Look at who is running the following:

  • "inetinfo.exe" process
  • "World Wide Web Publishing service"

It should be one of those I believe.

JB King
inetinfo.exe is running as systemWorld Wide Web Publsihing Service is running as the system account.I can't change either of those as they are for the whole server.the w3wp.exe is running as my user (that has access to the share)
Derek Ekins
The worker process is for ASP.Net applications, not classic ASP. Could you change it into ASP.Net instead?
JB King
yeah I realise that, was hoping that classic asp would pick up those permissions as well.can't rewrite in this case unfortunately.
Derek Ekins
Is it possible to put the ASP on the same machine where the share is? I realize this may be a trivial solution but it just an idea I had.
JB King
no, the share is on a SAN and the servers are load balanced :)
Derek Ekins
Darn, back to the drawing board then I guess. ;)
JB King
A: 

Is the program attempting to go to a share on another computer (or this computer), or a folder on the web server which happens to also be a share? When you access it through the \\server\share notation, you are going to have different issues than through the local drive driveletter:\folder\ notation.

If it is a share on another computer, the account will need to have rights to the share as well as rights to the underlying files and must be a domain account.

Cade Roux
it is a share on another computer (actually a SAN).I am using \\computer\sharename with the old file system object. does this not work?
Derek Ekins
+1  A: 

IIS Admin - Website Properties - Directory Security - Edit...

By default it's IUSR_MACHINENAME

wefwfwefwe
so are you saying enable anonymous access and then change the user?if so I tried that and it doesn't work :(
Derek Ekins
Seems like it was caching credentials or something because after reseting iis and closing all browsers/exporer windows it started working :)
Derek Ekins
+1  A: 

I believe that by default classic asp will run under the iis user which is IUSR_MachineName. This can be changed in the IIS Manager.

Good references:

brendan
A: 

It depends on what you are actually doing but you would probably want to avoid giving the whole application a user identity that has network access just to service the needs of this one file.

You can configure in IIS the user identity for anonymous access on that one ASP file, that would be better than setting it for the whole application.

Another option in the intranet environment is to turn off anonymous access for the ASP file and turn on windows integrated access. The clients user account is used for the security context for running the ASP and any subsequent network access it might make.

AnthonyWJones
how do you run a specific asp file as a particular identity?I can't change the way security works too much as that would blow our budget.
Derek Ekins