Windows 7 Check if remote service is running

Discussion in 'Programming and Scripting' started by alberto, Oct 23, 2012.

  1. alberto

    alberto New Member

    Joined:
    May 31, 2012
    Messages:
    248
    Likes Received:
    1
    Hi everybody, I'll get straight to the point: I am trying to write a script, program, whatever to check if a service is running on a remote host.
    My idea was to get this to run on a Win 7 Enterprise machine, check if a specific service (SQL Server Agent) is running on a bunch of remote hosts (Windows Server 2008 r2) and send a quick email with the status of my services.
    I wanted it to run on the Windows 7 machine so as not to overload the servers. Of course I have admin access to all of the servers.

    I know I could write a .NET program that check if the service is running locally and then call that program remotely, but I'd prefer all the computation to happen client-side and using the .NET framework so as not to install anything unnecessary on the servers.

    So, does anyone know how I can query a remote service to check if it's up or not?

    Thanks in advance!
     
  2. alberto

    alberto New Member

    Joined:
    May 31, 2012
    Messages:
    248
    Likes Received:
    1
    Hi folks, never mind, I found a solution.
    In case anyone is interested check out the sc.exe command line utility that comes with Windows.
     

Share This Page

Loading...