Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1699
  • Last Modified:

Force shutdown/reboot over LAN

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
pr_wainwright
Asked:
pr_wainwright
  • 2
  • 2
  • 2
1 Solution
 
DragonSlayerCommented:
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
 
pr_wainwrightAuthor Commented:
DragonSlayer,
             Any idea's how this communication could be done ?.

Paul.
0
 
DragonSlayerCommented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
_MeSSiah_Commented:
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
 
_MeSSiah_Commented:
Oh, i forgot to mention...

The user that you use to log in to the remote machine, must have shutdown or administrator privileges.
0
 
pr_wainwrightAuthor Commented:
Thanks for the answer & example code MeSSiah.

Paul.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now