Solved

Force shutdown/reboot over LAN

Posted on 2002-06-26
6
1,680 Views
Last Modified: 2008-01-09
I know how to force a PC to shutdown or reboot but how do I shutdown/reebot a PC remotely over a network ?.

Thanks
Paul.
0
Comment
Question by:pr_wainwright
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 7112750
Perhaps you need to run another app at the remote PC. And when you want to shut down that PC, your PC will communicate with the remote app, and the remote app will shut down the PC.
0
 
LVL 1

Author Comment

by:pr_wainwright
ID: 7112784
DragonSlayer,
             Any idea's how this communication could be done ?.

Paul.
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 7112836
It could be something simple, whereby a small application runs in a remote machine, listening to a certain port, say, port 12005.

And when it receives a sequence of data from your machine, it will reboot/shut down/do whatever... it's up to you to define what you want to do with it.

Or if you want to make it more complicated, you could use some forms of remote procedural calls (RPC)... such as COM+, CORBA or using some kind of middleware thingy (such as FPiette's MidWare)... using this technology, if your remote app has a function called ShutDown, then your app can simply call the remote app's ShutDown procedure.

Check out MidWare at http://overbyte.alexid.fr/frame_index.html
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
_MeSSiah_ earned 100 total points
ID: 7114507
If you only need to remotely shutdown/reboot a NT/2K/XP machine, then i wouldn't complicate so much with RPCs, COM or corba.

You can simply use WMI and call Win32Shutdown method of Win32_OperatingSystem WMI class on your local or remote machine.

You can find out more about Windown Management Instrumentation at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_reference.asp

I also made a small example for you, you can download it from http://www.goran-s.com/download/gs_rsd_src.zip

If you want to compile the source, you need to import Microsoft WMI Scripting type library (tested with v1.1 and 1.2).

Although WMI works also in Win9x, i think that only NT/2K/XP systems support Win32Shutdown method. You are welcome to test it also on Win9x.
0
 
LVL 1

Expert Comment

by:_MeSSiah_
ID: 7114525
Oh, i forgot to mention...

The user that you use to log in to the remote machine, must have shutdown or administrator privileges.
0
 
LVL 1

Author Comment

by:pr_wainwright
ID: 7114546
Thanks for the answer & example code MeSSiah.

Paul.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question