Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is it possible to set up a (C# or VB) program to remotely reboot another machine (say a server). The Sys Admin asked about it and I have no clue where to even start looking for something like that.

 

Thanks

MTS

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

  • Administrators
Posted

Programatically either InitiateSystemShutdown or InitiateSystemShutdownEx are the API calls you will need.

 

For this to work you would need the requisite permissions to shut down the target machine.

 

Alternatively windows has a shutdown.exe command you could use via the Process class.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Couldn't you just remote into the machine via Remote Desktop and tell the machine to reboot? Of course, that wouldn't be a fully automated solution.
  • 2 weeks later...
Posted
remote desktop disables the shutdown / restart options...

That's interesting, because my server definitely restarts when I tell it to over remote desktop. Perhaps because I'm logged in as an admin? Or perhaps it's a feature exclusive to Windows Server?

Posted

I believe that the server disables the shutdown/reset option from the login box. But, that being said, when you have logged into the server you then have the ability (with the appropriate permissions) to shutdown or restart the server.

 

HTH.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

-- Rick Cook, The Wizardry Compiled

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...