Specifying Username/Pass as part of a UNC path or map network drives for a windows service

authenticationfile-sharinguncwindows-server-2008

I have a service that I need to be able to write to a network share on another machine using a local account on that machine. To do this I either need to map a network drive that can be seen by the service (logging in as the user the service runs under and mounting the drive does not seem to work), or I need to be able to specify the unc path with a username and password as part of the configuration of my service.

Are either of these things possible?

Best Answer

the above answer should work....but an easier approach would be to create a local account on both boxes with the same username and password. Then set your service to run under that local account name on ServerA and set ServerB's network share permissions to allow for that local account name on ServerB. Since they are the same username and password it should allow access to the share.

Or better still...make a domain account and use that for both ends.