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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...