Accessing folders on a network share drive

3

This is sort of an open ended question.

I have a C# .net 4.5 application hosted by IIS running on two different machines. Authentication type for both is configured to be Windows authentication.

Both websites run fine.

In the website the user tries to view some data, the website tries to see if it has access the network shared folder path \\fileshareaddress\folder1\folder2 which is part of that data. To check if the user who is logged in has access to write to the folder I just write a temporary file with some temp data and then delete it.

Now the problem is that the application can write to this folder from one of the machines but not from the other. We have checked permissions on that folder. Even tried giving write access to the computer where the application is having trouble but nothing has worked till now. Every time the application try to write a temporary file the unauthorized access exception occurs.

Has anyone seen a problem like this before? What else can I look for?

UPDATE: I have added the web config. The application are running under NETWORKSERVICE identity

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <compilation targetFramework="4.5" debug="true" />
    <httpRuntime targetFramework="4.5" maxRequestLength="1048576" executionTimeout="999999"/>
      <authorization>
        <allow roles="domain\Role1,
                      domain\rol2" />
        <deny users="*" />
      </authorization>
    <customErrors mode="Off" />
    <authentication mode="Windows" />
    <identity impersonate="true" />
  </system.web>
  <connectionStrings>
    <add name="Dash1Connection" connectionString="Data Source=SQLDBServer; Initial Catalog=Dash1;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework;" providerName="AppDatabase"/>
    <add name="DashConnection" connectionString="Data Source=SQLDBServer; Initial Catalog=Dash;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework;" providerName="AppDatabase"/>
  </connectionStrings>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <defaultDocument>
      <files>
        <remove value="default.aspx"/>
        <remove value="iisstart.htm"/>
        <remove value="index.html"/>
        <remove value="index.htm"/>
        <remove value="Default.asp"/>
        <remove value="Default.htm"/>
        <add value="Home.aspx"/>
      </files>
    </defaultDocument>
  </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

hermit

Posted 2017-03-09T22:12:08.670

Reputation: 61

>

  • Are these machines in a domain or workgroup? 2) Where is the target file share...on one of these two machines or somewhere else?
  • < – I say Reinstate Monica – 2017-03-10T03:13:55.600

    These computers are on the same domain. The file share is separate from these machines – hermit – 2017-03-10T03:16:17.077

    See if this helps? http://serverfault.com/a/236302/205065

    – I say Reinstate Monica – 2017-03-10T03:24:35.313

    Also, you can check the destination file server's Security event log to see if any failure audits are being logged when the access attempt fails. – I say Reinstate Monica – 2017-03-10T03:25:52.240

    I have updated the original post with the web config. And the identity is NETWORKSERVICE – hermit – 2017-03-10T16:33:55.127

    No answers