0

I am currently developing an application where it would be deployed on a different server computer. The app will access a network path (\drivename\folder) using a its own account credentials on a different domain. When trying to access the drive path from the server computer to be deployed, it shows exactly like the following image. I also noticed that the current login user account's domain and the account the application will use have different domains.

enter image description here

I would like to know if there is any way to access a network path in a different domain from the server using an account made for the application and not using the current login user account? I currently have 3 accounts and they are all as follows:

Drive Path: \drivename\folder

Account for application: testdomain\appusername

Account I used to access the server: domain\adminusername

Account that is currently logged in to the server: domain\serverusername

I remote accessed the server computer with an admin account(domain\adminusername) and the application worked, with those credentials I can access the network drive and copy and paste the files in there. I checked and the current user in the application was the adminusername.

But when I used the account that was made for the application (testdomain\appusername), I could not access it.

I tried user impersonation, netCache, NetworkCredential but none seems to be working. I think the error also seemed to occur only when I try to copy the files from the serverpath or when I try to copy to them.

Currently having the following error when tried to create a folder on the drive path using the testdomain\appusername. It says like access to the path \servername\folder is denied. at System.Io._Error.WinIOError(Int32 errorCode, String maybeFullPath) at system.io.directory.internalcreatedirectory(string fullpath, string path, object dirsecurityobj, boolean checkhost) at sytem.ioi.directory.internalcreatedirectoryhelper(string path, boolean checkhost) at system.io.directory.createdirectory(string path)

sophia
  • 3
  • 4
  • The following may be of interest: https://stackoverflow.com/questions/75398909/access-denied-while-accessing-a-file-in-windows-shared-location and https://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a-network-share – Tu deschizi eu inchid Apr 10 '23 at 16:29

0 Answers0