When remotely rebooting a Windows Server 2008 R2 machine via RDP, you might encounter the system freezing at the "Please wait for the System Event Notification Service..." message during shutdown. This typically occurs when:
- The server has active COM+ components holding references
- Pending group policy updates need processing
- Non-responsive services have dependencies on SENS
Option 1: Force shutdown via command line (if still accessible)
shutdown /r /f /t 0
Option 2: Using PSExec when RDP is unresponsive
psexec \\serverName -u domain\adminUser -p password cmd /c "shutdown /r /f /t 0"
When standard methods fail, try these PowerShell alternatives:
# Method 1: WMI reboot
Get-WmiObject -Class Win32_OperatingSystem -ComputerName serverName |
Invoke-WmiMethod -Name Reboot
# Method 2: CIM reboot (PowerShell 3.0+)
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName serverName |
Invoke-CimMethod -MethodName Reboot
Add this registry tweak to modify SENS timeout (create backup first):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
"WaitToKillServiceTimeout"="5000"
For critical production servers, consider implementing this scheduled task as fallback:
$action = New-ScheduledTaskAction -Execute 'shutdown.exe' -Argument '/r /f /t 60 /c "Forced reboot initiated by maintenance plan"'
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName "EmergencyReboot" -Action $action -Trigger $trigger -Description "Force reboot if hangs during shutdown" -User "SYSTEM" -RunLevel Highest
After recovery, analyze shutdown hangs using:
# Generate shutdown analyzer report
shutdown /i /m \\serverName /t 300 /d p:0:0 /c "Collecting shutdown data"
# Check event logs for SENS errors
Get-EventLog -LogName System -ComputerName serverName -After (Get-Date).AddHours(-1) |
Where-Object {$_.Source -like "*SENS*"} |
Select-Object TimeGenerated, EntryType, Message
Many Windows Server 2008 R2 administrators encounter this frustrating situation during remote reboots: the system gets stuck at the "Please wait for the System Event Notification Service..." message while shutting down. The server appears partially responsive (websites may still serve content), but the reboot sequence won't complete.
The System Event Notification Service (SENS) handles system events and notifications between components. When it hangs during shutdown, it's typically because:
- Pending RPC calls that won't terminate
- Dependencies stuck in a waiting state
- Session cleanup issues in Terminal Services
Method 1: Remote Command Execution
If you still have some connectivity, try forcing shutdown via command line:
shutdown /r /f /t 0
Method 2: PowerShell Alternative
For systems with PowerShell remoting enabled:
Restart-Computer -Force -ComputerName YourServer
If standard methods don't work, you'll need to try these approaches:
Using PSExec for Forced Reboot
psexec \\server cmd /c "shutdown /r /f /t 0"
WMI Fallback Option
wmic /node:server process call create "shutdown /r /f /t 0"
Add this registry tweak to limit SENS shutdown wait time:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control] "WaitToKillServiceTimeout"="5000"
Create a PowerShell script to detect and handle hung shutdowns:
$server = "YourServer" $timeout = New-TimeSpan -Minutes 15 $stopwatch = [System.Diagnostics.Stopwatch]::StartNew() while ($stopwatch.Elapsed -lt $timeout) { if (-not (Test-Connection -ComputerName $server -Count 1 -Quiet)) { Write-Host "Server successfully rebooted" break } Start-Sleep -Seconds 30 } if ($stopwatch.Elapsed -ge $timeout) { Write-Warning "Server stuck in shutdown - forcing reboot" Restart-Computer -ComputerName $server -Force }