0X000004A7

Fix ERROR_SHUTDOWN_USERS_LOGGED_ON (0X000004A7)

Windows Errors Intermediate 👁 1 views 📅 May 29, 2026

Windows won't shut down because another user is logged in. Here's how to force shutdown or find and kick them out.

Quick answer for pros: Run shutdown /f /r /t 0 in an admin command prompt. That skips the user check and forces a restart.

I've seen this error so many times, especially on servers or shared workstations. You hit shutdown, Windows says "nope, someone else is logged in," and you're stuck. The error code 0X000004A7 (or decimal 1191) means the system won't start a shutdown because there are other user sessions active. It happens most often when someone left a Remote Desktop session open, or a colleague locked their console and went home. Windows is being cautious — it doesn't want to nuke someone's unsaved work. But when you're the admin and you need that machine down, caution gets annoying fast.

Let me walk you through the fixes, from quick and dirty to the clean approach.

Step-by-step fixes

1. Force shutdown with the /f flag

Open Command Prompt as Administrator. Then type:

shutdown /r /f /t 0

The /f tells Windows to force-close all applications without warning users. The /t 0 sets the timer to zero seconds. This bypasses the user session check completely. It works on Windows 10, 11, Server 2016, 2019, 2022 — any modern NT-based system.

If you want to shutdown instead of restart, use /s instead of /r:

shutdown /s /f /t 0

2. Find and log off other users manually

If you prefer a cleaner approach, or if the forced shutdown didn't work (rare but possible with stuck system processes), you can log off the other sessions first.

First, identify who's logged on:

query user

You'll see output like:

USERNAME       SESSIONNAME        ID  STATE   IDLE TIME  LOGON TIME
priya console 1 Active . 3/15/2025 9:00 AM
joe rdp-tcp#3 2 Disc . 3/15/2025 8:30 AM

Note the session ID (the number under ID). Here, joe is disconnected but still logged on. To kick him off:

logoff 2

Replace 2 with the actual session ID. You'll need admin rights. Run logoff /? for help, but it's dead simple.

Once all other sessions show as empty, you can shut down normally via Start menu or shutdown /s /t 0.

3. Use PowerShell to force logoff all sessions

If you have many sessions, this PowerShell one-liner logs off everyone except your own:

Get-CimInstance -ClassName Win32_LogonSession | Where-Object {$_.LogonId -ne (Get-Process -Id $PID).SessionId} | ForEach-Object {logoff $_.LogonId}

That's a bit dense. Simpler version — just log off all disconnected sessions:

query user | Select-String "Disc" | ForEach-Object { $_.ToString().Trim() -match '\s+(\d+)\s+' | Out-Null; logoff $Matches[1] }

Run this from an elevated PowerShell window.

Alternative fixes if the main ones fail

Task Manager — Users tab

Press Ctrl+Shift+Esc, go to the Users tab. You'll see all logged-on users. Right-click the ones that aren't you and select "Sign off." This is the GUI version of the logoff command. Works on Windows 10 and 11.

Remote Shutdown with msg command

If the other user is active and you want to give them a warning before force-closing their stuff, send a message:

msg * /server:localhost "System will shut down in 60 seconds. Save your work."

Then wait a bit, then run the shutdown /f command. This is less jarring for shared workstations.

Boot into Safe Mode

If the system is stuck and nothing works — maybe a service or driver is holding a session open — boot into Safe Mode. In Safe Mode, only essential services load, and often the stuck session disappears. Then you can restart normally. On Windows 10/11, hold Shift while clicking Restart, then troubleshoot > advanced options > startup settings > restart > choose Safe Mode.

Prevention tip

If this keeps happening on a server or shared machine, you can change the shutdown policy. Run gpedit.msc (Group Policy Editor) and go to Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options. Find Shutdown: Allow system to be shut down without having to log on and enable it. Also look for Shutdown: Clear virtual memory pagefile — leave that disabled unless you have specific security requirements.

On domain-joined machines, the policy might be inherited from the domain controller. Check with your IT team before changing local policy.

Another quick trick: set a scheduled task to run shutdown /f /s /t 0 at a specific time each night. That way you don't have to worry about stuck users.

I know this error is infuriating when you're in a hurry. But once you know the /f flag exists, it's a 10-second fix. Keep that command in your back pocket.

Was this solution helpful?