Category filter
Script to Shut Down Windows 10 devices
An admin might need to shut down Windows devices remotely from time to time when managing a fleet of devices. Hexnode allows admins to run commands to shut down or schedule shutdown of Windows devices with a specified delay using Execute Custom Script action. This document contains the code snippets for shutting down your device.
Batch script
1 |
shutdown.exe /s /t 00 |
Once the command is executed, the device shuts down, after displaying a warning message.
By customizing the last parameter of the command, you can schedule shutdown to proceed after the specified number of seconds. Say, to shut down the device in 15 seconds,
1 |
shutdown.exe /s /t 15 |
Powershell script
1 |
Stop-Computer -ComputerName "computer_name" -force |
Stop-Computer
: cmdlet used to shut down or restart a computer.
-ComputerName
:parameter that specifies the name or IP address of the remote computer that you want to shut down or restart.
-force
:optional parameter that forces the remote computer to shut down or restart without prompting for confirmation.
Replace “computer_name
” with the name or IP address of the remote computer that you want to shut down or restart.