Remove and prevent access to the Shut Down, Restart, Sleep, and Hibernate commands
Supprimer et empêcher l’accès aux commandes Arrêter, Redémarrer, Mettre en veille et Mettre en veille prolongée
Explanation
This policy setting prevents users from performing the following commands from the Windows security screen, the logon screen, and the Start menu: Shut Down, Restart, Sleep, and Hibernate. This policy setting does not prevent users from running Windows-based programs that perform these functions.
If you enable this policy setting, the shutdown, restart, sleep, and hibernate commands are removed from the Start menu. The Power button is also removed from the Windows Security screen, which appears when you press CTRL+ALT+DELETE, and from the logon screen.
If you disable or do not configure this policy setting, the Power button and the Shut Down, Restart, Sleep, and Hibernate commands are available on the Start menu. The Power button on the Windows Security and logon screens is also available.
Ce paramètre de stratégie empêche les utilisateurs d’exécuter les commandes suivantes à partir de l’écran Sécurité Windows, de l'écran de connexion ou du menu Démarrer : Arrêter, Redémarrer, Mettre en veille et Mettre en veille prolongée. Ce paramètre de stratégie n’empêche pas les utilisateurs d’utiliser des programmes Windows qui exécutent ces fonctions.
Si ce paramètre de stratégie est activé, les commandes Arrêter, Redémarrer, Mettre en veille et Mettre en veille prolongée sont supprimés du menu Démarrer. Le bouton Marche/Arrêt est également supprimé de l’écran Sécurité Windows, qui s’affiche lorsque vous appuyez sur Ctrl+Alt+Suppr, et de l'écran de connexion.
Si ce paramètre de stratégie est désactivé ou n’est pas configuré, le bouton Marche/Arrêt et les commandes Arrêter, Redémarrer, Mettre en veille et Mettre en veille prolongée sont disponibles dans le menu Démarrer. Le bouton Marche/Arrêt est également disponible dans l’écran Sécurité Windows et l'écran de connexion.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer- Value name
HidePowerOptions
| State | Value written |
|---|---|
| Enabled | not defined in the ADMX |
| Disabled | not defined in the ADMX |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
The ADMX does not specify the value written when enabled; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled). The commands below use 1/0 as an assumption.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: StartMenu/HidePowerOptions
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'HidePowerOptions' -Value 1 -Type DWord # assumed value (not defined in the ADMX)Disable
# Disable: StartMenu/HidePowerOptions
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'HidePowerOptions' -Value 0 -Type DWord # assumed value (not defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": StartMenu/HidePowerOptions
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'HidePowerOptions' -ErrorAction SilentlyContinue