Open in the explorer

Maximum PIN length

Longueur maximale du code PIN

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › PIN Complexity FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Complexité du code confidentiel
Supported on
At least Windows 10 FR: Au minimum Windows 10
ADMX file
Passport.admx
Internal name
Passport/MSPassport_MaximumPINLength

Explanation

Maximum PIN length configures the maximum number of characters allowed for the PIN. The largest number you can configure for this policy setting is 127. The lowest number you can configure must be larger than the number configured in the Minimum PIN length policy setting or the number 4, whichever is greater.

If you configure this policy setting, the PIN length must be less than or equal to this number.

If you disable or do not configure this policy setting, the PIN length must be less than or equal to 127.

NOTE: If the above specified conditions for the maximum PIN length are not met, default values will be used for both the maximum and minimum PIN lengths.

French text from Windows 11 26H2

Longueur maximale du code PIN configure le nombre maximum de caractères autorisés pour le code confidentiel. Le plus grand nombre que vous pouvez configurer pour ce paramètre de stratégie est 127. Le plus petit nombre que vous pouvez configurer doit être supérieur au nombre configuré dans le paramètre de stratégie Longueur minimale du code confidentiel ou le nombre 4, selon le plus grand des deux.

Si vous configurez ce paramètre de stratégie, la longueur du code confidentiel doit être inférieure ou égale à ce nombre.

Si vous désactivez ou ne configurez pas ce paramètre de stratégie, la longueur du code confidentiel doit être inférieure ou égale à 127.

REMARQUE : si les conditions ci-dessus pour la longueur maximale du code confidentiel ne sont pas remplies, les valeurs par défaut seront utilisées pour les longueurs maximale et minimale du code confidentiel.

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PassportForWork\PINComplexity
Value name
not defined in the ADMX

Enable / disable values: not defined in the ADMX (see the options below).

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: Passport/MSPassport_MaximumPINLength
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\PassportForWork\PINComplexity'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Maximum PIN length
Set-ItemProperty -Path $k -Name 'MaximumPINLength' -Value 4 -Type DWord  # between 4 and 127

Disable

# Disable: Passport/MSPassport_MaximumPINLength
# No value is written in the "Disabled" state (nothing defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": Passport/MSPassport_MaximumPINLength
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\PassportForWork\PINComplexity'
Remove-ItemProperty -Path $k -Name 'MaximumPINLength' -ErrorAction SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
Maximum PIN lengthLongueur maximale du code PINMSPassport_MaximumPINLengthDataTypeNumeric boxdecimalMaximumPINLengthREG_DWORD
Min: 4 · Max: 127

Availability