471,092 Members | 1,731 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

How to access UNC from ASP.NET application?

I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince
Apr 19 '07 #1
7 4621
re:
Note that I have allowed Full Control permission on abc.txt on the other machine.
To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows
server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other machine.

any idea?

thanks,
Vince

Apr 19 '07 #2
Say we have two servers: A & B.
On B, I do
1. Right click on C:\SharedFolder and share it out
2. Under Sharing - Permissions, I allow Everyone to have Full Control
3. Under Security, I adde an object Server-B\ASPNET and allow Full Control
to it. (I wanted to allow Server-A\ASPNET but can't change the location to
Server-A)

Then on A, I map X: drive to Server-B\SharedFolder and have my ASP.NET code
to write to X:\
I also tried using \\Server-B\SharedFolder but got the same problem.

Any comments are more than welcome

thanks,
Speech Lover

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
re:
>Note that I have allowed Full Control permission on abc.txt on the other
machine.

To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince


Apr 19 '07 #3
re:
3. Under Security, I adde an object Server-B\ASPNET and allow Full Control to it. (I wanted to
allow Server-A\ASPNET but can't change the location to Server-A)
The problem is that the account which is accessing B's C:\SharedFolder
is the one which needs access permissions.

If you can't grant access permissions on B's C:\SharedFolder to the A account
which ASP.NET is running as, ASP.NET will not be able to access that resource.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Say we have two servers: A & B.
On B, I do
1. Right click on C:\SharedFolder and share it out
2. Under Sharing - Permissions, I allow Everyone to have Full Control
3. Under Security, I adde an object Server-B\ASPNET and allow Full Control to it. (I wanted to
allow Server-A\ASPNET but can't change the location to Server-A)

Then on A, I map X: drive to Server-B\SharedFolder and have my ASP.NET code to write to X:\
I also tried using \\Server-B\SharedFolder but got the same problem.

Any comments are more than welcome

thanks,
Speech Lover

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
>re:
>>Note that I have allowed Full Control permission on abc.txt on the other machine.

To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>>I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows
server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other machine.

any idea?

thanks,
Vince



Apr 19 '07 #4
I am just a newbie to networking.
From Server-B, I open up Network Places and I am able to see both Server-A
and Server-B under the same WORKGROUP.
I click on "Locations..." but I don't see Server-A there. Nor can I click
and browse a different location.

Could you tell me what I need to do to allow me to select a different server
from "Locations.."?

Many Thanks!
Speech Lover
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:uj**************@TK2MSFTNGP05.phx.gbl...
re:
>3. Under Security, I adde an object Server-B\ASPNET and allow Full
Control to it. (I wanted to allow Server-A\ASPNET but can't change the
location to Server-A)

The problem is that the account which is accessing B's C:\SharedFolder
is the one which needs access permissions.

If you can't grant access permissions on B's C:\SharedFolder to the A
account
which ASP.NET is running as, ASP.NET will not be able to access that
resource.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Say we have two servers: A & B.
On B, I do
1. Right click on C:\SharedFolder and share it out
2. Under Sharing - Permissions, I allow Everyone to have Full Control
3. Under Security, I adde an object Server-B\ASPNET and allow Full
Control to it. (I wanted to allow Server-A\ASPNET but can't change the
location to Server-A)

Then on A, I map X: drive to Server-B\SharedFolder and have my ASP.NET
code to write to X:\
I also tried using \\Server-B\SharedFolder but got the same problem.

Any comments are more than welcome

thanks,
Speech Lover

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
>>re:
Note that I have allowed Full Control permission on abc.txt on the
other machine.

To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl.. .
I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the
other machine.

any idea?

thanks,
Vince



Apr 19 '07 #5
I suggest you use impersonation to have ASP.NET run under a different user
account that has the necessary network access.
At first, for testing purposes, I'd suggest you have it run under your user
account since you know you have the required access to the folder.

<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince
Apr 19 '07 #6
Hi Steve,

Let me tell you more details:

A small WORKGROUP has two Windows Server 2003 servers - server A & server B.
I have installed an application on server A and by default it runs under
the
account "Network Service".
This application writes files to a local directory without any problem but
when
I use UNC format to write files to server B, it fails.

Note that on server B I have also granted full control permission to
account
"Network Service".

What needs to be done to allow "Network Service" account to write to a
network shared folder?

In WORKGROUP environment, shouldn't "Network Service" account on both
two servers take care of the authenticaion issue?

thanks,
Vince
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:D9**********************************@microsof t.com...
>I suggest you use impersonation to have ASP.NET run under a different user
account that has the necessary network access.
At first, for testing purposes, I'd suggest you have it run under your
user account since you know you have the required access to the folder.

<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince

Apr 19 '07 #7
Network Service is an account *local* to the W2K3 server.
Its identity isn't usable by other servers.

IOW, server A's "Network Service" account is local to Server A,
and cannot access Server B's shared folder.

re:
!In WORKGROUP environment, shouldn't "Network Service" account on both
!two servers take care of the authenticaion issue?

No. They are different accounts, local to each server.

Setup a user account on server A and, as Steve suggests,
impersonate that user and give that account access permissions to the shared folder.

As Steve suggested, write this entry in web.config :
<!-- Web.config file. -->

<identity impersonate="true" userName="ServerA\Accountname" password="pass"/>

Here's the instructions to create the service account :
http://msdn2.microsoft.com/en-us/library/ms998297.aspx

To be on the safe side, verify that the following ACLs have been set on Server A:
http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:uB**************@TK2MSFTNGP03.phx.gbl...
Hi Steve,

Let me tell you more details:

A small WORKGROUP has two Windows Server 2003 servers - server A & server B.
I have installed an application on server A and by default it runs under the
account "Network Service".
This application writes files to a local directory without any problem but when
I use UNC format to write files to server B, it fails.

Note that on server B I have also granted full control permission to account
"Network Service".

What needs to be done to allow "Network Service" account to write to a
network shared folder?

In WORKGROUP environment, shouldn't "Network Service" account on both
two servers take care of the authenticaion issue?

thanks,
Vince
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in message
news:D9**********************************@microsof t.com...
>>I suggest you use impersonation to have ASP.NET run under a different user account that has the
necessary network access.
At first, for testing purposes, I'd suggest you have it run under your user account since you
know you have the required access to the folder.

<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>>I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows
server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other machine.

any idea?

thanks,
Vince


Apr 19 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

63 posts views Thread by Jerome | last post: by
5 posts views Thread by toddles666 | last post: by
17 posts views Thread by Mell via AccessMonster.com | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.