C# servicecontroller permissions

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: batwater (anonymous_at_discussions.microsoft.com)
Date: 03/16/04


Date: Mon, 15 Mar 2004 17:31:07 -0800

I am trying to restart a service on a remote machine through C#. I am an administrator for that machine and can control the service on the remote pc though the "Services" app in the Administator Tools on my pc. I have also added ASPNET as an administrator to the remote machine (just for testing purposes). I can view all of the services on the remote machine with my C# program, but when I try and start or stop a service, I get an error stating the service was not found even though it exists on the machine and is displayed through ServiceController.GetServices('remote-pc'). I was wondering if there is any security or permission issues that I need to be concerned with. My local pc is running XP pro and the remote pc is running NT.

Note: This code works flawlessly on my local machine.
I am using the code that was cut and pasted from http://www.aspemporium.com/aspEmporium/cshrp/howtos/howto.asp?hid=7

Exception that is received:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.serviceprocess.dll

Additional information: Service myservice was not found on computer 'remote-pc'.

This exception shows up even though I know the service (not misspelled) exists on the remote pc (not misspelled). Does anyone know why this would be happening? Any help is appreciated!

-batwater



Relevant Pages

  • [NT] PNG (Portable Network Graphics) Deflate Heap Corruption Vulnerability (Windows)
    ... Beyond Security would like to welcome Tiscali World Online ... exception filter, overwriting the pointer to the handler with the address ... is set to the address of the unhandled exception filter hook. ...
    (Securiteam)
  • Function names for managed callstack under SOS debugging of .NET 2.0 app
    ... wrote that sets the unhandled exception filter ... unhandled exception filter, and we generate a mini-dump. ... The callstack above happens ...
    (microsoft.public.vsnet.debugging)
  • Re: Session StageVariables
    ... I did read an article about these Unhandle Exceptions that said go to VS Options Debugging\General and uncheck Enable Just My Code, this keeps the Unhandled exception from happening when in Debug mode, but is this just masking the problem? ... So look if you have a worker threads and enclose them into try.. ... We have a base page that gets called on every page and checks for session variables. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Exceptions Thrown in Background Threads
    ... The only time where it is not practical is when the exception actually ... ought not to be in a UE handler. ... One of the fields in the unhandled exception ... app immediately thereafter - the app has no control over this. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SEHException at app startup
    ... Droopy wrote in ... I have the same exception with this previous version so it ... > legacy code but I am not sure this is the reason why the problem ... > Unhandled exception at 0x77f410a2 in IPRRouting.exe: 0xC0000008: Un ...
    (microsoft.public.dotnet.languages.csharp)