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 Start menu or Windows Security screen: 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 Power button and the Shut Down, 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.
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 screen is also available.
Note: Third-party programs certified as compatible with Microsoft Windows Vista, Windows XP SP2, Windows XP SP1, Windows XP, or Windows 2000 Professional are required to support this policy setting.
Ce paramètre de stratégie empêche les utilisateurs d’exécuter les commandes suivantes à partir du menu Démarrer ou de l’écran Sécurité Windows : 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é, le bouton Arrêter l’ordinateur et les commandes Arrêter, Redémarrer, Mettre en veille et Mettre en veille prolongée sont supprimés du menu Démarrer. Le bouton Arrêter l’ordinateur est également supprimé de l’écran Sécurité Windows, qui s’affiche lorsque vous appuyez sur Ctrl+Alt+Suppr.
Si ce paramètre de stratégie est désactivé ou n’est pas configuré, le bouton Arrêter l’ordinateur 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 Arrêter l’ordinateur est également disponible dans l’écran Sécurité Windows.
Remarque : des programmes tiers compatibles avec Microsoft Windows Vista, Windows XP SP2, Windows XP SP1, Windows XP ou Windows 2000 Professionnel sont nécessaires à la prise en charge de ce paramètre de stratégie.
Registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer- Value name
NoClose
| 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/NoClose
$k = 'HKCU:\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 'NoClose' -Value 1 -Type DWord # assumed value (not defined in the ADMX)Disable
# Disable: StartMenu/NoClose
$k = 'HKCU:\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 'NoClose' -Value 0 -Type DWord # assumed value (not defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": StartMenu/NoClose
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'NoClose' -ErrorAction SilentlyContinue