Richard Banks
Richard Banks

Reputation: 2983

asp.net and permissions on a share

I have an app that needs to update a txt file on another server. The asp.net app runs under iis6.0. Ive tried setting the permissions on the share for the server that runs the app. e.g DOMAIN\ServerA$ however it still says access to path blah blah is denied.

Any ideas?

Upvotes: 0

Views: 185

Answers (4)

Vivian River
Vivian River

Reputation: 32430

This may not be exactly what you're looking for, but if you have a specific userId and password that can access the network share, you can use the code here: http://support.microsoft.com/kb/306158

Upvotes: 0

Joel Etherton
Joel Etherton

Reputation: 37543

First make sure that the path is accessible to the server at all by going their manually using your own account. I don't know anything about your set up where you are (major corporation, mom-and-pop shop, whatever), but if there are security blockages on the network this may be an impossibility to start with. As an example, where I am security does not allow servers to communicate with each other in some of our domains through certain protocols/ports. So if I attempted something like this it would fail automatically because of the firewall restrictions.

Once you're sure the connection can be made, verify that the user account applied to the website's application pool has permission to make the connection. By default this account is set to "Network Service" and it is a local account. This will deny the website such permission. You will need to set this account to domain level service account and make sure that account has permission to make the connection.

Upvotes: 0

Gregory Nozik
Gregory Nozik

Reputation: 3372

You should change in IIS pool identity to user that has permission to folder that you are trying to update.

Upvotes: 1

Widor
Widor

Reputation: 13285

Check that the app isn't passing the user's credentials to the share, e.g Identity.Impersonate or via Windows auth or similar.

Check you have the right account/machine names by writing HttpContext.Current.User.Identity.Name and HttpContext.Current.Server.MachineName to the page.

Upvotes: 0

Related Questions