Service Restart - (Client - Server Architecture)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mphanke

    Service Restart - (Client - Server Architecture)

    Hi,

    I have a Service which is running on a remote Server in a local
    intranet. I want to have the possibility to restart the service from a
    remote location on the intranet.

    I have realized all the TCP handling an registry reading (with help of
    the community - thanks!) - now the last task left is to implement an
    remote restart.

    Any hints on how to implement this??

    Thanks,

    Martin
  • David Browne

    #2
    Re: Service Restart - (Client - Server Architecture)


    "mphanke" <mphanke@nospam .nospam> wrote in message
    news:OqMIBVP7EH A.2196@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Hi,
    >
    > I have a Service which is running on a remote Server in a local intranet.
    > I want to have the possibility to restart the service from a remote
    > location on the intranet.
    >
    > I have realized all the TCP handling an registry reading (with help of the
    > community - thanks!) - now the last task left is to implement an remote
    > restart.
    >
    > Any hints on how to implement this??
    >[/color]

    System.ServiceP rocess.ServiceC ontroller

    Does this.

    David


    Comment

    • Peter Huang [MSFT]

      #3
      Re: Service Restart - (Client - Server Architecture)

      Hi

      I agree with David's suggestion, and there are some links in the MSDN about
      this.
      Creating ServiceControll er Component Instances

      vbtskcreatingse rvicecontroller componentinstan ces.asp

      Monitoring Windows Services

      vbtskcreatingse rvicecontroller componentinstan ces.asp

      Best regards,

      Perter Huang
      Microsoft Online Partner Support

      Get Secure! - www.microsoft.com/security
      This posting is provided "AS IS" with no warranties, and confers no rights.

      Comment

      • mphanke

        #4
        Re: Service Restart - (Client - Server Architecture)

        Hi,

        thanks for your help so far! But I still have a tiny problem:

        How can I connect to a remote machine and force the Service to restart??

        What I tried was to set the name of our test-server ("JARJAR") and tried
        to connect from a local test-client ("GOWRON").

        The problem is if I try to connect to JARJAR, GOWRON throws an exception
        saying I need some privileges...

        ex.message = "Cannot open Service Control Manager on computer 'JARJAR'.
        This operation might require other privileges."

        Any suggestion on how to solve this??

        Martin

        Peter Huang [MSFT] wrote:[color=blue]
        > Hi
        >
        > I agree with David's suggestion, and there are some links in the MSDN about
        > this.
        > Creating ServiceControll er Component Instances
        > http://msdn.microsoft.com/library/de...us/vbcon/html/
        > vbtskcreatingse rvicecontroller componentinstan ces.asp
        >
        > Monitoring Windows Services
        > http://msdn.microsoft.com/library/de...us/vbcon/html/
        > vbtskcreatingse rvicecontroller componentinstan ces.asp
        >
        > Best regards,
        >
        > Perter Huang
        > Microsoft Online Partner Support
        >
        > Get Secure! - www.microsoft.com/security
        > This posting is provided "AS IS" with no warranties, and confers no rights.
        >[/color]

        Comment

        • David Browne

          #5
          Re: Service Restart - (Client - Server Architecture)


          "mphanke" <mphanke@nospam .nospam> wrote in message
          news:%23PBoefY7 EHA.3756@TK2MSF TNGP14.phx.gbl. ..[color=blue]
          > Hi,
          >
          > thanks for your help so far! But I still have a tiny problem:
          >
          > How can I connect to a remote machine and force the Service to restart??
          >
          > What I tried was to set the name of our test-server ("JARJAR") and tried
          > to connect from a local test-client ("GOWRON").
          >
          > The problem is if I try to connect to JARJAR, GOWRON throws an exception
          > saying I need some privileges...
          >
          > ex.message = "Cannot open Service Control Manager on computer 'JARJAR'.
          > This operation might require other privileges."
          >
          > Any suggestion on how to solve this??[/color]

          Of course you do need some privileges on the remote computer to start and
          stop its services. You need to be an administrator of JARJAR.

          David


          Comment

          • mphanke

            #6
            Re: Service Restart - (Client - Server Architecture)

            this is exactly the problem! I AM the admin of JARJAR... This makes me
            go wild about this....


            Martin

            David Browne wrote:[color=blue]
            > "mphanke" <mphanke@nospam .nospam> wrote in message
            > news:%23PBoefY7 EHA.3756@TK2MSF TNGP14.phx.gbl. ..
            >[color=green]
            >>Hi,
            >>
            >>thanks for your help so far! But I still have a tiny problem:
            >>
            >>How can I connect to a remote machine and force the Service to restart??
            >>
            >>What I tried was to set the name of our test-server ("JARJAR") and tried
            >>to connect from a local test-client ("GOWRON").
            >>
            >>The problem is if I try to connect to JARJAR, GOWRON throws an exception
            >>saying I need some privileges...
            >>
            >>ex.message = "Cannot open Service Control Manager on computer 'JARJAR'.
            >>This operation might require other privileges."
            >>
            >>Any suggestion on how to solve this??[/color]
            >
            >
            > Of course you do need some privileges on the remote computer to start and
            > stop its services. You need to be an administrator of JARJAR.
            >
            > David
            >
            >[/color]

            Comment

            • Willy Denoyette [MVP]

              #7
              Re: Service Restart - (Client - Server Architecture)


              "mphanke" <mphanke@nospam .nospam> wrote in message
              news:ePG%23NTc7 EHA.3592@TK2MSF TNGP09.phx.gbl. ..[color=blue]
              > this is exactly the problem! I AM the admin of JARJAR... This makes me go
              > wild about this....
              >
              >
              > Martin
              >[/color]

              How can you be an admin on JARJAR when running code on GOWRON?
              You can't be an admin on two different systems unless the credentials
              (userID and password) are the same on both boxes (and this could even become
              problematic on XP SP2 and W2K3 SP1).

              Willy.


              Comment

              • Peter Huang [MSFT]

                #8
                Re: Service Restart - (Client - Server Architecture)

                Hi

                Do you mean you are using a Domain Account and you have added the the
                account the administrators group?

                Also you may try to investigate the eventlog on the JARJAR machine to see
                if there is any permission deny log.
                1. run eventvwr
                2. select the Security category
                3. rerun the ServiceControle r app
                4. Press F5 to refresh the eventlog
                5. observe the added log to see what account you are using when denied.

                Best regards,

                Perter Huang
                Microsoft Online Partner Support

                Get Secure! - www.microsoft.com/security
                This posting is provided "AS IS" with no warranties, and confers no rights

                Comment

                • mphanke

                  #9
                  Re: Service Restart - (Client - Server Architecture)

                  Hi Peter,

                  I did this - there is no entry in the log! I'm somewhat confused about
                  this...

                  I guess it is what Willy mentioned to be "problemati c" :-)

                  I'll leave the problem aside for now...
                  If I get the time I will come back to this, but for now

                  Thanks to all for the support,

                  Martin

                  Peter Huang [MSFT] wrote:[color=blue]
                  > Hi
                  >
                  > Do you mean you are using a Domain Account and you have added the the
                  > account the administrators group?
                  >
                  > Also you may try to investigate the eventlog on the JARJAR machine to see
                  > if there is any permission deny log.
                  > 1. run eventvwr
                  > 2. select the Security category
                  > 3. rerun the ServiceControle r app
                  > 4. Press F5 to refresh the eventlog
                  > 5. observe the added log to see what account you are using when denied.
                  >
                  > Best regards,
                  >
                  > Perter Huang
                  > Microsoft Online Partner Support
                  >
                  > Get Secure! - www.microsoft.com/security
                  > This posting is provided "AS IS" with no warranties, and confers no rights
                  >[/color]

                  Comment

                  • Peter Huang [MSFT]

                    #10
                    Re: Service Restart - (Client - Server Architecture)

                    Hi

                    Ok.
                    Also no entry in the event log may be caused by that we did not turn on the
                    logon audit.
                    You may try to follow these steps:

                    1. Click Start, click Settings, click Control Panel, click
                    Administrative Tools, and then click Local Security Policy.

                    2. After you open Local Security Policy, in the left Tree View pane,
                    click Security Settings, click Local Policies, and then click Audit
                    Policy.

                    3. Double-click Audit Logon Event and then click Success and Failure.
                    Event Log entries are added under the Security log.

                    4. Do the same thing with the Audit Account Logon Event.

                    You may have a try at your convenience.

                    Best regards,

                    Perter Huang
                    Microsoft Online Partner Support

                    Get Secure! - www.microsoft.com/security
                    This posting is provided "AS IS" with no warranties, and confers no rights.

                    Comment

                    Working...