Windows: Can I map a network drive for a service account?
Solution 1:
Do like this with the psexec utility:
Open an elevated cmd.exe prompt (Run as administrator). Then, do psexec -i -s cmd.exe
. You are now "nt authority\system" :) Now, all you have to do is net use z: \servername\sharedfolder /persistent:yes
Keep in mind if you need to delete the mapped drive you will have to do it in the same way (instead doing net use z: /del
).
Solution 2:
Persistant drive mappings are only restored during an interactive login, which the service does not use. I believe the only way to get a service to use a network drive is for that service to map the drive itself or alternatively for it to us a UNC path instead of a mapped drive.