Reverse the subject name stored in a certificate when displaying
Inverser le nom du sujet stocké dans un certificat lors de son affichage
Explanation
This policy setting lets you reverse the subject name from how it is stored in the certificate when displaying it during logon.
By default the user principal name (UPN) is displayed in addition to the common name to help users distinguish one certificate from another. For example, if the certificate subject was CN=User1, OU=Users, DN=example, DN=com and had an UPN of user1@example.com then "User1" will be displayed along with "user1@example.com." If the UPN is not present then the entire subject name will be displayed. This setting controls the appearance of that subject name and might need to be adjusted per organization.
If you enable this policy setting or do not configure this setting, then the subject name will be reversed.
If you disable , the subject name will be displayed as it appears in the certificate.
Ce paramètre de stratégie vous permet d’inverser le nom du sujet par rapport à son mode de stockage dans le certificat lorsqu’il est affiché à l’ouverture de session.
Par défaut, le nom d’utilisateur principal est affiché avec le nom commun pour aider les utilisateurs à différencier les certificats. Par exemple, si le sujet du certificat est CN=Utilisateur1, OU=Utilisateurs, DN=exemple, DN=com et si le nom d’utilisateur principal est utilisateur1@example.com, « Utilisateur1 » est affiché avec \« utilisateur1@example.com\. » Si le nom d’utilisateur principal n’est pas présent, le nom du sujet complet est affiché. Ce paramètre contrôle l’apparence du nom du sujet et doit parfois être ajusté en fonction de l’entreprise.
Si vous activez ce paramètre de stratégie, le nom du sujet est inversé.
Si vous désactivez ce paramètre de stratégie, le nom du sujet s’affiche tel qu’il apparaît dans le certificat.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SmartCardCredentialProvider- Value name
ReverseSubject
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
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: Smartcard/ReverseSubject
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SmartCardCredentialProvider'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ReverseSubject' -Value 1 -Type DWordDisable
# Disable: Smartcard/ReverseSubject
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SmartCardCredentialProvider'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ReverseSubject' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Smartcard/ReverseSubject
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\SmartCardCredentialProvider'
Remove-ItemProperty -Path $k -Name 'ReverseSubject' -ErrorAction SilentlyContinue