| Previous | Next |
| ERROR_SHUTDOWN_IS_SCHEDULED | ERROR_BAD_DEVICE |
ERROR_SHUTDOWN_USERS_LOGGED_ON
Other signed-in users prevent the requested shutdown.
ERROR_SHUTDOWN_USERS_LOGGED_ON has value 1191 (0x4A7). InitiateShutdown can return it when users other than the initiating user are logged on and the request does not include permission to force those sessions to close.
Why Windows blocks the request
Forcing a session to end can discard unsaved work, interrupt remote administration, and terminate long-running interactive tasks. The result is therefore a policy boundary rather than a hardware failure. A maintenance tool should surface the active-session condition instead of converting it to a generic shutdown error.
Session evidence to collect
- target computer and whether the operation is local or remote
- interactive, disconnected, and remote-session counts
- session IDs, user display names where policy allows, and idle times
- requested grace period, reason code, and shutdown flags
- maintenance window and authorization source for forced logoff
Avoid logging authentication tokens or command histories while collecting session information.
Administrator choices
Notify users and reschedule the operation when data preservation is more important than immediate shutdown. During an approved emergency or enforced maintenance window, the controller may use SHUTDOWN_FORCE_OTHERS according to organizational policy. The decision should be explicit because the flag changes the data-loss risk, not merely the API behavior.
Application behavior
- show which maintenance action was blocked and how long it can wait
- allow a bounded grace period for users to save work
- re-enumerate sessions before the final forced request
- prevent two controllers from repeatedly warning the same users
- audit who authorized a forced shutdown
Difference from scheduled shutdown
ERROR_SHUTDOWN_IS_SCHEDULED means another shutdown is already pending. Error 1191 means the attempted shutdown has not been accepted because other sessions exist. ERROR_PRIVILEGE_NOT_HELD indicates the caller lacks the shutdown privilege and must be handled separately.
Example
A server-maintenance agent attempts a reboot while an administrator has a disconnected Remote Desktop session containing an unsaved console. The API returns 1191. The agent sends a warning, waits for the approved window, confirms the session still exists, and only then issues a policy-authorized forced reboot.
References
- Microsoft: System Error Codes (1000–1299)
- Microsoft: InitiateShutdownW function
- Microsoft: WTSEnumerateSessionsW function
Looking for a different code? Search another status or error code.
