Skip to content

Disabling "Allow shutdown and restart" on a session prevents sleep/shutdown from the console's Start menu #105

In review

Description

@SamySylvain

Another one, found while testing 2.3.0: the console user could no longer put
the PC to sleep from the Start menu (nothing happens, no error). No power
requests (powercfg /requests), S3 available, and
[System.Windows.Forms.Application]::SetSuspendState('Suspend',$false,$false)
from an elevated shell worked.

Cause: the isolated session had "Allow shutdown and restart of the PC"
disabled. ShutdownRight.SetForUser(user, allow: false) then calls
RestrictToAdministrators(), which removes SeShutdownPrivilege from BUILTIN\Users
and only keeps it for BUILTIN\Administrators.

But the console user, even an administrator, runs Explorer with the
UAC-filtered token, which no longer gets SeShutdownPrivilege from Users. So
Start > Sleep/Shut down silently does nothing on the main screen.
whoami /priv in a non-elevated terminal showed no SeShutdownPrivilege.
Enabling "Allow shutdown and restart" on the session and rebooting brought it
back.

Also note the restriction doesn't really hold when the isolated user is an
administrator (mine is), since it can elevate.

Suggestion: grant SeShutdownPrivilege explicitly to the console user (or to
every non-isolated local account) before removing it from Users, or only
use NoClose for the isolated user instead of touching the Users group.

Activity

  1. mlopezsegura commented on Nov 30, 2026

    @mlopezsegura
    Collaborator

    Thanks, spot on, and the whoami /priv check made it easy to confirm.

    You're right about the cause. Removing SeShutdownPrivilege from Users leaves the console with only what Administrators gives, and the UAC-filtered token Explorer runs with doesn't get rights through the Administrators group. So Start → Sleep / Shut down did nothing.

    The fix is in #117 and will be in the next release:

    • Before removing it from Users, every enabled local account that isn't an osms- user, plus whoever is signed in at the console (domain and Microsoft accounts too), gets the right on its own account.
    • It runs whenever a seat is restricted and when the service starts, so PCs already affected get repaired. The accounts it was given to are recorded and lose it again on uninstall.
    • As with any privilege, it takes effect at the next sign-in.

    Until then, keeping "Allow shutdown and restart" enabled on that session, as you did, is the workaround. On Pro you can also add your own account to Shut down the system in secpol.msc (Local Policies → User Rights Assignment).

    On the isolated user being an administrator: agreed, the restriction can't hold there. OpenStreamMS creates isolated users as standard users; one that is made an administrator can elevate and run shutdown. For a seat that shouldn't shut the PC down, keep its user standard.

    I'll post here when the release is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions