Cannot connect to a running process launched by an NT service

Hi all,

I have an application that consists of an NT service which, upon startup,
launches another process. This process contains a COM object which can be
instantiated by remote clients. The DCOM configuration for the object
specifies that the object should run under a specific user account. I have
also given Everyone access to the object, but I have given no-one permission
to launch the object.

The service runs under the System Account and launches the process (via
CreateProcessAsUser) in the security context of the user account specified
for the COM object. Before launching the process, I also load the user's
profile. The service is configured to start Automatic when the system is
booted.

Now here's the problem: when I log on interactively and start the service,
the service loads the process and I can remotely create the COM object
within the launched process. *However*, if I reboot the machine (note, the
service starts automatically) and do *not* log on interactively, I get an
Access Denied error when I attempt to remotely connect to the launched
process. If I examine the Event Log on the server machine, there is a DCOM
error on the System page stating "Access Denied attempting to launch a DCOM
server". So for some reason, the server is not recognising that the COM
server process is already running and is attempting to launch a new
instance.

Has anyone had similar problems, and if so, can you tell me what I am
missing?

Thanks in advance,

Marcus Graham
Stamina Software Pty Ltd