System › LAPS
Configure automatic account management
Supported on At least Microsoft Windows 10 or later
What it does
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.
What it writes
- Hive
- HKEY_LOCAL_MACHINE
- Registry key
SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS- Value name
AutomaticAccountManagementEnabled- When enabled
- DWORD 1
- When disabled
- DWORD 0
In Intune
No native CSP; import the ADMX (Intune-ready).
From Microsoft's Policy CSP DDF files (DDF v2 Files, February 2026), read 18 Oct 2026.
Options
| Option | Type | Registry value | Allowed values |
|---|---|---|---|
| Specify the target account to manageDefault: Manage the built-in admin account | Drop-down list | AutomaticAccountManagementTarget |
|
| Automatic account name (or name prefix) | Text | AutomaticAccountManagementNameOrPrefix |
Up to 20 characters |
| Enable the managed account | Checkbox | AutomaticAccountManagementEnableAccount |
On (1) or off (0) |
| Randomize the name of the managed account | Checkbox | AutomaticAccountManagementRandomizeName |
On (1) or off (0) |
Configure and deploy
Choose a state and the option values; the output below is generated from the template for exactly that.
Enabled · Computer · template defaults
Registry file (.reg)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS]
"AutomaticAccountManagementEnableAccount"=dword:00000001
"AutomaticAccountManagementEnabled"=dword:00000001
"AutomaticAccountManagementNameOrPrefix"=""
"AutomaticAccountManagementRandomizeName"=dword:00000001
"AutomaticAccountManagementTarget"=dword:00000000
PowerShell
$ErrorActionPreference = 'Stop'
function Set-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $PropertyType,
[Parameter(Mandatory = $true)][object] $Value
)
if (-not (Test-Path -LiteralPath $Path)) {
New-Item -Path $Path -Force | Out-Null
}
New-ItemProperty -LiteralPath $Path -Name $Name -PropertyType $PropertyType -Value $Value -Force | Out-Null
}
function Remove-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (Test-Path -LiteralPath $Path) {
Remove-ItemProperty -LiteralPath $Path -Name $Name -Force -ErrorAction SilentlyContinue
}
}
function Clear-RegistryKeyValues {
param(
[Parameter(Mandatory = $true)][string] $Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
foreach ($propertyName in (Get-Item -LiteralPath $Path).Property) {
Remove-ItemProperty -LiteralPath $Path -Name $propertyName -Force -ErrorAction SilentlyContinue
}
}
# Policy: Configure automatic account management
# Name: LAPS_AutomaticAccountManagementPolicy
# Scope: Machine
# State: Enabled
# Source: LAPS.admx
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementEnabled' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementTarget' -PropertyType 'DWord' -Value 0
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementNameOrPrefix' -PropertyType 'String' -Value ''
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementEnableAccount' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementRandomizeName' -PropertyType 'DWord' -Value 1
- The OMA-URI is an inferred ADMX-backed Policy CSP candidate derived from the source ADMX file name and policy name.
- Some Microsoft policies use built-in Policy CSP pages whose area names don't match the ADMX file name, so verify the candidate against Microsoft Learn before deployment.
- The generated payload is incomplete because one or more ADMX element values were not supplied: LAPS_AutomaticAccountManagementNameOrPrefix, LAPS_AutomaticAccountManagementEnableAccount, LAPS_AutomaticAccountManagementRandomizeName
ADMX profile candidate (OMA-URI)
./Device/Vendor/MSFT/Policy/Config/ADMX_LAPS/LAPS_AutomaticAccountManagementPolicyIntune remediation scripts
Detection
$ErrorActionPreference = 'Stop'
$reasons = [System.Collections.Generic.List[string]]::new()
function Test-RegistryValueExists {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (-not (Test-Path -LiteralPath $Path)) {
return $false
}
return $null -ne (Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction SilentlyContinue)
}
function Test-RegistryValueEquals {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $Kind,
[Parameter(Mandatory = $true)][object] $Expected
)
if (-not (Test-Path -LiteralPath $Path)) {
return $false
}
$valueObject = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction SilentlyContinue
if ($null -eq $valueObject) {
return $false
}
$actual = $valueObject.$Name
switch ($Kind) {
'String' { return [string]$actual -ceq [string]$Expected }
'ExpandString' { return [string]$actual -ceq [string]$Expected }
'DWord' { return [uint32]$actual -eq [uint32]$Expected }
'QWord' { return [uint64]$actual -eq [uint64]$Expected }
'MultiString' {
$actualArray = @($actual)
$expectedArray = @($Expected)
if ($actualArray.Count -ne $expectedArray.Count) { return $false }
for ($index = 0; $index -lt $actualArray.Count; $index++) {
if ([string]$actualArray[$index] -cne [string]$expectedArray[$index]) { return $false }
}
return $true
}
'Binary' {
$actualArray = [byte[]]$actual
$expectedArray = [byte[]]$Expected
if ($actualArray.Length -ne $expectedArray.Length) { return $false }
for ($index = 0; $index -lt $actualArray.Length; $index++) {
if ($actualArray[$index] -ne $expectedArray[$index]) { return $false }
}
return $true
}
default { return [string]$actual -ceq [string]$Expected }
}
}
# Policy: Configure automatic account management
# Name: LAPS_AutomaticAccountManagementPolicy
# Scope: Machine
# State: Enabled
# Source: LAPS.admx
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementEnabled' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS\AutomaticAccountManagementEnabled') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementTarget' -Kind 'DWord' -Expected 0
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS\AutomaticAccountManagementTarget') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementNameOrPrefix' -Kind 'String' -Expected ''
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS\AutomaticAccountManagementNameOrPrefix') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementEnableAccount' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS\AutomaticAccountManagementEnableAccount') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementRandomizeName' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS\AutomaticAccountManagementRandomizeName') | Out-Null
}
if ($reasons.Count -eq 0) {
Write-Output 'Compliant'
exit 0
}
$reasons | ForEach-Object { Write-Output $_ }
exit 1
Remediation
$ErrorActionPreference = 'Stop'
function Set-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $PropertyType,
[Parameter(Mandatory = $true)][object] $Value
)
if (-not (Test-Path -LiteralPath $Path)) {
New-Item -Path $Path -Force | Out-Null
}
New-ItemProperty -LiteralPath $Path -Name $Name -PropertyType $PropertyType -Value $Value -Force | Out-Null
}
function Remove-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (Test-Path -LiteralPath $Path) {
Remove-ItemProperty -LiteralPath $Path -Name $Name -Force -ErrorAction SilentlyContinue
}
}
function Clear-RegistryKeyValues {
param(
[Parameter(Mandatory = $true)][string] $Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
foreach ($propertyName in (Get-Item -LiteralPath $Path).Property) {
Remove-ItemProperty -LiteralPath $Path -Name $propertyName -Force -ErrorAction SilentlyContinue
}
}
# Policy: Configure automatic account management
# Name: LAPS_AutomaticAccountManagementPolicy
# Scope: Machine
# State: Enabled
# Source: LAPS.admx
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementEnabled' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementTarget' -PropertyType 'DWord' -Value 0
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementNameOrPrefix' -PropertyType 'String' -Value ''
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementEnableAccount' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'AutomaticAccountManagementRandomizeName' -PropertyType 'DWord' -Value 1
History 5 retained releases
- 24H2 · 1.030 Sep 2024
- Added in this release.
1 later release left it unchanged.
Template
- Internal name
LAPS_AutomaticAccountManagementPolicy- Namespace
Microsoft.Policies.LAPS- Template file
LAPS.admx- Release
- Windows 11 25H2 · 1.0 · file set
de4e49983ebd651f…
Definition, editor controls and support
Definition
<policy class="Machine" displayName="$(string.LAPS_AutomaticAccountManagementPolicy)" explainText="$(string.LAPS_AutomaticAccountManagementPolicy_Help)" key="SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" name="LAPS_AutomaticAccountManagementPolicy" presentation="$(presentation.LAPS_AutomaticAccountManagementPolicy)" valueName="AutomaticAccountManagementEnabled" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="Microsoft.Policies.LAPS:LAPS_CAT" />
<supportedOn ref="Microsoft.Policies.LAPS:SUPPORTED_Windows10" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
<elements>
<enum id="LAPS_AutomaticAccountManagementTarget" valueName="AutomaticAccountManagementTarget">
<item displayName="$(string.AutomaticAccountManagementTarget_Item0)">
<value>
<decimal value="0" />
</value>
</item>
<item displayName="$(string.AutomaticAccountManagementTarget_Item1)">
<value>
<decimal value="1" />
</value>
</item>
</enum>
<text id="LAPS_AutomaticAccountManagementNameOrPrefix" maxLength="20" valueName="AutomaticAccountManagementNameOrPrefix" />
<boolean id="LAPS_AutomaticAccountManagementEnableAccount" valueName="AutomaticAccountManagementEnableAccount" />
<boolean id="LAPS_AutomaticAccountManagementRandomizeName" valueName="AutomaticAccountManagementRandomizeName" />
</elements>
</policy>Editor controls
<presentation id="LAPS_AutomaticAccountManagementPolicy" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<dropdownList defaultItem="0" refId="LAPS_AutomaticAccountManagementTarget">Specify the target account to manage:</dropdownList>
<textBox refId="LAPS_AutomaticAccountManagementNameOrPrefix">
<label>Automatic account name (or name prefix):</label>
</textBox>
<checkBox refId="LAPS_AutomaticAccountManagementEnableAccount">Enable the managed account</checkBox>
<checkBox refId="LAPS_AutomaticAccountManagementRandomizeName">Randomize the name of the managed account</checkBox>
</presentation>Supported platforms and category
Microsoft.Policies.LAPS:category:LAPS_CAT
<category displayName="$(string.LAPS)" name="LAPS_CAT" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="Microsoft.Policies.Windows:System" />
</category>
Microsoft.Policies.LAPS:definition:SUPPORTED_Windows10
<definition displayName="$(string.SUPPORTED_Windows10)" name="SUPPORTED_Windows10" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
Microsoft.Policies.Windows:category:System
<category displayName="$(string.System)" explainText="$(string.System_Help)" name="System" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
Microsoft.Policies.LAPS:category:LAPS_CAT
<category displayName="$(string.LAPS)" name="LAPS_CAT" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="Microsoft.Policies.Windows:System" />
</category>
<strings><string id="Microsoft.Policies.LAPS:LAPS">LAPS</string></strings>
Microsoft.Policies.LAPS:definition:SUPPORTED_Windows10
<definition displayName="$(string.SUPPORTED_Windows10)" name="SUPPORTED_Windows10" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
<strings><string id="Microsoft.Policies.LAPS:SUPPORTED_Windows10">At least Microsoft Windows 10 or later</string></strings>
Microsoft.Policies.Windows:category:System
<category displayName="$(string.System)" explainText="$(string.System_Help)" name="System" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
<strings><string id="Microsoft.Policies.Windows:System">System</string><string id="Microsoft.Policies.Windows:System_Help">Allows configuration of various system component settings.</string></strings>