Read file from ASP.NET on the mapped network drive

  • Thread starter Thread starter Michal Valent
  • Start date Start date
M

Michal Valent

Hello,
if I try to read a file on the mapped network drive,
this error apears:

Logon failure: unknown user name or bad password.

How to set up permissions for IUSR_MACHINENAME
on the mapped network drive?

Thaks

Miso
 
You are better served to pull the file under another identity. This can be
done in a variety of ways.

1. Create an assembly that will sit in COM+ and set identity there
2. Spawn a new thread and set it under an identity that has access

If, however, you want to go the way you are heading, the easiest manner is
to set up the password for the IUSR_ account and create an identical
account, with the same password, on the other machine. This works well on
many installs. The only other suggestion is to have the IUSR_ account as a
domain account, but this would require a lot of registry tweaking, if it
works at all.

Of all of the suggestions, the first section contains the better options, as
it adds a layer of protection from hacks.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
----- Cowboy (Gregory A. Beamer) wrote: -----

You are better served to pull the file under another identity. This can be
done in a variety of ways.

1. Create an assembly that will sit in COM+ and set identity there
2. Spawn a new thread and set it under an identity that has access

If, however, you want to go the way you are heading, the easiest manner is
to set up the password for the IUSR_ account and create an identical
account, with the same password, on the other machine. This works well on
many installs. The only other suggestion is to have the IUSR_ account as a
domain account, but this would require a lot of registry tweaking, if it
works at all.

Of all of the suggestions, the first section contains the better options, as
it adds a layer of protection from hacks.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
Michal Valent said:
Hello,
if I try to read a file on the mapped network drive,
this error apears:


Hi Gregory ,
I do have the same problem but i need to do a context switch but I don'know how to do this.


Test on:
----------------
WebServer Windows 2000 Server sp4, IIS 5.0
FileServer Windows 2000 Server sp4

Problem:
-------------
aspx page is unable to read/write files that are located on a network share

SetUp:
----------
The WebServer has a share to the FileServer drive which is granted to
the WebServer Administrator only and can not be granted to any other user!!

changed:
-------------
Server Setup (Windows 2000 server only!)
- Logon to the server as an administrator
- Open up the machines local security policy (start>run>secpol.msc)
- Expand Security Settings, Local Policies, User Rights Assignment
Double click Act as part of the operating system
Click Add User or Group, enter the worker process account name (ASPNET) and click OK, and OK again

In order for this change to become effective, the web server will have to be rebooted.

my application web.config
<identity impersonate="true" userName="Administrator" password="enter_Your_PASSWORD_here"/>


if you like I can send you the project file as well
what ever I tried nothing worked, I can check for FileExist but OpenRead will give access denied

thanks in advanced
reinhard
 
Back
Top