I have two servers running Windows Server 2003, and I want copy files from one server (A), programmatically with a windows service running under the Local System account, to a shared folder on the other (B). I keep getting "access denied" errors, and I can't figure out what security settings I need to set to open the shared folder for writing.
This is what I've done on the recieving end:
- On A, right-click on the folder to share, choose the tab "Sharing" and select "Share this folder". Set a share name.
- Click "Permissions", add the group "Everyone" and give it full control.
I tried choosing the "Security" tab to give some permissions there as well, but the "Add" dialog only finds local users, despite the fact that B shows up in the "Workgroup computers" dialog. After further inspection, this is the case also for the "Permissions" dialog under the "Sharing" tab (are they the same?).
Update: I have done some further research, and found that the program on server A is run under the SYSTEM account. This is not something I dare change, because of the risk to break other things that this program also does (it's a build agent on our TeamCity CI server).
Thus, I need a way to give A\SYSTEM access to write in a shared folder on B, in a workgroup environment.
Update 2: I've now been able to do the following changes to my configuration:
- There is a user account on each server named TeamCity. They have the same passwords, and are both parts of their respective Administrators group (which I've verified by logging on via remote desktop to both servers using the same information).
- TeamCity (specifically \\B\TeamCity) has full control access to the shared folder on B.
- The build agent on A runs under the \\A\TeamCity account.
When I try to copy files this time, I get an error stating
Could not find part of the path '\\B\Shared.Folder.Name'
I can copy the path from the error message and paste it into the address bar in Windows Explorer when logged on to the TeamCity account via Remote Desktop, and explorer navigates to the shared folder on B.