Display instructions in logoff scripts as they run
Afficher des instructions des scripts de fermeture de session pendant leur exécution
Explanation
This policy setting displays the instructions in logoff scripts as they run.
Logoff scripts are batch files of instructions that run when the user logs off. By default, the system does not display the instructions in the logoff script.
If you enable this policy setting, the system displays each instruction in the logoff script as it runs. The instructions appear in a command window. This policy setting is designed for advanced users.
If you disable or do not configure this policy setting, the instructions are suppressed.
Ce paramètre de stratégie affiche les instructions des scripts de fermeture de session pendant leur exécution.
Les scripts de fermeture de session sont des fichiers de commandes comprenant des instructions qui sont exécutées chaque fois que l’utilisateur ferme une session. Par défaut, le système n’affiche pas les instructions du script de fermeture de session.
Si vous activez ce paramètre de stratégie, le système affiche chaque instruction du script de fermeture de session pendant son exécution. Les instructions apparaissent dans une fenêtre de commandes. Ce paramètre de stratégie est destiné aux utilisateurs expérimentés.
Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, les instructions sont supprimées.
Registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System- Value name
HideLogoffScripts
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 0 |
| Disabled | REG_DWORD = 1 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
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: Scripts/Run_Logoff_Script_Visible
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'HideLogoffScripts' -Value 0 -Type DWordDisable
# Disable: Scripts/Run_Logoff_Script_Visible
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'HideLogoffScripts' -Value 1 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Scripts/Run_Logoff_Script_Visible
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'HideLogoffScripts' -ErrorAction SilentlyContinue