|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Check to see if a server is runningThis is similar to another post I did where I would like to check one server
from another server programmatically (from a service) to see if it is running and then act accordingly if it isn't. Send an email, for instance. Is there an easy way to do this? Thanks, Tom You can always just ping it. This is easily done with the new class in .NET
2.0. ====================================== David McCarter www.vsdntips.com VSDN Tips & Tricks .NET Coding Standards available at: www.cafepress.com/vsdntips.20412485 Show quoteHide quote "tshad" wrote: > This is similar to another post I did where I would like to check one server > from another server programmatically (from a service) to see if it is > running and then act accordingly if it isn't. Send an email, for instance. > > Is there an easy way to do this? > > Thanks, > > Tom > > > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message Unfortunately, I am on VS 2003 and not running 2.0 yet.news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... > You can always just ping it. This is easily done with the new class in > .NET > 2.0. Also, pings are turned of on this machine for security. Thanks, Tom Show quoteHide quote > > ====================================== > David McCarter > www.vsdntips.com > VSDN Tips & Tricks .NET Coding Standards available at: > www.cafepress.com/vsdntips.20412485 > > > "tshad" wrote: > >> This is similar to another post I did where I would like to check one >> server >> from another server programmatically (from a service) to see if it is >> running and then act accordingly if it isn't. Send an email, for >> instance. >> >> Is there an easy way to do this? >> >> Thanks, >> >> Tom >> >> >> Then use WMI. You can get all kinds of info from any server as long as you
have a user name and password for that server. Show quoteHide quote "tshad" wrote: > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... > > You can always just ping it. This is easily done with the new class in > > .NET > > 2.0. > > Unfortunately, I am on VS 2003 and not running 2.0 yet. > > Also, pings are turned of on this machine for security. > > Thanks, > > Tom > > > > ====================================== > > David McCarter > > www.vsdntips.com > > VSDN Tips & Tricks .NET Coding Standards available at: > > www.cafepress.com/vsdntips.20412485 > > > > > > "tshad" wrote: > > > >> This is similar to another post I did where I would like to check one > >> server > >> from another server programmatically (from a service) to see if it is > >> running and then act accordingly if it isn't. Send an email, for > >> instance. > >> > >> Is there an easy way to do this? > >> > >> Thanks, > >> > >> Tom > >> > >> > >> > > > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message Do I need to Load anthing special to use WMI? Add any references?news:BD77A2BA-977A-4424-B25B-835D1827756E@microsoft.com... > Then use WMI. You can get all kinds of info from any server as long as you > have a user name and password for that server. > I am running on an XP Pro using VS 2003 and the servers are W2K3 servers. I will be building Windows services to run on all those machines. Thanks, Tom Show quoteHide quote > "tshad" wrote: > >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >> news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... >> > You can always just ping it. This is easily done with the new class in >> > .NET >> > 2.0. >> >> Unfortunately, I am on VS 2003 and not running 2.0 yet. >> >> Also, pings are turned of on this machine for security. >> >> Thanks, >> >> Tom >> > >> > ====================================== >> > David McCarter >> > www.vsdntips.com >> > VSDN Tips & Tricks .NET Coding Standards available at: >> > www.cafepress.com/vsdntips.20412485 >> > >> > >> > "tshad" wrote: >> > >> >> This is similar to another post I did where I would like to check one >> >> server >> >> from another server programmatically (from a service) to see if it is >> >> running and then act accordingly if it isn't. Send an email, for >> >> instance. >> >> >> >> Is there an easy way to do this? >> >> >> >> Thanks, >> >> >> >> Tom >> >> >> >> >> >> >> >> >> I can do better than that! I have given 4 talks on WMI at various Code Camps
around the western part of the US this year. Below is a link to my slides and sample code. Enjoy! http://blog.davidmccarter.net/PermaLink,guid,3f5e9cc0-d6a6-45a1-9f59-5e844c55ff27.aspx Show quoteHide quote "tshad" wrote: > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > news:BD77A2BA-977A-4424-B25B-835D1827756E@microsoft.com... > > Then use WMI. You can get all kinds of info from any server as long as you > > have a user name and password for that server. > > > Do I need to Load anthing special to use WMI? Add any references? > > I am running on an XP Pro using VS 2003 and the servers are W2K3 servers. I > will be building Windows services to run on all those machines. > > Thanks, > > Tom > > > "tshad" wrote: > > > >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > >> news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... > >> > You can always just ping it. This is easily done with the new class in > >> > .NET > >> > 2.0. > >> > >> Unfortunately, I am on VS 2003 and not running 2.0 yet. > >> > >> Also, pings are turned of on this machine for security. > >> > >> Thanks, > >> > >> Tom > >> > > >> > ====================================== > >> > David McCarter > >> > www.vsdntips.com > >> > VSDN Tips & Tricks .NET Coding Standards available at: > >> > www.cafepress.com/vsdntips.20412485 > >> > > >> > > >> > "tshad" wrote: > >> > > >> >> This is similar to another post I did where I would like to check one > >> >> server > >> >> from another server programmatically (from a service) to see if it is > >> >> running and then act accordingly if it isn't. Send an email, for > >> >> instance. > >> >> > >> >> Is there an easy way to do this? > >> >> > >> >> Thanks, > >> >> > >> >> Tom > >> >> > >> >> > >> >> > >> > >> > >> > > > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message Looks pretty good.news:BE93B10C-C1F2-4C33-998E-B9EA5010DB3C@microsoft.com... >I can do better than that! I have given 4 talks on WMI at various Code >Camps > around the western part of the US this year. Below is a link to my slides > and > sample code. Enjoy! > > http://blog.davidmccarter.net/PermaLink,guid,3f5e9cc0-d6a6-45a1-9f59-5e844c55ff27.aspx Are you in the picture?:) I loaded the project but can't open it. Says there is no project file - I am using VS 2003. Thanks, Tom Show quoteHide quote > > "tshad" wrote: > >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >> news:BD77A2BA-977A-4424-B25B-835D1827756E@microsoft.com... >> > Then use WMI. You can get all kinds of info from any server as long as >> > you >> > have a user name and password for that server. >> > >> Do I need to Load anthing special to use WMI? Add any references? >> >> I am running on an XP Pro using VS 2003 and the servers are W2K3 servers. >> I >> will be building Windows services to run on all those machines. >> >> Thanks, >> >> Tom >> >> > "tshad" wrote: >> > >> >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >> >> news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... >> >> > You can always just ping it. This is easily done with the new class >> >> > in >> >> > .NET >> >> > 2.0. >> >> >> >> Unfortunately, I am on VS 2003 and not running 2.0 yet. >> >> >> >> Also, pings are turned of on this machine for security. >> >> >> >> Thanks, >> >> >> >> Tom >> >> > >> >> > ====================================== >> >> > David McCarter >> >> > www.vsdntips.com >> >> > VSDN Tips & Tricks .NET Coding Standards available at: >> >> > www.cafepress.com/vsdntips.20412485 >> >> > >> >> > >> >> > "tshad" wrote: >> >> > >> >> >> This is similar to another post I did where I would like to check >> >> >> one >> >> >> server >> >> >> from another server programmatically (from a service) to see if it >> >> >> is >> >> >> running and then act accordingly if it isn't. Send an email, for >> >> >> instance. >> >> >> >> >> >> Is there an easy way to do this? >> >> >> >> >> >> Thanks, >> >> >> >> >> >> Tom >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Yes, I am in the picture :-) The project is written in VS.2005. You could
just look at the .vb files to see how I wrote the code. Show quoteHide quote "tshad" wrote: > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > news:BE93B10C-C1F2-4C33-998E-B9EA5010DB3C@microsoft.com... > >I can do better than that! I have given 4 talks on WMI at various Code > >Camps > > around the western part of the US this year. Below is a link to my slides > > and > > sample code. Enjoy! > > > > http://blog.davidmccarter.net/PermaLink,guid,3f5e9cc0-d6a6-45a1-9f59-5e844c55ff27.aspx > > Looks pretty good. > > Are you in the picture?:) > > I loaded the project but can't open it. Says there is no project file - I > am using VS 2003. > > Thanks, > > Tom > > > > "tshad" wrote: > > > >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > >> news:BD77A2BA-977A-4424-B25B-835D1827756E@microsoft.com... > >> > Then use WMI. You can get all kinds of info from any server as long as > >> > you > >> > have a user name and password for that server. > >> > > >> Do I need to Load anthing special to use WMI? Add any references? > >> > >> I am running on an XP Pro using VS 2003 and the servers are W2K3 servers. > >> I > >> will be building Windows services to run on all those machines. > >> > >> Thanks, > >> > >> Tom > >> > >> > "tshad" wrote: > >> > > >> >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > >> >> news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... > >> >> > You can always just ping it. This is easily done with the new class > >> >> > in > >> >> > .NET > >> >> > 2.0. > >> >> > >> >> Unfortunately, I am on VS 2003 and not running 2.0 yet. > >> >> > >> >> Also, pings are turned of on this machine for security. > >> >> > >> >> Thanks, > >> >> > >> >> Tom > >> >> > > >> >> > ====================================== > >> >> > David McCarter > >> >> > www.vsdntips.com > >> >> > VSDN Tips & Tricks .NET Coding Standards available at: > >> >> > www.cafepress.com/vsdntips.20412485 > >> >> > > >> >> > > >> >> > "tshad" wrote: > >> >> > > >> >> >> This is similar to another post I did where I would like to check > >> >> >> one > >> >> >> server > >> >> >> from another server programmatically (from a service) to see if it > >> >> >> is > >> >> >> running and then act accordingly if it isn't. Send an email, for > >> >> >> instance. > >> >> >> > >> >> >> Is there an easy way to do this? > >> >> >> > >> >> >> Thanks, > >> >> >> > >> >> >> Tom > >> >> >> > >> >> >> > >> >> >> > >> >> > >> >> > >> >> > >> > >> > >> > > > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message I figured that since opening the .vbproj file gave me an error saying it news:F1825A54-FC15-40B5-9176-D243A722B6DC@microsoft.com... > Yes, I am in the picture :-) The project is written in VS.2005. You could > just look at the .vb files to see how I wrote the code. couldn't read the project file and that it was invalid. Just wanted to make sure I didn't miss something. I was looking at the code. Looks pretty straight forward. Thanks, Tom Show quoteHide quote > > "tshad" wrote: > >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >> news:BE93B10C-C1F2-4C33-998E-B9EA5010DB3C@microsoft.com... >> >I can do better than that! I have given 4 talks on WMI at various Code >> >Camps >> > around the western part of the US this year. Below is a link to my >> > slides >> > and >> > sample code. Enjoy! >> > >> > http://blog.davidmccarter.net/PermaLink,guid,3f5e9cc0-d6a6-45a1-9f59-5e844c55ff27.aspx >> >> Looks pretty good. >> >> Are you in the picture?:) >> >> I loaded the project but can't open it. Says there is no project file - >> I >> am using VS 2003. >> >> Thanks, >> >> Tom >> > >> > "tshad" wrote: >> > >> >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >> >> news:BD77A2BA-977A-4424-B25B-835D1827756E@microsoft.com... >> >> > Then use WMI. You can get all kinds of info from any server as long >> >> > as >> >> > you >> >> > have a user name and password for that server. >> >> > >> >> Do I need to Load anthing special to use WMI? Add any references? >> >> >> >> I am running on an XP Pro using VS 2003 and the servers are W2K3 >> >> servers. >> >> I >> >> will be building Windows services to run on all those machines. >> >> >> >> Thanks, >> >> >> >> Tom >> >> >> >> > "tshad" wrote: >> >> > >> >> >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in >> >> >> message >> >> >> news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... >> >> >> > You can always just ping it. This is easily done with the new >> >> >> > class >> >> >> > in >> >> >> > .NET >> >> >> > 2.0. >> >> >> >> >> >> Unfortunately, I am on VS 2003 and not running 2.0 yet. >> >> >> >> >> >> Also, pings are turned of on this machine for security. >> >> >> >> >> >> Thanks, >> >> >> >> >> >> Tom >> >> >> > >> >> >> > ====================================== >> >> >> > David McCarter >> >> >> > www.vsdntips.com >> >> >> > VSDN Tips & Tricks .NET Coding Standards available at: >> >> >> > www.cafepress.com/vsdntips.20412485 >> >> >> > >> >> >> > >> >> >> > "tshad" wrote: >> >> >> > >> >> >> >> This is similar to another post I did where I would like to >> >> >> >> check >> >> >> >> one >> >> >> >> server >> >> >> >> from another server programmatically (from a service) to see if >> >> >> >> it >> >> >> >> is >> >> >> >> running and then act accordingly if it isn't. Send an email, >> >> >> >> for >> >> >> >> instance. >> >> >> >> >> >> >> >> Is there an easy way to do this? >> >> >> >> >> >> >> >> Thanks, >> >> >> >> >> >> >> >> Tom >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> BTW - Do I need to load anything on an XP Pro or W2k3 Server to use this?
What about a reference from VS2003 - do I need to reference anything? Thanks, Tom Show quoteHide quote "tshad" <tscheider***@ftsolutions.com> wrote in message news:%23qbPN5twGHA.4596@TK2MSFTNGP05.phx.gbl... > "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message > news:F1825A54-FC15-40B5-9176-D243A722B6DC@microsoft.com... >> Yes, I am in the picture :-) The project is written in VS.2005. You could >> just look at the .vb files to see how I wrote the code. > > I figured that since opening the .vbproj file gave me an error saying it > couldn't read the project file and that it was invalid. > > Just wanted to make sure I didn't miss something. > > I was looking at the code. Looks pretty straight forward. > > Thanks, > > Tom > >> >> "tshad" wrote: >> >>> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >>> news:BE93B10C-C1F2-4C33-998E-B9EA5010DB3C@microsoft.com... >>> >I can do better than that! I have given 4 talks on WMI at various Code >>> >Camps >>> > around the western part of the US this year. Below is a link to my >>> > slides >>> > and >>> > sample code. Enjoy! >>> > >>> > http://blog.davidmccarter.net/PermaLink,guid,3f5e9cc0-d6a6-45a1-9f59-5e844c55ff27.aspx >>> >>> Looks pretty good. >>> >>> Are you in the picture?:) >>> >>> I loaded the project but can't open it. Says there is no project file - >>> I >>> am using VS 2003. >>> >>> Thanks, >>> >>> Tom >>> > >>> > "tshad" wrote: >>> > >>> >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in message >>> >> news:BD77A2BA-977A-4424-B25B-835D1827756E@microsoft.com... >>> >> > Then use WMI. You can get all kinds of info from any server as long >>> >> > as >>> >> > you >>> >> > have a user name and password for that server. >>> >> > >>> >> Do I need to Load anthing special to use WMI? Add any references? >>> >> >>> >> I am running on an XP Pro using VS 2003 and the servers are W2K3 >>> >> servers. >>> >> I >>> >> will be building Windows services to run on all those machines. >>> >> >>> >> Thanks, >>> >> >>> >> Tom >>> >> >>> >> > "tshad" wrote: >>> >> > >>> >> >> "dotNetDave" <dotNetD***@discussions.microsoft.com> wrote in >>> >> >> message >>> >> >> news:7F4E279C-9BAC-495D-9F8E-68B58BE1C078@microsoft.com... >>> >> >> > You can always just ping it. This is easily done with the new >>> >> >> > class >>> >> >> > in >>> >> >> > .NET >>> >> >> > 2.0. >>> >> >> >>> >> >> Unfortunately, I am on VS 2003 and not running 2.0 yet. >>> >> >> >>> >> >> Also, pings are turned of on this machine for security. >>> >> >> >>> >> >> Thanks, >>> >> >> >>> >> >> Tom >>> >> >> > >>> >> >> > ====================================== >>> >> >> > David McCarter >>> >> >> > www.vsdntips.com >>> >> >> > VSDN Tips & Tricks .NET Coding Standards available at: >>> >> >> > www.cafepress.com/vsdntips.20412485 >>> >> >> > >>> >> >> > >>> >> >> > "tshad" wrote: >>> >> >> > >>> >> >> >> This is similar to another post I did where I would like to >>> >> >> >> check >>> >> >> >> one >>> >> >> >> server >>> >> >> >> from another server programmatically (from a service) to see if >>> >> >> >> it >>> >> >> >> is >>> >> >> >> running and then act accordingly if it isn't. Send an email, >>> >> >> >> for >>> >> >> >> instance. >>> >> >> >> >>> >> >> >> Is there an easy way to do this? >>> >> >> >> >>> >> >> >> Thanks, >>> >> >> >> >>> >> >> >> Tom >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >>> >> >>> >> >>> >>> >>> > > |
|||||||||||||||||||||||