Hi Duffman,
Welcome to MSDN newsgroup.
From your description, you're trying to access and modify a remote UNC
shared folder in your asp.net webservice's webmethod and you're getting
:System.Unautho rizedAccessExce ption: Access to the path <UNC path> is
denied.
which indicate the permission issue, yes?
As for such scenario, there're several things need to pay attention. First
our asp.net webservice's security configuration.
What's your asp.net webservice's hosting server, win2k/iis5 or win2k3 iis6,
they'll have different process model. Anyway, we first need to use a
certain account to running the asp.net webservice so that it is valid to
the remote machine. And since the MACHINE\ASPNET account is a local
account, it's not valid one to remote machines. When using such a account
to access remote resource, the remote server will treat it as a invalid
identity and establish NULL session. So you can use a domain account or a
duplicated mapping local account( which has the same username/password on
both machines) to run your asp.net webservice.
Also, you can check the Eventlog on the the remote UNC share's server which
will provide the error info about the access denied error, you can get
what's the identity used to access the fileshare.
In addition, to allow anonymous user access fileshare, we need to grant
everyone the certain permission. And on W2K3server, there is an additional
privillege named
"Network access: restrict anonymous to Named pipes and shares"
by default it's enabled, you'll need to disable it so as to allow anonyous
access file share.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
Thread-Topic: File access problems
thread-index: AcXJHKxu7A9lpLC ARIOaqFPDDQRmQw ==
X-WBNR-Posting-Host: 206.230.64.253
From: "=?Utf-8?B?RHVmZm1hbg= =?=" <Du*****@newsgr oup.nospam>
Subject: File access problems
Date: Tue, 4 Oct 2005 12:49:03 -0700
Lines: 25
Message-ID: <E7************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8107
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices
Hi,
I have what seems to be a common problem, but the solutions I've found
don't
seem to work. I would like to use a web service to create a file at a UNC
location in a shared file. Currently I'm just running it locally and
saving
the file locally using my machines UNC path.
I have given user ASPNET full control over the folder I want to write the
file to. I've also tried using the web config identity impersonation to
use
my user with full access to the folder.
In each case I error out with the
:System.Unautho rizedAccessExce ption: Access to the path <UNC path> is
denied.
The error occurs when I hit this line.
Dim fw As New
StreamWriter(Sy stem.Configurat ion.Configurati onSettings.AppS ettings("FilePa t
h"), False)
The FilePath is just \\machinename\s haredfolder\fil e
thank you,
--
Duffman
can't get enough of that wonderful Duff