Jump to content
Pulseway 9.14 🔥

Featured Replies

Posted

I've tried a couple of recommendations around the web for powershell and batch for restarting a Windows machine. Each script seems to work fine on all machines with the exception of one workstation that seems to shutdown only and not perform a restart - when the scheduled task is ran via Pulseway.

Has anyone ever experienced this - where the machine simply shuts down vs restarting? Also, is there a reliable Windows restart script that anyone can share? Thank you.

  • Administrators

What command are you running to restart the operating system? Is it a simple:

shutdown -r -f -t 00

If so, try to restart the OS via WMI:

Get-WmiObject win32_operatingsystem -ComputerName Quark | Invoke-WMIMethod -name Win32Shutdown -ArgumentList @(6)

-Paul

  • Author

Thanks Paul. So where you have  "-ComputerName Quark"  I'm guessing Quark must be replaced by the actual name of the computer?

  • Author
On 7/4/2017 at 5:55 AM, Paul said:

What command are you running to restart the operating system? Is it a simple:


shutdown -r -f -t 00

If so, try to restart the OS via WMI:


Get-WmiObject win32_operatingsystem -ComputerName Quark | Invoke-WMIMethod -name Win32Shutdown -ArgumentList @(6)

-Paul

 

The script above looks good on a test machine. I'll test it out tonight on the one that's simply shutting down only and let you know. Thanks again.

Create an account or sign in to comment