3

I have an application running as a service under a certain user, but for some reason when the machine is (re)started and the service starts it does not load that particular user's profile (including its drive-mappings etc).

Is there any way to specify that for a service the full (local) profile (incl. the mappings) is loaded?

The machine is a win2k sp2 enterprise edition.

Starfish
  • 2,735
  • 25
  • 28
  • 3
    Duplicate, see http://serverfault.com/questions/4623/windows-can-i-map-a-network-drive-for-a-service-account – chankster Jun 29 '09 at 12:38

3 Answers3

1

As far as I know, USERINIT.EXE restores the "mapped drives" specified in the profile of a user. The user's profile will load, when logging-on to run a service, but USERINIT.EXE isn't going to get called and the "mapped drives" won't be restored.

Evan Anderson
  • 141,881
  • 20
  • 196
  • 331
1

I'm not sure I know a way to do this.

Generally, drive mappings are part of an active-user, interactive log on session and drives don't get mapped when user credentials are used for service sessions.

Depending on what you're trying to do and what the application in question will tolerate, could you use the actual UNC path of the mapped-drive resource instead?

This is generally what we do for access to remote resources when there's no logged on session. For example, run a script as a scheduled task under with the needed credentials and then target the UNC instead of a mapped drive.

Also, though it won't work in your case with Windows 2000, my understanding is that Server 2008 supports symlinks to network resources.

damorg
  • 1,226
  • 7
  • 10
  • Unfortunately not, I can't. The trouble is that these mappings are needed for the application itself (it reads data that already contains hard links to e.g. 'n:\...' which is mapped during logon for all users in the domain automatically to a server-share. As it seems (also in the duplicate/other post chankster mentioned), I either do have to build in a workaround that uses UNC paths (and knows about the mappings and handles them in the code for the links to them), or map these drives in the service-app itself each time started. Meh. But thanks! – Jörg Battermann Jun 29 '09 at 22:37
0

How is the application running as a service? Is it an internal function of that application or are you using another means to moke a non-service run as a service? The reason I ask is that for the later you could run a batch file wich maps the drives before calling the main application.

Silly question perhaps but those drives were mapped with persistence were they not?

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109