473,503 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check Windows Services are still running OK

I don't know if this is the correct newsgroup but I couldn't find one for Windows Services

Is it possible to check that a Windows Service is still running from another machine

The idea being a couple of machines will be running my Windows Services to handle certain parts of our application, these machines will be located in the server room. I would like to create an application that runs on one of the users PC's that checks that these services are still running and haven't had any errors. Is it possible

Thanks in advance
Chris Podmore.
Nov 20 '05 #1
2 5909
Hi Chris,

I think we can use the WMI to do the stuff.
In the .net framework we can use the classes under the system.management
namespace which is a .net wrap of wmi.

Here is code going.
Imports System.Management
Module Module1
Sub Main()
'replace the computername according to your senario.
Dim mc As New
System.Management.ManagementClass("\\computername\ root\cimv2",
"Win32_Service", New ObjectGetOptions)
For Each o As ManagementObject In mc.GetInstances()
Console.WriteLine(o.GetPropertyValue("Name"))
Console.WriteLine(o.GetPropertyValue("State"))
Next
End Sub
End Module

Here is the properties we can get in the Win32_Service.
Win32_Service
http://msdn.microsoft.com/library/de...us/wmisdk/wmi/
win32_service.asp

You may also take a look at the link below.
Take Charge with Windows Management Instrumentation
http://msdn.microsoft.com/library/de...us/dnasdj00/ht
ml/asp00a1.asp

Monitoring and Dynamically Configuring Windows Services
http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/config_winservices.asp


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Thread-Topic: Check Windows Services are still running OK
thread-index: AcRDtC5H2rH66otISW+HC9NT4NoJ2g==
X-WN-Post: microsoft.public.dotnet.languages.vb
From: "=?Utf-8?B?Q2hyaXMgUG9kbW9yZQ==?=" <ch****@newsgroups.nospam>
Subject: Check Windows Services are still running OK
Date: Wed, 26 May 2004 23:31:02 -0700
Lines: 8
Message-ID: <B9**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:205795
NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

I don't know if this is the correct newsgroup but I couldn't find one for Windows Services.

Is it possible to check that a Windows Service is still running from
another machine?

The idea being a couple of machines will be running my Windows Services to
handle certain parts of our application, these machines will be located in
the server room. I would like to create an application that runs on one of
the users PC's that checks that these services are still running and
haven't had any errors. Is it possible?

Thanks in advance.
Chris Podmore.


Nov 20 '05 #2
Peter

Thanks for the reply and links, they appear to be just what I am looking for. At least they will point me in the right direction

Chris.
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5316
by: Bill Grigg | last post by:
Gentlemen, I am hoping to be able to use GForge on my windows PC. To that end I have installed: 1. cygwin 2. reinstalled cygwin and selected cygipc, postgreSQL and a few other things 3. PHP...
2
379
by: JP | last post by:
Can anybody explain me , what is Local System , Local Service and Network Service and how they practically differ from each other. --JP
6
9038
by: tuuky | last post by:
I've created a Windows Service in C# and an installer project for it. I installed the service using the packaged installer project and the service was installed correctly and it runs fine. ...
3
2190
by: Brad Jones | last post by:
Hello, I'm hoping someone can give me some help or guidance here. I'm not sure if this is even the best group to post to for this. Our OEM equipment's software architecture relies heavily on a...
7
8637
by: Mullin Yu | last post by:
if i put the same code at the windows application or console, i can logon to the computer. but, if i put the same code at the windows service and start it, i still can't logon to the machine. ...
7
3850
by: Steve Long | last post by:
In writing a Windows service with .NET, I'm noticing that the process for some services can not be killed with specifically stopping the service. If you try to kill the process with, say task...
3
3667
by: Doug Bailey | last post by:
I am trying to control a Windows Service via a Web Service interface. (I am developing in .NET2003) I am using the ServiceController object which allows me to read the state of the services with...
17
5069
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the...
12
14498
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.