Unable to access a windows share using UNC path

network-sharewindows-service

I'm trying to understand why my application running as a windows service as Local System account cannot access a shared folder on another PC using a UNC path.

Yet the same application can access a shared folder on a NAS device.

More detail:

I have a java app which reads the contents of a directory based on a UNC path.

When not run as a windows service the application can read both folder shares on other PC's as well as NAS devices.

Is it because the NAS device (Buffalo LinkStation) is using SAMBA? (Out of my confort zone here but that's the only thing I can think of)

If that's the case does it mean I would have to create an admin user for this service in order for it to work rather than local system account?

Best Answer

I suspect that the NAS device's share has guest enabled, or the computer name has rights to that share.

Local System has the privileges of the machine account on the network. (Both users and computers have AD accounts, yes.) For more information, see this link.

So yes, you'll need to add the account COMPUTERNAME$ (whatever the machine is named) to the share for the application to be able to access it.