The site is served by Windows Server 2012 IIS 8.
Worker process uses ApplicationPoolIdentity of IIS APPPOOL\AppPoolName.
Server\UserName has necessary permissions to \\Server\SharedFolder.
This code (simplified) works well from Visual Studio 2012 on client across intranet.
IO.File.WriteAllText("\\Server\SharedFolder\Do.cmd", "type ""asdf"" > \\Server\SharedFolder\Text.txt") Dim psi As New ProcessStartInfo psi.FileName = "\\Server\SharedFolder\Do.cmd" Process.Start(psi)
Once published, over internet, it yields an error.
System.UnauthorizedAccessException: Access to the path '\\Server\SharedFolder\Text.txt' is denied.
The error persists, even having granted inheritable NTFS and Share permissions to \\Server\SharedFolder for IUSR, IIS_IUSRS, IIS APPPOOL\AppPoolName, SYSTEM, NETWORK SERVICE, LOCAL SERVICE, Server\UserName, as well as Everyone, as much as Full Control!
Impersonating Server\UserName does not help.
However, this unacceptable workaround by inserting hardcoded UserName and Password does get rid of the exception over internet.
IO.File.WriteAllText("\\Server\SharedFolder\Do.cmd", "type ""asdf"" > \\Server\SharedFolder\Text.txt") Dim psi As New ProcessStartInfo psi.FileName = "\\Server\SharedFolder\Do.cmd" psi.UserName = "UserName" Dim ss As New System.Security.SecureString For Each c In "Password" ss.AppendChar(c) Next psi.Password = ss Process.Start(psi)
Rather than inserting hardcoded UserName and Password, what NTFS or Share permission is required to access \\Server\SharedFolder over internet?