Empêcher les utilisateurs de remplacer l’invite de commandes par Windows PowerShell dans le menu affiché quand ils cliquent avec le bouton droit dans l’angle inférieur gauche ou qu’ils appuient sur la touche Windows+X
Prevent users from replacing the Command Prompt with Windows PowerShell in the menu they see when they right-click the lower-left corner or press the Windows logo key+X
Explication
Ce paramètre de stratégie vous permet d’empêcher les utilisateurs de remplacer l’invite de commandes par Windows PowerShell dans le menu affiché quand ils cliquent avec le bouton droit dans l’angle inférieur gauche ou qu’ils appuient sur la touche Windows+X.
Si vous activez ce paramètre de stratégie, l'invite de commandes figure toujours dans ce menu et les utilisateurs ne peuvent pas la remplacer par Windows PowerShell. Les utilisateurs peuvent toujours accéder à Windows PowerShell, mais pas depuis ce menu.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, l’invite de commandes figure dans le menu par défaut et les utilisateurs peuvent configurer ce paramètre.
This policy setting allows you to prevent users from replacing the Command Prompt with Windows PowerShell in the menu they see when they right-click the lower-left corner or press the Windows logo key + X.
If you enable this policy setting, the Command Prompt will always be listed in that menu, and users won't be able to replace it with Windows PowerShell. Users will still be able to access Windows PowerShell, but not from that menu.
If you disable or don't configure this policy setting, Command Prompt will be listed in the menu by default, and users can configure this setting.
Registre
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI- Nom de la valeur
ShowCommandPromptOnWinX
| État | Valeur écrite |
|---|---|
| Activé | REG_DWORD = 1 |
| Désactivé | REG_DWORD = 0 |
PowerShell
Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.
Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.
Activer
# Activer : EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -Value 1 -Type DWordDésactiver
# Désactiver : EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -Value 0 -Type DWordRevenir à « Non configuré »
# Revenir à « Non configuré » : EdgeUI/ShowCommandPromptOnWinX
$k = 'HKCU:\Software\Policies\Microsoft\Windows\EdgeUI'
Remove-ItemProperty -Path $k -Name 'ShowCommandPromptOnWinX' -ErrorAction SilentlyContinue