2

I have developed a batch script that will remotley shutdown all of our PC's (using the shutdown \\machinename command) in the office outwith working hours, but would like to give the users the ability to cancel this shutdown, say for example if they are working late.

My inital thought was to provide a batch file that the users could run (that executes the shutdown -a command), however when users run this is says they do not have the nessisarry permissions to run this command.

I could modify the group policy setting "Force shutdown from a remote system", to add provide users with this privalage, but im not sure if this the the only/best way of doing it?

Also - I have tried using other remote shutdown utilitys, however these will not run on our machines due to our antivirus software blocking remote execution of applications, i dont have any control over the AV software.

voretaq7
  • 79,345
  • 17
  • 128
  • 213
Sean Taylor
  • 263
  • 3
  • 8

3 Answers3

2

One way to do it would be to copy a batch file to each system and spawn it under your own credentials remotely. The batch file would display a message "Hit Control-C to abort", wait for 60 seconds, then issue the reboot command locally (as opposed to a remote shutdown). Here's how to do waits in batch files.

The black DOS window will pop up on their screen while they're working. I'd go with 60 seconds, maybe even 120 because not everybody's staring at their screen while they work - they might be running to the bathroom or reading a printout.

Brent Ozar
  • 4,425
  • 17
  • 21
1

Similar to the other post, if you can execute a VBScript under your creds you can use the WScript Shell Popup Method. That allows for a timeout in seconds to be set. You can have the popup appear for several seconds and if the user doesn't abort, carry out the reboot.

You can also remove the wait timeout and the message box will sit indefinitely waiting for user input.

Rob Haupt
  • 794
  • 6
  • 10
0

Try use Network Shutdown Tool. Good luck.