3

I've found quite a few posts that seem to deal with scenarios along these lines, but I can't find a firm answer.

I have a windows service that runs as Network Service. It runs under this account because it must access the SharePoint API on a stand-alone installation of SharePoint.

I need the windows service to launch another process, using Process.Start, also running as Network Service. This process is a separate program developed by someone else that also interacts with SharePoint. My service needs to bring them up, query them for a bit of data, and shut them down (no UI).

The problem is that for some reason the process gets killed immediately after starting. I've tested this against a full SharePoint install (not stand-alone), where the windows service runs as an AD account, and it works fine.

So, I'm thinking that Network Service is not allowed to create a new process? I see no errors in the event viewer at all.

Any help would be greatly appreciated!

  • 2
    You could use [procmon](http://technet.microsoft.com/en-us/sysinternals/bb896645) to see what the process does between when it starts and when it dies? – Andomar Dec 06 '11 at 19:10
  • Yes, that is a good idea - I fired it up but I haven't found the issue yet. The only lead I have is that there might be an issue inside the process I create accessing some files it needs in Program Files. – maltesehamster Dec 07 '11 at 15:50

1 Answers1

2

There is nothing (AFAIK) that stops a process running under Network Service from running another process.

I think this is a red herring - I suspect that the problem is not starting the other process but that the other process is trying to do something not permitted by Network Service.

To determine how about starting something else like "time.exe" with arguments of "/t" - if this works then the problem is not starting the process but running the process.

Ryan
  • 23,871
  • 24
  • 86
  • 132
  • Thanks for confirming that the process should run fine. I'll try running something else like "time.exe" as you suggest. I have noted that I am able to start the process manually outside of my windows service (running under my domain account) and it works fine. But yes, this could turn out to be a red herring. – maltesehamster Dec 07 '11 at 15:53