1

I have a windows service, which requires access to a network drive. As Windows Service does not perform interactive logon, it's not possible to use mapped drive from active directory user logon script. Which would be the best - secure and elegant way to provide a network drive for such a windows service? A helper script? Or, is there any other solution?

/Windows 2008

Update: Unfortunately, this services does not allow to use UNC path, otherwise we would gladly use our domain shares.

Access to a network share is our requirement. Service is able to use shares mapped to a letters. It's not the most elegant way, though.

Tomasz Szkudlarek
  • 97
  • 1
  • 2
  • 10
  • 1
    The service can't use a UNC path? (Why?) – rtf Sep 23 '13 at 14:44
  • Don't know why. It does not accept UNCs. – Tomasz Szkudlarek Sep 23 '13 at 14:50
  • What account is the service running under? – TheCleaner Sep 23 '13 at 15:07
  • The service requires access to a network drive but doesn't support UNC paths? Well then you're out of luck. How is it that the service was built with a dependency that it doesn't support? Talk about a catch-22... – joeqwerty Sep 23 '13 at 15:12
  • This service somehow tests by itselfs validity of path. That's the problem. Just to clarify. This service does not require explicit access to a network share. By default it supports only letter drives (including these mapped to a letters). But we want to use a network share. – Tomasz Szkudlarek Sep 24 '13 at 07:44

1 Answers1

5

As drive letters are ephemeral, it would be best to use UNC paths instead of drive letters. If the service is unable to handle UNC paths, consider creating a symlink to the destination like

mklink c:\remotenetdir \\server\remote\netdir

and use the local path (c:\remotenetdir) in the service configuration.

Obviously, the service account would need to have the permission to access \\server\remote\netdir for this to work.

the-wabbit
  • 40,319
  • 13
  • 105
  • 169