r/ASPNET • u/whosurdata • May 24 '12
Best way to reboot remote windows systems from an ASP.NET page
We have 7 digital signs running in my building. Right now, they are running Windows XP + the content player, but could be running Windows 7 just as easily. They all serve up a mixture of static images and web content from our IIS 7.5 web server. Occasionally, I need to reboot the signs. I issue commands like: shutdown -r -f -m \pc-sign03 -t 0 from batch files, but this requires me to walk upstairs to my office (which is not close to the signs) and then walk (I suppose running or skipping is possible too.) back down to see if everything worked. I would love to be able to do this from a secure web page (from my iPhone or iPad). The last time I tried, I was trying to get our web server to send the "shutdown -r -f -m \pc-sign03 -t 0" command, but IIRC Windows security makes that pretty tough. I have considered running scheduled tasks on the signs that "watch" a web page for special text that would trigger a reboot or maybe even a simple Windows service that I could install on the signs. Any suggestions would be greatly appreciated.
EDIT: tiny typo
4
u/redisant May 25 '12
what about RDP or logmein or something?
3
u/h4rdr0k May 24 '12
I don't know about using ASP.NET to do this, but you can check out PSTools. It allows you to remotely run bat files.
http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
Edit: Just found this article as well
http://www.c-sharpcorner.com/UploadFile/yuanwang200409/RemoteRestartWindows09252006141003PM/RemoteRestartWindows.aspx
2
u/graboskyc May 25 '12
So the clients are not running IIS, right? They are basically just IE in kiosk mode, looking at a remote web server?
If so, you could make an ASP.NET page which will send an SNMP query to each of the machine, requesting a reboot. You would need to write a small MIB and set community strings but that is not that much work.
2
u/codergeek May 25 '12
Have you tried calling InitiateSystemShutdownEx via P/Invoke?