I have a webservice running under sharepoint, on a bog-standard Server2003/IIS6 setup. This webservice needs to open and read a file from a share on another machine in the same domain. At the moment I am getting a
System.UnauthorizedAccessException: Access to the path '\strand\DROPBOXES\MattTrinder\SharepointShared\bd116dfa-be0e-4c58-93e6-3fb93fa0ef22.tmp' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
What permissions do I need to grant to which accounts to allow this webservice to open and read the file ?
Using "\\sharepointserver\c$" works fine...
Thanks
Matt
The account you grant access to, has to exist on the target (where the share exists) as well (either the same domain account, or a local account with the same password). Since the IIS-user normally has an auto-generated password and is local, this is hard.
The way we solve this, is to run the website as a different user (that we created ourselves), and grant this user permissions to access the share on the remote PC. Note that both the sharing permissions have to be correct, and the file system permissions.
You need to grant read access in the file system level and in the share. The problem is that sharepoint runs (probably, because it can be changed) under network service account that has no access to the network.
options:
If you are using integrated authentication for the web service. Then you have to grant the permissions to the users that the web service client runs under. But don't go this dark path. Because delegation is very hard to configure.
If you have anonymous access to the web service, make sure that the application pool that the web service runs under run with user permission of explicit user that have access to that said file. This can be configured with the sharepoint administration site. Or with computer management mmc.
Classic asmx web services by default run as the IUSR_ account. This may not have permission to access the network path. You can change this to a domain account by changing the application pool identity.
Related
In my asp.net web application I am trying to retrieve images from a shared network folder. When I put this website live in IIS, I am getting an error that "Access to the path is denied" when I try to access the network folder. What is considered the user that IIS uses, and how would I grant permissions to the network folder?
Thank you.
The issue is because your application pool identity or the user that IIS is using to run the worker process does not have permissions on the network path.
You may want to grant this user permission on the network path. However, if you are using IIS AppPoolIdentity that is not possible as they are built-in account per machine. As is the same with any buit-in account.
I would advice you to use a network account and give that account appropriate permissions on both IIS and the network share.
You may have to add this user to the IUSR group.
Everything I've found via search on this talks about Read/Write for local drives only (typically C) and what I am having trouble with is getting the same Read/Write access for an application pool to a non-local drive, specifically a share on the file server.
We've set the Application pool to run the anonymous user under a domain account that we have explicitly verified has full control of the file share and yet the web app that use the application pool is unable to access this non-local share. It can however access a local copy of the shared folder if we copy the folder from the file server to the local drive.
This is a third party app and we'eve followed all the instructions from the vendor and so far this is unresolved. Their support is looking at this but I don't believe they have any idea on what's wrong. This same web app works fine with the same file server share when the web app is running under IIS6 on another sever so its something with IIS7.5. I figure its got to be something particular to IIS7.5 that is not in IIS6 that is the key.
Ideas?
FYI - The application pool is already set to classic mode.
I think that you will have to see the permission that you have. In iss7.5 you have the aplication pool running with an account, It can be a ApplicationpoolIdnetity, or a real one. if you want to access the share the application pool identity has to have rights to do so, or you can impersonate a user and then use the permission that user has to copy to the shared folder, i prefere to use the impersonate, only when is necessary i do the impersonate and do whatever i most do.
I am trying to have my local website within dropbox using IIS. When I add the dropbox directory I get the error: The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path.
I am admin and have allowed all access to the dropbox folder. What is wrong?
You should add IIS user account to the list of users who are allowed to view/read the files. IIS usually runs via separate user account for security reasons.
This is done the following way:
Right-click on your site folder in Dropbox
Select "Security"
Click "Add"
Find IUSR user and/or IIS_IUSRS group
Add them both (or one, if only one is present) and assign them read permissions
Try adding your site folder again.
This should fix the issue.
I am learning how to setup a shared hosting web server.
As a server administrator whose the highest access level in the server, I want to grant my friends as site administrators access to their own sites.
The question is:
What is the best way to setup their accounts and what level of access should be granted to them?
Edit 1:
I want them to have remote access to their own resources using IIS Manager. By this way, I can mimic a real shared-hosting server.
You can install a FTP server. And assign the permission to access a folder for a user with user name and password.
Use the delegated administration on IIS.
IIS5 is running on SERVER1.
One of the virtual directories in IIS, myfiles, is pointing to "A shared location on another computer", //SERVER2/myfilesshare
When I try to access the page:
http://SERVER1/myfiles
... I get the error:
You are not authorized to view this page
HTTP 401.1 - Unauthorized: Logon Failed
Internet Information Services
I have triple-checked the "Connect As..." settings in IIS. The credentials I'm using to access the share are correct-- they work when connect to the share in Windows Explorer, but not through the IIS virtual directory.
I've tried granting full permission to Everyone on the folder in SERVER2, but no luck.
Any thoughts?
This was how I solved my problem, might help you.
By default, IIS uses local user called IUSR for virtual directories when using anonymous authentication. It does not use application identity, which should be obvious, if you use procmon.
How can you force it to use application identity?
Easy, under IIS manager:
1) go to Authentication
2) Edit "Anonymous authentication"
3) Select "Application pool identity"
4) Restart IIS & it should work.
The same accomplished with PS: Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name username -value ""
This link contains the pros/cons: http://blogs.technet.com/b/tristank/archive/2011/12/22/iusr-vs-application-pool-identity-why-use-either.aspx
Permission issues can be tricky. Try running filemon on the 'other computer' It can be downloaded over here: http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx
(it's not a big application just a tiny lightweight tool)
After you've started filemon, stop the monitor process (I believe it's turned on by default when you start the application), clear the logged data, create a filter for the folder you have trouble getting access to. Start the monitor process. Request your webpage. Stop the monitor process and look for "access denied" messages in filemon. When found, filemon will also mention the name of the actual user which is trying to get access. This might help you to get to a solution.
Btw when using Windows Server 2008 you will need processmon instead: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Imagine a scenario where for whatever reason you want to have your IIS Server access a Share on a File server and they are not on the same domain.
If you can follow and get this to work for you (I have done it Win2008-R1 32-bit File Server and Win2008-R2 64-bit with IIS 7), then you should be in good shape for any scenario.
Same name local account on both servers with same password
On IIS, use aspnet_regiis -ga MyAccount to give local account access to IIS guts
Now use that as the Application Pool Identity of the Website
Using Local Security Policy (Admin Tools) enable trust for delegation for local account
Restart IIS server
On File Server, use Local Security Policy to enable access from network for local account
Create Share granting desired permissions to local account (also Security tab permissions as needed)
Open up File & Print Sharing ports on both (as restrictive as possible) to point where it works for you when you are using Windows Explorer between the two
Back to IIS, create Virtual Directory using UNC path to Shared folder from File Server
Just use Pass-through authentication (which would use your local account)
You can tell Anonymous Authentication setting of the Virtual Directory to use Application Pool Identity as well
Use something that will test/verify. The key really is trust for delegation using a Service Account (domain or otherwise), and having IIS use the account you want it to use instead of Local Server or Network Service.
This took me all day to figure out. Various threads in StackOverflow and other Internet sources helped point me to various resources me but didn't find my exact answer anywhere. Hopefully next person stuck with this problem will get a speed boost on the path to resolving with my description of what worked for me.
try enabling windows authentication on the virtual directory security tab (in IIS).