Open in the explorer

Configure automatic account management

Configurer la gestion automatique des comptes

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › LAPS FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › LAPS
Supported on
At least Microsoft Windows 10 or later FR: Au moins Microsoft Windows 10 ou version ultérieure
ADMX file
LAPS.admx
Internal name
LAPS/LAPS_AutomaticAccountManagementPolicy

Explanation

This policy configures automatic account management policy options.

Specify the target account to manage: specifies whether the built-in admin account or a custom account should be managed.

Automatic account name (or name prefix): specifies the name, or name prefix, to use for the managed account.

If this policy setting is configured, Windows LAPS will use it as the account name or name prefix for the target account.

If this policy setting is not configured, Windows LAPS will use "WLapsAdmin" as the account name or name prefix.

Note: this name is treated as a prefix when account name randomization is configured, see comments below.

Enable the managed account: specifies whether the managed account should be enabled or not.

If this policy setting is configured, Windows LAPS will enable the specified managed account.

If this policy setting is not configured, Windows LAPS will disable the specified managed account.

Note: Windows LAPS will regularly maintain and rotate the password of the managed account regardless of whether the account is maintained in an enabled\disabled status.

Randomize the name of the managed account: specifies whether the name of the managed account should be randomized with a random numeric suffix.

If this policy setting is configured, Windows LAPS will add an eight digit random numeric suffix to the managed automatic account name, and will re-randomize the name of the managed account every time the password is rotated.

If this policy setting is not configured, Windows LAPS will use the managed automatic account name as configured.

If the managed automatic account name prefix is configured, Windows LAPS will use up to the first twelve (12) characters of that name as a prefix for the random name. If the managed automatic account name is not configured, Windows LAPS will use "WLapsAdmin" as the name prefix.

Note: the DSRM account on domain controllers cannot be configured for automatic account management. This policy has no effect on domain controllers and will be ignored even if configured for a DC.

See https://go.microsoft.com/fwlink/?linkid=2188435 for more information.

French text from Windows 11 26H2

Cette stratégie configure les options de stratégie de gestion automatique des comptes.

Spécifiez le compte cible à gérer : spécifie si le compte d’administrateur intégré ou un compte personnalisé doit être géré.

Nom du compte automatique (ou préfixe de nom) : spécifie le nom, ou le préfixe de nom, à utiliser pour le compte géré.

Si ce paramètre de stratégie est configuré, Windows LAPS l'utilisera comme nom de compte ou préfixe de nom pour le compte cible.

Si ce paramètre de stratégie n’est pas configuré, Windows LAPS utilise « WLapsAdmin » comme préfixe de nom ou de nom de compte.

Remarque : ce nom est traité comme un préfixe lorsque le choix au hasard des noms de comptes est configurée, voir les commentaires ci-dessous.

Activer le compte géré : spécifie si le compte géré doit être activé ou non.

Si ce paramètre de stratégie est configuré, Windows LAPS active le compte géré spécifié.

Si ce paramètre de stratégie n’est pas configuré, Windows LAPS désactive le compte géré spécifié.

Remarque : Windows LAPS maintient et renouvelle régulièrement le code d'accès du compte géré, que le compte soit maintenu dans un état activé ou désactivé.

Choisir au hasard le nom du compte géré : spécifie si le nom du compte géré doit être choisi au hasard avec un suffixe numérique aléatoire.

Si ce paramètre de stratégie est configuré, Windows LAPS ajoute un suffixe numérique aléatoire à huit chiffres au nom du compte automatique managé et rend aléatoire à nouveau le nom du compte géré chaque fois que le code d'accès est renouvelé.

Si ce paramètre de stratégie n’est pas configuré, Windows LAPS utilise le nom du compte automatique géré tel qu'il a été configuré.

Si le préfixe du nom du compte automatique géré est configuré, Windows LAPS utilise jusqu'aux douze (12) premiers caractères de ce nom comme préfixe pour le nom aléatoire. Si ce paramètre de stratégie n’est pas configuré, Windows LAPS utilise « WLapsAdmin » comme préfixe de nom.

Remarque : le compte DSRM sur les contrôleurs de domaine ne peut pas être configuré pour la gestion automatique des comptes. Cette stratégie n’a aucun effet sur les contrôleurs de domaine et sera ignorée même si elle est configurée pour un contrôleur de domaine.

Voir « https://go.microsoft.com/fwlink/?linkid=2188435 » pour plus d'informations.

Use cases

Lets Windows LAPS create and manage a dedicated local administrator account itself (named WLapsAdmin by default, with an optional random name), without a provisioning script. It is convenient for disabling the built-in administrator while keeping a break-glass account.

Only for Windows 11 24H2 and Windows Server 2025; the account is created disabled by default, so enable the corresponding option before it can be used.

Microsoft sources: Configure policy settings for Windows LAPS · Windows LAPS overview

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS
Value name
AutomaticAccountManagementEnabled
StateValue written
EnabledREG_DWORD = 1
DisabledREG_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: LAPS/LAPS_AutomaticAccountManagementPolicy
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AutomaticAccountManagementEnabled' -Value 1 -Type DWord
# Specify the target account to manage
# Possible options:
#   Manage the built-in admin account = 0
#   Manage a custom admin account = 1
Set-ItemProperty -Path $k -Name 'AutomaticAccountManagementTarget' -Value 0 -Type DWord
# Automatic account name (or name prefix)
Set-ItemProperty -Path $k -Name 'AutomaticAccountManagementNameOrPrefix' -Value '<value>' -Type String
# Enable the managed account
# value not defined in the ADMX (the GPO editor usually writes 1/0)
# 1 = checked, 0 = unchecked; default state taken from the ADML
Set-ItemProperty -Path $k -Name 'AutomaticAccountManagementEnableAccount' -Value 1 -Type DWord
# Randomize the name of the managed account
Set-ItemProperty -Path $k -Name 'AutomaticAccountManagementRandomizeName' -Value 1 -Type DWord  # value not defined in the ADMX; 1 = checked, 0 = unchecked

Disable

# Disable: LAPS/LAPS_AutomaticAccountManagementPolicy
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AutomaticAccountManagementEnabled' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": LAPS/LAPS_AutomaticAccountManagementPolicy
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS'
Remove-ItemProperty -Path $k -Name 'AutomaticAccountManagementEnabled' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'AutomaticAccountManagementTarget' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'AutomaticAccountManagementNameOrPrefix' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'AutomaticAccountManagementEnableAccount' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'AutomaticAccountManagementRandomizeName' -ErrorAction SilentlyContinue

Options (4)

LabelControlRegistry valueREG typeConstraints / details
Specify the target account to manage:Spécifiez le compte cible à gérer :LAPS_AutomaticAccountManagementTargetDrop-down listenumAutomaticAccountManagementTargetREG_DWORD
Default choice (UI): #0
LabelValue
Manage the built-in admin accountREG_DWORD = 0
Manage a custom admin accountREG_DWORD = 1
Automatic account name (or name prefix):Nom du compte automatique (ou préfixe du nom) :LAPS_AutomaticAccountManagementNameOrPrefixText boxtextAutomaticAccountManagementNameOrPrefixREG_SZ
Max length: 20
Enable the managed accountActiver le compte géréLAPS_AutomaticAccountManagementEnableAccountCheck boxbooleanAutomaticAccountManagementEnableAccountREG_DWORD
Checked: implicit: 1
Unchecked: implicit: 0
Randomize the name of the managed accountChoisir au hasard le nom du compte géréLAPS_AutomaticAccountManagementRandomizeNameCheck boxbooleanAutomaticAccountManagementRandomizeNameREG_DWORD
Checked: implicit: 1
Unchecked: implicit: 0

Availability

Windows 11

✓ 26H2✓ 25H2✓ 24H2— 23H2— 22H2— 21H2

Windows 10

— 22H2— 21H2— 21H1— 20H2— 2004— 1909— 1903— 1809— 1803— 1709— 1703— 1607— 1511— 1507

Windows Server

✓ 2025— 2022— 2016