Jump to content

Best way to send restart command?


Recommended Posts

I've been experimenting with a scheduled task to restart some machines based on scope and I've had mixed success. Some machines in the scope restart as scheduled some don't. My powershell skills are limited so right now the pulseway script that I created to do restarts just has the powershell command Restart-Computer.  Should there be more?

Link to comment
Share on other sites

Are the machines that are failing to restart, failing because they have some processes open that they cannot close (or are awaiting user input)? 

You could always append "-force" to your restart-computer cmdlet to force it. 




Link to comment
Share on other sites

I use it regularly, and the command (as WYE suggested)

Restart-Computer -Force

How do you manage the scheduled restarts? with a scheduled task and Tags?  I went through a few options to get this to work.  I went with a Tag called 'Restart Tomorrow' and at 6am, any devices with that tag are captured in a task that restarts the server.

The tag is removed on reboot.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...