Bob/Scott
Very useful article, here's the C# version....
ConnectionOptions co = new ConnectionOptions();
co.Username = "userName";
co.Password = "password";
ManagementScope scope = new ManagementScope( @"\\myServer\root\cimv2", co );
ObjectQuery query = new ObjectQuery( "select * from win32_service" );
ManagementObjectSearcher mos = new ManagementObjectSearcher( scope, query );
ManagementObjectCollection moc = mos.Get();
foreach ( ManagementObject mo in moc )
{
Console.WriteLine( "{0} : {1}", mo["Name"].ToString(),
mo["State"].ToString() );
}
Check this link out for more info on Win32_Service
http://msdn.microsoft.com/library/de...us/wmisdk/wmi/
win32_service.asp
HTH
Glenn
" <bitmask@[nospam].fred.net> wrote in message
news:49********************************@4ax.com...
Hi Bob:
Here is an article describing a script to enumerate services on remote
machines:
http://www.microsoft.com/technet/com...ts/sg1102.mspx
You should be able to port this to C# using classes in the
System.Management namespace.
HTH,
--
Scott
http://www.OdeToCode.com
On Wed, 25 Aug 2004 06:37:58 -0400, "Bob Lazarchik"
<bo*****@sditampa.com> wrote:
Hello:
We manufacture tools used in the Semiconductor industry that have a DB
engine running on each one. I need to scan through the computers on the
company domain and find which ones have this service installed and it's
current state ( paused, running, stopped, etc ). Can anyone point me to
aset of classes in C# that allow me to find running services on computers
within a Domain?
Thanks for your help
Bob Lazarchik
SDI.