Skip to content

Keep Start-menu sleep and shut down working on the console with exclusive seats - #117

Open
mlopezsegura wants to merge 1 commit into
masterfrom
fix/console-shutdown-right
Open

mlopezsegura wants to merge 1 commit into
masterfrom
fix/console-shutdown-right

Conversation

@mlopezsegura

Copy link
Copy Markdown
Collaborator

Fixes #105.

An exclusive seat removes Shut down the system (SeShutdownPrivilege) from the Users group so its isolated user can't shut the PC down. Administrators kept it, but an administrator's UAC-filtered token (Explorer, the Start menu) doesn't get the rights of the Administrators group. So Start → Sleep / Shut down silently did nothing on the console.

  • Before removing it from Users, every enabled local account that isn't an osms- user, and whoever is signed in at the console (also domain or Microsoft accounts), gets the right on its own account.
  • It runs every time a seat is restricted and when the service starts, so PCs where an earlier version already removed it are repaired. While Users doesn't have it, a new console user gets it too.
  • The SIDs it was given to are recorded in ProgramData\OpenStreamMS\shutdown-right-granted and lose it again on uninstall, along with Users getting it back.
  • Like any privilege, it takes effect at each user's next sign-in.

Isolated users are still created as standard users. If one is made an administrator, it can elevate and the restriction can't hold; that's unchanged.

Tests: ShutdownRightTests (5 new: which accounts keep the right) and the full suite (215) pass. Not tried on a PC with an exclusive seat yet.

🤖 Generated with Claude Code

An exclusive seat removes "Shut down the system" from the Users group so
its isolated user can't shut the PC down. Administrators kept it, but an
administrator's UAC-filtered token (Explorer, the Start menu) doesn't get
the rights of the Administrators group, so Start > Sleep/Shut down silently
did nothing on the console (#105).

Before removing it from Users, every enabled local account that isn't an
osms- user, and whoever is signed in at the console, now gets the right on
its own account. This runs every time, so it also repairs PCs where an
earlier version already removed it, and the service gives it to a new
console user while Users doesn't have it. The accounts it was given to are
recorded and lose it again on uninstall. It takes effect at each user's
next sign-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant