black electronics

Reboot Server Remotely

Common commands for rebooting a Windows server remotely during pentests.

A few different ways to trigger a remote reboot on a Windows host, useful when a change (like disabling a service or installing an update) needs a restart to take effect.

Terminal window
Invoke-CimMethod -ComputerName someserver -ClassName Win32_OperatingSystem -MethodName Reboot # Preferred - uses CIM/WinRM
Invoke-WmiMethod -ComputerName someserver -Class Win32_OperatingSystem -Name Reboot # Older WMI equivalent
wmic os where Primary='TRUE' call reboot # WMIC equivalent, run locally or with /node:

To reboot the local machine instead of a remote one:

Terminal window
shutdown /r /t 0
Useful LinksPentest PayloadsCheat Sheets