Open in the explorer

Do not log users on with temporary profiles

Ne pas ouvrir de session pour les utilisateurs avec des profils temporaires

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › User Profiles FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Profils utilisateur
Supported on
At least Windows 2000 FR: Au minimum Windows 2000
ADMX file
UserProfiles.admx
Internal name
UserProfiles/ProfileErrorAction

Explanation

This policy setting will automatically log off a user when Windows cannot load their profile.

If Windows cannot access the user profile folder or the profile contains errors that prevent it from loading, Windows logs on the user with a temporary profile. This policy setting allows the administrator to disable this behavior, preventing Windows from loggin on the user with a temporary profile.

If you enable this policy setting, Windows will not log on a user with a temporary profile. Windows logs the user off if their profile cannot be loaded.

If you disable this policy setting or do not configure it, Windows logs on the user with a temporary profile when Windows cannot load their user profile.

Also, see the "Delete cached copies of roaming profiles" policy setting.

French text from Windows 11 26H2

Ce paramètre de stratégie ferme automatiquement la session d’un utilisateur quand Windows ne peut pas charger son profil.

Si Windows ne peut pas accéder au dossier de profil utilisateur ou si le profil contient des erreurs qui empêchent son chargement, Windows ouvre une session pour l’utilisateur avec un profil temporaire. Ce paramètre de stratégie permet à l’administrateur de désactiver ce comportement et d’empêcher Windows d’ouvrir une session pour l’utilisateur avec un profil temporaire.

Si vous activez ce paramètre de stratégie, Windows n’ouvre pas de session pour un utilisateur avec un profil temporaire. Windows ferme la session de l’utilisateur si son profil ne peut pas être chargé.

Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, Windows ouvre une session pour l’utilisateur avec un profil temporaire quand il ne peut pas charger son profil utilisateur.

Consultez également le paramètre de stratégie « Supprimer les copies mises en cache des profils itinérants ».

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System
Value name
ProfileErrorAction
StateValue written
Enablednot defined in the ADMX
Disablednot 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: UserProfiles/ProfileErrorAction
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
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 'ProfileErrorAction' -Value 1 -Type DWord  # assumed value (not defined in the ADMX)

Disable

# Disable: UserProfiles/ProfileErrorAction
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
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 'ProfileErrorAction' -Value 0 -Type DWord  # assumed value (not defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": UserProfiles/ProfileErrorAction
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
Remove-ItemProperty -Path $k -Name 'ProfileErrorAction' -ErrorAction SilentlyContinue

Availability