473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Remote Reboot in VB.NET

How would i go about rebooting a remote computer from code
running on this local computer?

Bacsically i have a service running on machine A, it
checks the status of a service on machine B. If the
service on machine B fails, the service on machine A needs
to tell machine B to reboot.

Thanks
Eric.
Jul 19 '05 #1
2 4966

Why not use the service control classes and just restart
the services. Then you would reduce the risk of the
machine not coming back up.

Glenn
-----Original Message-----
How would i go about rebooting a remote computer from coderunning on this local computer?

Bacsically i have a service running on machine A, it
checks the status of a service on machine B. If the
service on machine B fails, the service on machine A needsto tell machine B to reboot.

Thanks
Eric.
.

Jul 19 '05 #2
I think the Management (WMI) Extensions for VS.NET PDC version Server
Explorer is helpful for this problem. You may install Management (WMI)
Extensions for VS.NET PDC version Server Explorer from the link below:

http://go.microsoft.com/fwlink/?LinkId=3353

And then take the following steps to generate the code for rebooting a
remote machine.

1. Create a Windows Application project in Visual C#
2. Click the Server Explorer and browser to:

Servers\<your local machine>\Management Classes\Operating Systems\<your
current system>

3. Drag the system to your form
4. Modify the Win32_OperatingSystem.CS file generated by IDE and let it
connect to the target machine
5. Add the following code to your program:

operatingSystem1.Reboot();

6. Build and run the application

You may refer to the link below to get more detailed information about how
to use WMI in VS.NET:

http://msdn.microsoft.com/library/en...ndowsManagemen
tInstrumentationWMIDataEventsWithServerExplorer.as p

I hope this helps you.

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #3

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

Similar topics

1
by: Bihari Srinivasan | last post by:
I am using two PCs, say PC-1 and PC-2 in a networked environment (TCP/IP). Both of these run Windows 2000. PC-1 is a development platform and PC-2 is a remote debug platform. I have a very...
1
by: eric | last post by:
I have a need to reboot a remote machine from code that is running on a local machine. I would assume that i need to use WMI and the system.management namespace. Any ideas? Code Samples? ...
1
by: Ian McCarty | last post by:
Hi, Wondering if someone could help me out. I'm trying to setup remote debugging of my C# app. I've followed the instructions in MSDN and I've setup full remote debugging on the target (in fact...
5
by: felecha | last post by:
I have a VB.Net application that runs as a Windows Service and monitors a MessageQueue on another machine. At times that machine will have to be rebooted, so I've been working on how to get my...
4
by: ---------- Eric ---------- | last post by:
How would i go about rebooting a remote computer from code running on this local computer? Bacsically i have a service running on machine A, it checks the status of a service on machine B. If...
1
by: scorpion53061 | last post by:
Trying to change a value named in a remote registry. In this case we want to set the password protect function of the screensaver so WMI can do a reboot of the system. (IsSecure or...
2
by: scorpion53061 | last post by:
hi all, I thought I would give this back and see if anyone could improve on it. I was working with the remote registry class. This code opens the ScreenSaverIsSecure registry setting and changes...
4
by: Chris Johnson | last post by:
Hey all, I have a small app I have developed that periodically pings a list of server and returns their status. Given my environment I have setup the program such that a server can be down 4...
1
by: anonieko | last post by:
Problem When Remote Desktop to my main office machine, and when trying to connect to SQL Express, I was becoming increasingly frustrated with the following error: Error: 'Failed to generate a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.