<p>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 </p>

<p>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)</p>

<p>What permissions do I need to grant to which accounts to allow this webservice to open and read the file ?</p>

<p>Using "\\sharepointserver\c$" works fine...</p>

<p>Thanks</p>

<p>Matt</p>

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.