# LAPS



# Configure policy settings for Windows LAPS

## Supported policy roots

Although we don't recommend it, you can administer a device by using multiple policy management mechanisms. To support this scenario in an understandable and predictable way, each Windows LAPS policy mechanism is assigned a distinct registry root key:

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-policy-name-policy-r"><table aria-label="Table 1" class="table table-sm margin-top-none"><thead><tr><th>Policy name</th><th>Policy registry key root</th></tr></thead><tbody><tr><td>LAPS CSP</td><td>`HKLM\Software\Microsoft\Policies\LAPS`</td></tr><tr><td>LAPS Group Policy</td><td>`HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\LAPS`</td></tr><tr><td>LAPS Local Configuration</td><td>`HKLM\Software\Microsoft\Windows\CurrentVersion\LAPS\Config`</td></tr><tr><td>Legacy Microsoft LAPS</td><td>`HKLM\Software\Policies\Microsoft Services\AdmPwd`</td></tr></tbody></table>

</div>Windows LAPS queries all known registry key policy roots, starting at the top and moving down. If no settings are found under a root, that root is skipped and the query proceeds to the next root. When a root that has at least one explicitly defined setting is found, that root is used as the active policy. If the chosen root is missing any settings, the settings are assigned their default values.

Policy settings are never shared or inherited across policy key roots.

 Tip

The LAPS Local Configuration key is included in the preceding table for completeness. You can use this key if necessary, but the key primarily is intended to be used for testing and development. No management tools or policy mechanisms target this key.

## Supported policy settings by BackupDirectory

Windows LAPS supports multiple policy settings that you can administer via various policy management solutions, or even directly via the registry. Some of these settings only apply when backing up passwords to Active Directory, and some settings are common to both the AD and Microsoft Entra scenarios.

The following table specifies which settings apply to devices that have the specified BackupDirectory setting:

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-1"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-setting-name-applica"><table aria-label="Table 2" class="table table-sm margin-top-none"><thead><tr><th>Setting name</th><th>Applicable when BackupDirectory=Microsoft Entra ID?</th><th>Applicable when BackupDirectory=AD?</th></tr></thead><tbody><tr><td>AdministratorAccountName</td><td>Yes</td><td>Yes</td></tr><tr><td>PasswordAgeDays</td><td>Yes</td><td>Yes</td></tr><tr><td>PasswordLength</td><td>Yes</td><td>Yes</td></tr><tr><td>PassphraseLength</td><td>Yes</td><td>Yes</td></tr><tr><td>PasswordComplexity</td><td>Yes</td><td>Yes</td></tr><tr><td>PostAuthenticationResetDelay</td><td>Yes</td><td>Yes</td></tr><tr><td>PostAuthenticationActions</td><td>Yes</td><td>Yes</td></tr><tr><td>ADPasswordEncryptionEnabled</td><td>No</td><td>Yes</td></tr><tr><td>ADPasswordEncryptionPrincipal</td><td>No</td><td>Yes</td></tr><tr><td>ADEncryptedPasswordHistorySize</td><td>No</td><td>Yes</td></tr><tr><td>ADBackupDSRMPassword</td><td>No</td><td>Yes</td></tr><tr><td>PasswordExpirationProtectionEnabled</td><td>No</td><td>Yes</td></tr><tr><td>AutomaticAccountManagementEnabled</td><td>Yes</td><td>Yes</td></tr><tr><td>AutomaticAccountManagementTarget</td><td>Yes</td><td>Yes</td></tr><tr><td>AutomaticAccountManagementNameOrPrefix</td><td>Yes</td><td>Yes</td></tr><tr><td>AutomaticAccountManagementEnableAccount</td><td>Yes</td><td>Yes</td></tr><tr><td>AutomaticAccountManagementRandomizeName</td><td>Yes</td><td>Yes</td></tr></tbody></table>

</div>If BackupDirectory is set to Disabled, all other settings are ignored.

You can administer almost all settings by using any policy management mechanism. The [Windows LAPS configuration service provider (CSP)](https://learn.microsoft.com/en-us/windows/client-management/mdm/laps-csp) has two exceptions to this rule. The Windows LAPS CSP supports two settings that aren't in the preceding table: ResetPassword and ResetPasswordStatus. Also, Windows LAPS CSP doesn't support the ADBackupDSRMPassword setting (domain controllers are never managed via CSP). For more information, see the LAPS CSP documentation.

## Windows LAPS Group Policy

Windows LAPS includes a new Group Policy Object that you can use to administer policy settings on Active Directory domain-joined devices. To access the Windows LAPS Group Policy, in Group Policy Management Editor, go to **Computer Configuration** &gt; **Administrative Templates** &gt; **System** &gt; **LAPS**. The following figure shows an example:

<span class="mx-imgBorder">![Screenshot of the Group Policy Management Editor that shows the Windows LAPS policy settings.](https://learn.microsoft.com/en-us/windows-server/identity/laps/media/laps-management-policy-settings/laps-management-policy-settings-group-policy-editor.png)</span>

The template for this new Group Policy object is installed as part of Windows at `%windir%\PolicyDefinitions\LAPS.admx`.

## Group Policy Object Central Store

 Important

The Windows LAPS GPO template files are NOT automatically copied to your GPO central store as part of a Windows Update patching operation, assuming you have chosen to implement that approach. Instead you must manually copy the LAPS.admx to the GPO central store location. See [Create and Manage Central Store](https://learn.microsoft.com/en-us/troubleshoot/windows-client/group-policy/create-and-manage-central-store).

## Windows LAPS CSP

Windows LAPS includes a specific CSP that you can use to administer policy settings on Microsoft Entra joined devices. Manage the [Windows LAPS CSP](https://learn.microsoft.com/en-us/windows/client-management/mdm/laps-csp) by using [Microsoft Intune](https://learn.microsoft.com/en-us/mem/intune).

## Apply policy settings

The following sections describe how to use and apply various policy settings for Windows LAPS.

### BackupDirectory

Use this setting to control which directory the password for the managed account is backed up to.

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-2"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-value-description-of"><table aria-label="Table 3" class="table table-sm margin-top-none"><thead><tr><th>Value</th><th>Description of setting</th></tr></thead><tbody><tr><td>0</td><td>Disabled (password isn't backed up)</td></tr><tr><td>1</td><td>Back up the password to Microsoft Entra-only</td></tr><tr><td>2</td><td>Back up the password to Windows Server Active Directory only</td></tr></tbody></table>

</div>If not specified, this setting defaults to 0 (Disabled).

### AdministratorAccountName

Use this setting to configure the name of the managed local administrator account.

If not specified, this setting defaults to managing the built-in local administrator account.

 Important

Don't specify this setting unless you want to manage an account other than the built-in local administrator account. The local administrator account is automatically identified by its well-known relative identifier (RID).

 Important

You can configure the specified account (built-in or custom) as either enabled or disabled. Windows LAPS will manage that account's password in either state. If left in a disabled state however, the account must obviously first be enabled in order to be actually used.

 Important

If you configure Windows LAPS to manage a custom local administrator account, you must ensure that the account is created. Windows LAPS doesn't create the account.

 Important

This setting is ignored when AutomaticAccountManagementEnabled is enabled.

### PasswordAgeDays

This setting controls the maximum password age of the managed local administrator account. Supported values are:

- **Minimum**: 1 day (When the backup directory is configured to be Microsoft Entra ID, the minimum is 7 days.)
- **Maximum**: 365 days

If not specified, this setting defaults to 30 days.

 Important

Changes to the PasswordAgeDays policy setting have no effect on the expiration time of the current password. Similarly, changes to the PasswordAgeDays policy setting won't cause the managed device to initiate a password rotation.

### PasswordLength

Use this setting to configure the length of the password of the managed local administrator account. Supported values are:

- **Minimum**: 8 characters
- **Maximum**: 64 characters

If not specified, this setting defaults to 14 characters.

 Important

Do not configure PasswordLength to a value that is incompatible with the managed device's local password policy. This will result in Windows LAPS failing to create a new compatible password (look for a 10027 event in the Windows LAP event log).

The PasswordLength setting is ignored unless PasswordComplexity is configured to one of the password options.

### PassphraseLength

Use this setting to configure the number of words in the passphrase of the managed local administrator account. Supported values are:

- **Minimum**: 3 words
- **Maximum**: 10 words

If not specified, this setting defaults to 6 words.

The PassphraseLength setting is ignored unless PasswordComplexity is configured to one of the passphrase options.

### PasswordComplexity

Use this setting to configure the required password complexity of the managed local administrator account, or to specify that a passphrase is created.

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-3"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-value-description-of-1"><table aria-label="Table 4" class="table table-sm margin-top-none"><thead><tr><th>Value</th><th>Description of setting</th></tr></thead><tbody><tr><td>1</td><td>Large letters</td></tr><tr><td>2</td><td>Large letters + small letters</td></tr><tr><td>3</td><td>Large letters + small letters + numbers</td></tr><tr><td>4</td><td>Large letters + small letters + numbers + special characters</td></tr><tr><td>5</td><td>Large letters + small letters + numbers + special characters (improved readability)</td></tr><tr><td>6</td><td>Passphrase (long words)</td></tr><tr><td>7</td><td>Passphrase (short words)</td></tr><tr><td>8</td><td>Passphrase (short words with unique prefixes)</td></tr></tbody></table>

</div>If not specified, this setting defaults to 4.

 Important

Windows supports the lower password complexity settings (1, 2, and 3) only for backward compatibility with legacy Microsoft LAPS. We recommend that you always configure this setting to 4.

 Important

Do not configure PasswordComplexity to a setting that is incompatible with the managed device's local password policy. This will result in Windows LAPS failing to create a new compatible password (look for a 10027 event in the Windows LAPS event log).

### PasswordExpirationProtectionEnabled

Use this setting to configure enforcement of maximum password age for the managed local administrator account.

Supported values are either 1 (True) or 0 (False).

If not specified, this setting defaults to 1 (True).

 Tip

In legacy Microsoft LAPS mode, this setting defaults to False for backward compatibility.

### ADPasswordEncryptionEnabled

Use this setting to enable encryption of passwords in Active Directory.

Supported values are either 1 (True) or 0 (False).

 Important

Enabling this setting requires that your Active Directory domain is running at Domain Functional Level 2016 or later.

### ADPasswordEncryptionPrincipal

Use this setting to configure the name or security identifier (SID) of a user or group that can decrypt the password stored in Active Directory.

This setting is ignored if the password currently is stored in Azure.

If not specified, only members of the Domain Admins group in the device's domain can decrypt the password.

If specified, the specified user or group can decrypt the password stored in Active Directory.

 Important

The string that's stored in this setting is either an SID in string form or the fully qualified name of a user or group. Valid examples include:

<div class="alert is-primary" id="bkmrk-s-1-5-21-2127521184-">- `S-1-5-21-2127521184-1604012920-1887927527-35197`
- `contoso\LAPSAdmins`
- `lapsadmins@contoso.com`

</div>The principal identified (either by SID or by user or group name) must exist and is resolvable by the device.

NOTE: the data specified in this setting is entered as-is; for example, do *not* add enclosing quotes or parentheses.

This setting is ignored unless ADPasswordEncryptionEnabled is configured to True and all other prerequisites are met.

This setting is ignored when Directory Services Repair Mode (DSRM) account passwords are backed up on a domain controller. In that scenario, this setting always defaults to the Domain Admins group of the domain controller's domain.

### ADEncryptedPasswordHistorySize

Use this setting to configure how many previous encrypted passwords are remembered in Active Directory. Supported values are:

- **Minimum** : 0 passwords
- **Maximum**: 12 passwords

If not specified, this setting defaults to 0 passwords (disabled).

 Important

This setting is ignored unless ADPasswordEncryptionEnabled is configured to True and all other prerequisites are met.

This setting also takes effect on domain controllers that back up their DSRM passwords.

### ADBackupDSRMPassword

Use this setting to enable backup of the DSRM account password on Windows Server Active Directory domain controllers.

Supported values are either 1 (True) or 0 (False).

This setting defaults to 0 (False).

 Important

This setting is ignored unless ADPasswordEncryptionEnabled is configured to True and all other prerequisites are met.

### PostAuthenticationResetDelay

Use this setting to specify the amount of time (in hours) to wait after an authentication before executing the specified post-authentication actions (see PostAuthenticationActions). Supported values are:

- **Minimum** : 0 hours (setting this value to 0 disables all post-authentication actions)
- **Maximum**: 24 hours

If not specified, this setting defaults to 24 hours.

### PostAuthenticationActions

Use this setting to specify the actions to take upon expiration of the configured grace period (see PostAuthenticationResetDelay).

This setting can have one of the following values:

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-4"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-value-name-actions-t"><table aria-label="Table 5" class="table table-sm margin-top-none"><thead><tr><th>Value</th><th>Name</th><th>Actions taken when the grace period expires</th><th>Comments</th></tr></thead><tbody><tr><td>1</td><td>Reset password</td><td>The managed account password is reset.</td><td> </td></tr><tr><td>3</td><td>Reset password and sign out</td><td>The managed account password is reset, interactive sign-in sessions using the managed account are terminated, and SMB sessions using the managed account are deleted.</td><td>Interactive sign-in sessions receive a nonconfigurable two-minute warning to save their work and sign out.</td></tr><tr><td>5</td><td>Reset password and reboot</td><td>The managed account password is reset and the managed device is restarted.</td><td>The managed device is restarted after a nonconfigurable one-minute delay.</td></tr><tr><td>11</td><td>Reset password and sign out</td><td>The managed account password is reset, interactive sign-in sessions using the managed account are terminated, SMB sessions using the managed account are deleted, and any remaining processes running under the managed account identity are terminated.</td><td>Interactive sign-in sessions receive a nonconfigurable two-minute warning to save their work and sign out.</td></tr></tbody></table>

</div>If not specified, this setting defaults to 3.

 Important

The allowed post-authentication actions are intended to help limit the amount of time a Windows LAPS password can be used before it's reset. Signing out of the managed account or restarting the device are options that help ensure the time is limited. Abruptly terminating signed-in sessions or restarting the device might result in data loss.

From a security perspective, a malicious user who acquires administrative privileges on a device using a valid Windows LAPS password does have the ultimate ability to prevent or circumvent these mechanisms.

### AutomaticAccountManagementEnabled

Use this setting to enable automatic account management.

Supported values are either 1 (True) or 0 (False).

This setting defaults to 0 (False).

### AutomaticAccountManagementTarget

Use this setting to specify whether the built-in Administrator account is automatically managed, or a new custom account.

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-5"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-value-description-of-2"><table aria-label="Table 6" class="table table-sm margin-top-none"><thead><tr><th>Value</th><th>Description of setting</th></tr></thead><tbody><tr><td>0</td><td>Automatically manage the built-in Administrator account</td></tr><tr><td>1</td><td>Automatically manage a new custom account</td></tr></tbody></table>

</div>This setting defaults to 1.

This setting is ignored unless AutomaticAccountManagementEnabled is enabled.

### AutomaticAccountManagementNameOrPrefix

Use this setting to specify the name or the name prefix of the automatically managed account.

This setting defaults to "WLapsAdmin".

This setting is ignored unless AutomaticAccountManagementEnabled is enabled.

### AutomaticAccountManagementEnableAccount

Use this setting to enable or disable the automatically managed account.

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-6"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-value-description-of-3"><table aria-label="Table 7" class="table table-sm margin-top-none"><thead><tr><th>Value</th><th>Description of setting</th></tr></thead><tbody><tr><td>0</td><td>Disable the automatically managed account</td></tr><tr><td>1</td><td>Enable the automatically managed account</td></tr></tbody></table>

</div>This setting defaults to 0.

This setting is ignored unless AutomaticAccountManagementEnabled is enabled.

### AutomaticAccountManagementRandomizeName

Use this setting to enable randomization of the name of the automatically managed account.

When this setting is enabled, the name of the managed account (determined by the AutomaticAccountManagementNameOrPrefix setting) is suffixed with a random six-digit suffix every time the password is rotated.

Windows local account names have a maximum length of 20 characters, which means the name component must be 14 characters long at most to have sufficient space for the random suffix. Account names specified by AutomaticAccountManagementNameOrPrefix that are longer than 14 characters are truncated.

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table-7"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-value-description-of-4"><table aria-label="Table 8" class="table table-sm margin-top-none"><thead><tr><th>Value</th><th>Description of setting</th></tr></thead><tbody><tr><td>0</td><td>Don't randomize the name of the automatically managed account</td></tr><tr><td>1</td><td>Randomize the name of the automatically managed account</td></tr></tbody></table>

</div>This setting defaults to 0.

This setting is ignored unless AutomaticAccountManagementEnabled is enabled.

## See also

- [Windows LAPS CSP](https://learn.microsoft.com/en-us/windows/client-management/mdm/laps-csp)
- [Microsoft Intune](https://learn.microsoft.com/en-us/mem/intune)

## Next steps

- [Use event logs for Windows LAPS](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-management-event-log)
- [Use Windows LAPS PowerShell cmdlet](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-management-powershell)
- [Windows LAPS schema extensions reference](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-technical-reference)

# Get started with Windows LAPS and Windows Server Active Directory

## Domain functional level and domain controller OS version requirements

If your domain is configured below 2016 Domain Functional Level (DFL), you can't enable Windows LAPS password encryption period. Without password encryption, clients can only be configured to store passwords in clear-text (secured by Active Directory ACLs) and DCs can't be configured to manage their local DSRM account.

Once your domain reaches 2016 DFL, you can enable Windows LAPS password encryption. However if you're still running any WS2016 DCs, those WS2016 DCs don't support Windows LAPS and therefore can't use the DSRM account management feature.

It's fine to use supported operating systems older than WS2016 on your domain controllers as long as you're aware of these limitations.

The following table summarizes the various supported-or-not scenarios:

<div class="buttons buttons-right margin-bottom-none margin-top-sm" id="bkmrk-expand-table"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus" id="bkmrk-domain-details-clear"><table aria-label="Table 1" class="table table-sm margin-top-none"><thead><tr><th>Domain details</th><th>Clear-text password storage supported</th><th>Encrypted password storage supported (for domain-joined clients)</th><th>DSRM account management supported (for DCs)</th></tr></thead><tbody><tr><td>Below 2016 DFL</td><td>Yes</td><td>No</td><td>No</td></tr><tr><td>2016 DFL with one or more WS2016 DCs</td><td>Yes</td><td>Yes</td><td>Yes but only for WS2019 and later DCs</td></tr><tr><td>2016 DFL with only WS2019 and later DCs</td><td>Yes</td><td>Yes</td><td>Yes</td></tr></tbody></table>

</div>Microsoft strongly recommends customer upgrade to the latest available operating system on clients, servers, and domain controllers in order to take advantage of latest features and security improvements.

## Update the Windows Server Active Directory schema

The Windows Server Active Directory schema must be updated prior to using Windows LAPS. This action is performed by using the `Update-LapsADSchema` cmdlet. It's a one-time operation for the entire forest. This operation can be performed on a Windows Server 2022 or Windows Server 2019 domain controller updated with Windows LAPS, but can also be performed on a non-domain-controller as long as it supports the Windows LAPS PowerShell module.

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
 Update-LapsADSchema
" style="box-sizing: inherit; outline-color: inherit; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 1em; direction: ltr; border: 0px; padding: 0px; line-height: 1.3571; display: block; position: relative;">PS C:\> Update-LapsADSchema

```

 Tip

Pass the `-Verbose` parameter to see detailed info on what the `Update-LapsADSchema` cmdlet (or any other cmdlet in the LAPS PowerShell module) is doing.

## Grant the managed device permission to update its password

The managed device needs to be granted permission to update its password. This action is performed by setting inheritable permissions on the Organizational Unit (OU) the device is in. The `Set-LapsADComputerSelfPermission` is used for this purpose, for example:

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-1"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
 Set-LapsADComputerSelfPermission -Identity NewLaps
" style="box-sizing: inherit; outline-color: inherit; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 1em; direction: ltr; border: 0px; padding: 0px; line-height: 1.3571; display: block; position: relative;">PS C:\> Set-LapsADComputerSelfPermission -Identity NewLaps

```

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-outputcopy"><span class="language">Output</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
Name    DistinguishedName
----    -----------------
NewLAPS OU=NewLAPS,DC=laps,DC=com

```

 Tip

If you prefer to set the inheritable permissions on the root of the domain, this is possible by specifying the entire domain root using DN syntax. For example, specify 'DC=laps,DC=com' for the -Identity parameter.

## Remove Extended Rights permissions

Some users or groups might already be granted Extended Rights permission on the managed device's OU. This permission is problematic because it grants the ability to read confidential attributes (all of the Windows LAPS password attributes are marked as confidential). One way to check to see who is granted these permissions is by using the `Find-LapsADExtendedRights` cmdlet. For example:

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-2"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
 Find-LapsADExtendedRights -Identity newlaps
" style="box-sizing: inherit; outline-color: inherit; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 1em; direction: ltr; border: 0px; padding: 0px; line-height: 1.3571; display: block; position: relative;">PS C:\> Find-LapsADExtendedRights -Identity newlaps

```

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-outputcopy-1"><span class="language">Output</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
ObjectDN                  ExtendedRightHolders
--------                  --------------------
OU=NewLAPS,DC=laps,DC=com {NT AUTHORITY\SYSTEM, LAPS\Domain Admins}

```

In the output in this example, only trusted entities (SYSTEM and Domain Admins) have the privilege. No other action is required.

## Configure device policy

Complete a few steps to configure the device policy.

### Choose a policy deployment mechanism

The first step is to choose how to apply policy to your devices.

Most environments use [Windows LAPS Group Policy](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-management-policy-settings#windows-laps-group-policy) to deploy the required settings to their Windows Server Active Directory-domain-joined devices.

If your devices are also hybrid-joined to Microsoft Entra ID, you can deploy policy by using [Microsoft Intune](https://learn.microsoft.com/en-us/mem/intune) with the [Windows LAPS configuration service provider (CSP)](https://learn.microsoft.com/en-us/windows/client-management/mdm/laps-csp).

### Configure specific policies

At a minimum, you must configure the BackupDirectory setting to the value 2 (backup passwords to Windows Server Active Directory).

If you don't configure the AdministratorAccountName setting, Windows LAPS defaults to managing the default built-in local administrator account. This built-in account is automatically identified using its well-known relative identifier (RID) and should never be identified using its name. The name of the built-in local administrator account varies depending on the default locale of the device.

If you want to configure a custom local administrator account, you should configure the AdministratorAccountName setting with the name of that account.

 Important

If you configure Windows LAPS to manage a custom local administrator account, you must ensure that the account is created. Windows LAPS doesn't create the account. We recommend that you use the [RestrictedGroups CSP](https://learn.microsoft.com/en-us/windows/client-management/mdm/policy-csp-restrictedgroups) to create the account.

You can configure other settings, like PasswordLength, as needed for your organization.

When you don't configure a given setting, the default value is applied - be sure to understand those defaults. For example if you enable password encryption but don't configure the ADPasswordEncryptionPrincipal setting, the password is encrypted so that only Domain Admins can decrypt it. You can configure ADPasswordEncryptionPrincipal with a different setting if you want non-Domain Admins to be able to decrypt.

## Update a password in Windows Server Active Directory

Windows LAPS processes the currently active policy on a periodic basis (every hour) and responds to Group Policy change notifications. It responds based on the policy and change notifications.

To verify that the password was successfully updated in Windows Server Active Directory, look in the event log for the 10018 event:

<span class="mx-imgBorder">![Screenshot of the event log that shows a successful Windows Server Active Directory password update event log message.](https://learn.microsoft.com/en-us/windows-server/identity/laps/media/laps-scenarios-windows-server-active-directory/laps-scenarios-windows-server-active-directory-password-update-event.png)</span>

To avoid waiting after you apply the policy, you can run the `Invoke-LapsPolicyProcessing` PowerShell cmdlet.

## Retrieve a password from Windows Server Active Directory

Use the `Get-LapsADPassword` cmdlet to retrieve passwords from Windows Server Active Directory. For example:

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-3"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
 Get-LapsADPassword -Identity lapsAD2 -AsPlainText
" style="box-sizing: inherit; outline-color: inherit; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 1em; direction: ltr; border: 0px; padding: 0px; line-height: 1.3571; display: block; position: relative;">PS C:\> Get-LapsADPassword -Identity lapsAD2 -AsPlainText

```

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-outputcopy-2"><span class="language">Output</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
ComputerName        : LAPSAD2
DistinguishedName   : CN=LAPSAD2,OU=NewLAPS,DC=laps,DC=com
Account             : Administrator
Password            : Zlh+lzC[0e0/VU
PasswordUpdateTime  : 7/1/2022 1:23:19 PM
ExpirationTimestamp : 7/31/2022 1:23:19 PM
Source              : EncryptedPassword
DecryptionStatus    : Success
AuthorizedDecryptor : LAPS\Domain Admins

```

This output result indicates that password encryption is enabled (see `Source`). Password encryption requires that your domain is configured for Windows Server 2016 Domain Functional Level or later.

## Rotate the password

Windows LAPS reads the password expiration time from Windows Server Active Directory during each policy processing cycle. If the password is expired, a new password is generated and stored immediately.

In some situations (for example, after a security breach or for ad-hoc testing), you might want to rotate the password early. To manually force a password rotation, you can use the `Reset-LapsPassword` cmdlet.

You can use the `Set-LapsADPasswordExpirationTime` cmdlet to set the scheduled password expiration time as stored in Windows Server Active Directory. For example:

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-4"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
 Set-LapsADPasswordExpirationTime -Identity lapsAD2
" style="box-sizing: inherit; outline-color: inherit; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 1em; direction: ltr; border: 0px; padding: 0px; line-height: 1.3571; display: block; position: relative;">PS C:\> Set-LapsADPasswordExpirationTime -Identity lapsAD2

```

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-outputcopy-3"><span class="language">Output</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
DistinguishedName                           Status
-----------------                           ------
CN=LAPSAD2,OU=NewLAPS,DC=laps,DC=com PasswordReset

```

The next time Windows LAPS wakes up to process the current policy, it sees the modified password expiration time and rotates the password. If you don't want to wait, you can run the `Invoke-LapsPolicyProcessing` cmdlet.

You can use the `Reset-LapsPassword` cmdlet to locally force an immediate rotation of the password.

## See also

- [Introducing Windows Local Administrator Password Solution with Microsoft Entra ID](https://techcommunity.microsoft.com/t5/microsoft-entra-azure-ad-blog/introducing-windows-local-administrator-password-solution-with/ba-p/1942487)
- [Windows Local Administrator Password Solution in Microsoft Entra ID (preview)](https://aka.ms/cloudlaps)
- [RestrictedGroups CSP](https://learn.microsoft.com/en-us/windows/client-management/mdm/policy-csp-restrictedgroups)
- [Microsoft Intune](https://learn.microsoft.com/en-us/mem/intune)
- [Microsoft Intune support for Windows LAPS](https://learn.microsoft.com/en-us/mem/intune/protect/windows-laps-overview)
- [Windows LAPS CSP](https://learn.microsoft.com/en-us/windows/client-management/mdm/laps-csp)
- [Windows LAPS Troubleshooting Guidance](https://learn.microsoft.com/en-us/troubleshoot/windows-server/windows-security/windows-laps-troubleshooting-guidance)

## Next steps

- [Configure Windows LAPS policy settings](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-management-policy-settings)
- [Use Windows LAPS event logs](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-management-event-log)
- [Use Windows LAPS PowerShell cmdlets](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-management-powershell)
- [Key concepts in Windows LAPS](https://learn.microsoft.com/en-us/windows-server/identity/laps/laps-concepts-overview)

# Securing Local Administrator Accounts with the new Windows LAPS - Active Directory - 2023-04-12

This article is divided into three parts:

1. What is Windows LAPS and what are the key differences between the legacy LAPS and the new version
2. How to deploy Windows LAPS
3. How to migrate from legacy LAPS to Windows LAPS

## What is Windows LAPS

Windows LAPS (Local Administration Password Solution) is a Windows feature that enables automatic management and backup of the password of a local administrator account on Azure Active Directory-joined or Windows Server Active Directory-joined devices.

The announcement post is [https://techcommunity.microsoft.com/t5/windows-it-pro-blog/by-popular-demand-windows-laps-available-now/ba-p/3788747](https://techcommunity.microsoft.com/t5/windows-it-pro-blog/by-popular-demand-windows-laps-available-now/ba-p/3788747)

It also facilitates automatic management and backup of the Directory Services Restore Mode (DSRM) account password on Windows Server Active Directory domain controllers. An authorized administrator can retrieve and utilize the DSRM password.

<div class="alert success" id="bkmrk-as-you-can-see-in-th">As you can see in this article, you don't need to install any PowerShell/.exe/.dll. Everything is now integrated in Windows.</div>## Windows LAPS supported platforms and Azure AD LAPS preview

<div class="alert danger" id="bkmrk-the-azure-active-dir">The Azure Active Directory LAPS scenario remains in private preview and is closed to new customers. The Azure Active Directory LAPS scenario is scheduled to enter public preview in Q2 2023.</div>Windows LAPS is now available and fully supported on the following OS platforms with the specified update or later installed:

- [Windows 11 22H2 - April 11 2023 Update](https://support.microsoft.com/help/5025239)
- [Windows 11 21H2 - April 11 2023 Update](https://support.microsoft.com/help/5025224)
- [Windows 10 - April 11 2023 Update](https://support.microsoft.com/help/5025221)
- [Windows Server 2022 - April 11 2023 Update](https://support.microsoft.com/help/5025230)
- [Windows Server 2019 - April 11 2023 Update](https://support.microsoft.com/help/5025229)

<div class="alert danger" id="bkmrk-the-april-11%2C-2023-u">The April 11, 2023 update has two potential regressions related to interoperability with legacy LAPS scenarios. Please read the following to understand the scenario parameters plus possible workarounds.  
  
Issue #1: If you install the legacy LAPS CSE on a device patched with the April 11, 2023 security update and an applied legacy LAPS policy, both Windows LAPS and legacy LAPS will enter a broken state where neither feature will update the password for the managed account. Symptoms include Windows LAPS event log IDs 10031 and 10033, as well as legacy LAPS event ID 6. Microsoft is working on a fix for this issue.  
  
Two primary workarounds exist for the above issue:  
a. Uninstall the legacy LAPS CSE (result: Windows LAPS will take over management of the managed account)  
b. Disable legacy LAPS emulation mode (result: legacy LAPS will take over management of the managed account)  
  
Issue #2: If you apply a legacy LAPS policy to a device patched with the April 11, 2023 update, Windows LAPS will immediately enforce\honor the legacy LAPS policy, which may be disruptive (for example if done during OS deployment workflow). Disable legacy LAPS emulation mode may also be used to prevent those issues.</div>## Windows LAPS Architecture

<figure class="kg-card kg-image-card kg-card-hascaption" id="bkmrk-laps-architecture">![](https://itpro-tips.com/content/images/2023/04/image-13.png)<figcaption>LAPS architecture</figcaption></figure>The Windows LAPS architecture diagram has several key components:

- IT admin: Represents collectively the various IT admin roles that might be involved in a Windows LAPS deployment. The IT admin roles are involved with policy configuration, expiration or retrieval of stored passwords, and interacting with managed devices.
- Managed device: Represents an Azure Active Directory-joined or Windows Server Active Directory-joined device on which you want to manage a local administrator account. The feature is composed of a few key binaries: 
    - *laps.dll* for core logic
    - *lapscsp.dll* for configuration service provider (CSP) logic
    - *lapspsh.dll* for PowerShell cmdlet logic. You also can configure Windows LAPS by using Group Policy. Windows LAPS responds to Group Policy Object (GPO) change notifications. The managed device can be a Windows Server Active Directory domain controller and be configured to back up Directory Services Repair Mode (DSRM) account passwords.
- Windows Server Active Directory: An on-premises Windows Server Active Directory deployment.
- Azure Active Directory: An Azure Active Directory deployment running in the cloud.
- Microsoft Intune The preferred Microsoft device policy management solution, also running in the cloud.

## PowerShell module

A new module is installed and you can get the CMDlets with:

```powershell
Get-Command -Module LAPS
```

<div class="code-toolbar" id="bkmrk-copy"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div><figure class="kg-card kg-image-card" id="bkmrk-">![](https://itpro-tips.com/content/images/2023/04/image-19.png)</figure><table id="bkmrk-cmdlet-description-g"><tbody><tr><th>Cmdlet</th><th>Description</th></tr><tr><td>Get-LapsAADPassword</td><td>Use to query Azure Active Directory for Windows LAPS passwords.</td></tr><tr><td>Get-LapsDiagnostics</td><td>Use to collect diagnostic information for investigating issues.</td></tr><tr><td>Find-LapsADExtendedRights</td><td>Use to discover which identities have been granted permissions for an Organization Unit (OU) in Windows Server Active Directory.</td></tr><tr><td>Get-LapsADPassword</td><td>Use to query Windows Server Active Directory for Windows LAPS passwords.</td></tr><tr><td>Invoke-LapsPolicyProcessing</td><td>Use to initiate a policy processing cycle.</td></tr><tr><td>Reset-LapsPassword</td><td>Use to initiate an immediate password rotation. Use when backing up the password to either Azure Active Directory or Windows Server Active Directory.</td></tr><tr><td>Set-LapsADAuditing</td><td>Use to configure Windows LAPS-related auditing on OUs in Windows Server Active Directory.</td></tr><tr><td>Set-LapsADComputerSelfPermission</td><td>Use to configure an OU in Windows Server Active Directory to allow computer objects to update their Windows LAPS passwords.</td></tr><tr><td>Set-LapsADPasswordExpirationTime</td><td>Use to update a computer's Windows LAPS password expiration time in Windows Server Active Directory.</td></tr><tr><td>Set-LapsADReadPasswordPermission</td><td>Use to grant permission to read the Windows LAPS password information in Windows Server Active Directory.</td></tr><tr><td>Set-LapsADResetPasswordPermission</td><td>Use to grant permission to update the Windows LAPS password expiration time in Windows Server Active Directory.</td></tr><tr><td>Update-LapsADSchema</td><td>Use to extend the Windows Server Active Directory schema with the Windows LAPS schema attributes.</td></tr></tbody></table>

## Windows LAPS PowerShell vs. legacy Microsoft LAPS PowerShell

Legacy Microsoft LAPS included a PowerShell module `AdmPwd.PS`.

This table presents a comparison between the old (ADMPwd.PS) and new (LAPS) modules, highlighting their similarities and differences.

<table id="bkmrk-windows-laps-cmdlet-"><tbody><tr><th>Windows LAPS cmdlet</th><th>Legacy Microsoft LAPS cmdlet</th></tr><tr><td>Get-LapsAADPassword</td><td>Doesn't apply</td></tr><tr><td>Get-LapsDiagnostics</td><td>Doesn't apply</td></tr><tr><td>Find-LapsADExtendedRights</td><td>Find-AdmPwdExtendedRights</td></tr><tr><td>Get-LapsADPassword</td><td>Get-AdmPwdPassword</td></tr><tr><td>Invoke-LapsPolicyProcessing</td><td>Doesn't apply</td></tr><tr><td>Reset-LapsPassword</td><td>Doesn't apply</td></tr><tr><td>Set-LapsADAuditing</td><td>Set-AdmPwdAuditing</td></tr><tr><td>Set-LapsADComputerSelfPermission</td><td>Set-AdmPwdComputerSelfPermission</td></tr><tr><td>Set-LapsADPasswordExpirationTime</td><td>Reset-AdmPwdPassword</td></tr><tr><td>Set-LapsADReadPasswordPermission</td><td>Set-AdmPwdReadPasswordPermission</td></tr><tr><td>Set-LapsADResetPasswordPermission</td><td>Set-AdmPwdResetPasswordPermission</td></tr><tr><td>Update-LapsADSchema</td><td>Update-AdmPwdADSchema</td></tr></tbody></table>

## Background policy processing cycle

<figure class="kg-card kg-image-card kg-card-hascaption" id="bkmrk-background-policy">![](https://itpro-tips.com/content/images/2023/04/image-14.png)<figcaption>Background policy</figcaption></figure>## How to deploy Windows LAPS

### Extend AD schema

<div class="alert warning" id="bkmrk-you-need-to-be-part-">You need to be part of the Schema Admins group to modify the Active Directory schema.</div>The Active Directory schema must be updated prior to using Windows LAPS.

This action is performed by using the following cmdlet.

```powershell
Update-LapsADSchema
```

<div class="code-toolbar" id="bkmrk-copy-1"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div>The schema is forest-wide, so you only need to perform this action once for your entire forest.

`Update-LapsADSchema` adds the following attributes to the directory and to the `mayContain` list on the computer schema class.ms-LAPS-Password

- ms-LAPS-PasswordExpirationTime
- ms-LAPS-EncryptedPassword
- ms-LAPS-EncryptedPasswordHistory
- ms-LAPS-EncryptedDSRMPassword
- ms-LAPS-EncryptedDSRMPasswordHistory
- ms-LAPS-Encrypted-Password-Attributes

### Grant the managed device permission to update its password

<div class="alert danger" id="bkmrk-it-is-highly-recomme">It is highly recommended to have a full understanding of this command before running it.  
  
Do NOT RUN this command if you don't understand.</div>The managed device needs to be granted permission to update its password. This action is performed by setting inheritable permissions on the Organizational Unit (OU) the device is in.

The `Set-LapsADComputerSelfPermission` is used for this purpose, for example:

```powershell
Set-LapsADComputerSelfPermission -Identity OUName
```

<div class="code-toolbar" id="bkmrk-copy-2"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div>### Remove Extended Rights permissions

<div class="alert danger" id="bkmrk-it-is-highly-recomme-1">It is highly recommended to have a full understanding of this command before running it.  
  
Do NOT RUN this command if you don't understand.</div>Some users or groups might already be granted `Extended Rights` permission on the managed device's OU.

Granting this permission can be problematic because it provides access to read confidential attributes, including all of the Windows LAPS password attributes that are marked as confidential.

To identify who has been granted these permissions, one option is to use the following method:

```powershell
Find-LapsADExtendedRights -Identity OUName
```

<div class="code-toolbar" id="bkmrk-copy-3"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div>The ouput is:

```powershell
ObjectDN                  ExtendedRightHolders
--------                  --------------------
OU=OUName,DC=lab,DC=com {NT AUTHORITY\SYSTEM, LAB\Domain Admins}
```

<div class="code-toolbar" id="bkmrk-copy-4"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div>In this example, only trusted entities (SYSTEM and Domain Admins) have the privilege. No other action is required.

### Deploy ADMX/ADML files

The ADMX and ADML files are deployed in `%windir%\policydefinitions`by default after the update.

To configure the GPO from all your domain controllers, you must copy `LAPS.admx` and `LAPS.adml` (in en-us by default) to your central store (if any).

Please note you need to install the update on the domain controller if you want to manage DSRM accounts.

### Configure GPO for Windows LAPS

A new Group Policy Object is available with Windows LAPS, which enables administrators to manage policy settings on Active Directory domain-joined devices.

In the Group Policy Management console, you'll find the new settings in **Computer Configuration** &gt; **Administrative Templates** &gt; **System** &gt; **LAPS**

<figure class="kg-card kg-image-card" id="bkmrk--1">![](https://itpro-tips.com/content/images/2023/04/image-16.png)</figure>## How to migrate from legacy LAPS to Windows LAPS

### Coexistence

In case you miss the info at the beginning of this post:

There is a legacy LAPS interop bug in the above April 11, 2023 update. Please see the message in the *Windows LAPS supported platforms and Azure AD LAPS preview* part.

You can work around this issue by either:

- uninstalling legacy LAPS
- or deleting all registry values under the `HKLM\Software\Microsoft\Windows\CurrentVersion\LAPS\State` registry key.

### Migrate

For now, Microsoft doesn't release the documentation.

But a comment [from Microsoft Jay Simmons on this page](https://techcommunity.microsoft.com/t5/windows-it-pro-blog/by-popular-demand-windows-laps-available-now/ba-p/3788747) provides a high level steps. As usual, adapt them for your environment:

1\) Extend your AD schema with the new Windows LAPS attributes

2\) Add a new local admin account to your managed devices (call it "LapsAdmin2")

3\) Enable the new Windows LAPS policies to target LapsAdmin2.

4\) Run Windows LAPS and legacy LAPS side-by-side for as long as needed to gain confidence in the solution (and also update IT worker\\helpdesk procedures, monitoring software, etc). Note you will have two (2) separately managed local managed accounts that you may choose to use during this time.

5\) Once happy, remove the legacy LAPS CSE from your managed devices.

6\) Delete the original LapsAdmin account.

7\) (Optionally), purge the now defunct legacy LAPS policy registry entries.

# Set-LapsADReadPasswordPermission

[https://learn.microsoft.com/en-us/powershell/module/laps/set-lapsadreadpasswordpermission?view=windowsserver2022-ps](https://learn.microsoft.com/en-us/powershell/module/laps/set-lapsadreadpasswordpermission?view=windowsserver2022-ps)

## Syntax

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
]
   -Identity <String[]>
   -AllowedPrincipals <String[]>
   [-Domain <String>]
   [-DomainController <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]" dir="ltr" style="box-sizing: inherit; outline-color: inherit; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 1em; direction: ltr; border: 0px; padding: 0px; line-height: 1.3571; display: block; position: relative;">Set-LapsADReadPasswordPermission
   [-Credential <PSCredential>]
   -Identity <String[]>
   -AllowedPrincipals <String[]>
   [-Domain <String>]
   [-DomainController <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
```

## Description

The `Set-LapsADReadPasswordPermission` cmdlet is used by administrators to configure security permissions on an OU to allow specific users or groups to query LAPS passwords on computers in that OU. Users and groups must be fully qualified with both domain and user name components. The only exception to this is when the specified name resolves to a built-in principal, such as `Domain Admins`.

## Examples

### Example 1

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-1"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
Set-LapsADReadPasswordPermission -Identity LapsTestOU -AllowedPrincipals "Domain Admins"

Name       DistinguishedName
----       -----------------
LapsTestOU OU=LapsTestOU,DC=laps,DC=com
```

This example shows how to run the cmdlet with an isolated name that successfully maps to a well-known user or group.

### Example 2

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-2"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
Set-LapsADReadPasswordPermission -Identity LapsTestOU -AllowedPrincipals @("S-1-5-21-2889755270-1324585639-743026605-1215")

Name       DistinguishedName
----       -----------------
LapsTestOU OU=LapsTestOU,DC=laps,DC=com
```

This example shows how to run the cmdlet specifying a user SID as input.

### Example 3

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-3"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
Set-LapsADReadPasswordPermission -Identity 'OU=LapsTestOU,DC=laps,DC=com' -AllowedPrincipals @("laps.com\LapsAdmin1", "LapsAdmin2@laps.com")

Name       DistinguishedName
----       -----------------
LapsTestOU OU=LapsTestOU,DC=laps,DC=com
```

This example shows how to run the cmdlet specifying two fully qualified user names in different formats.

### Example 4

<div class="codeHeader" data-bi-name="code-header" id="bkmrk-powershellcopy-4"><span class="language">PowerShell</span><button class="action position-relative display-none-print" data-bi-name="copy" type="button">Copy</button><div aria-hidden="true" class="successful-copy-alert position-absolute right-0 top-0 left-0 bottom-0 display-flex align-items-center justify-content-center has-text-success-invert has-background-success is-transparent">  
</div></div>```
Set-LapsADReadPasswordPermission -Identity LapsTestOU -AllowedPrincipals @("LapsAdministratorsGroup")

Set-LapsADReadPasswordPermission : The 'LapsAdministratorsGroup' account appears to be an isolated
name but is not a well-known name. Please use a fully qualified name instead, such as
"LAPSAdmins@contoso.com" or "contoso\LAPSAdmins"
At line:1 char:1
+ Set-LapsADReadPasswordPermission -Identity LapsTestOU -AllowedPrincip ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-LapsADReadPasswordPermission], LapsPowershellException
    + FullyQualifiedErrorId : Invalid principal specified,Microsoft.Windows.LAPS.SetLapsADReadPasswordPermission
```

This example shows a failure caused by specifying an isolated name that didn't resolve to a well-known or built-in account. The fix for this error would be to add a domain name qualifier to the input name, for example `LapsAdministratorsGroup@laps.com`.

## Parameters

### -AllowedPrincipals

Specifies the name of the users or groups should be granted the permissions. Users or groups may be specified in either name or SID format. If specified in name format, the name must always include the identifying domain name portion unless the name maps to a well-known or built-in account.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-s"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 1" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[String](https://learn.microsoft.com/en-us/dotnet/api/system.string)\[\]</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>True</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -Confirm

Prompts you for confirmation before running the cmdlet.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-s-1"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 2" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[SwitchParameter](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.switchparameter)</td></tr><tr><td>Aliases:</td><td>cf</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -Credential

Specifies the credentials to use when updating AD. If not specified, the current user's credentials are used.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-p"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 3" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[PSCredential](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential)</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -Domain

Specifies the name of the domain to connect to.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-s-2"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 4" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[String](https://learn.microsoft.com/en-us/dotnet/api/system.string)</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -DomainController

Specifies the name of the domain controller to connect to.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-s-3"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 5" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[String](https://learn.microsoft.com/en-us/dotnet/api/system.string)</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -Identity

Specifies the name of the OU to update.

This parameter accepts several different name formats that influence the criteria used in the resultant AD search. The supported name formats are as follows:

<div class="parameterInfo" id="bkmrk-distinguishedname-%28b">- distinguishedName (begins with a `CN=`)
- name (for all other inputs)

</div>Setting permissions on the domain root is only supported using the distinguishedName input format, for example 'DC=laps,DC=com'.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-s-4"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 6" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[String](https://learn.microsoft.com/en-us/dotnet/api/system.string)\[\]</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>True</td></tr><tr><td>Accept pipeline input:</td><td>True</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>### -WhatIf

Shows what would happen if the cmdlet runs. The cmdlet isn't run.

<div class="parameterInfo" id="bkmrk-expand-table-type%3A-s-5"><div class="buttons buttons-right margin-bottom-none margin-top-sm"><button class="button button-clear button-sm display-flex gap-xxs">Expand table</button></div><div class="has-inner-focus"><table aria-label="Table 7" class="table stack table-sm margin-top-none"><tbody><tr><td>Type:</td><td>[SwitchParameter](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.switchparameter)</td></tr><tr><td>Aliases:</td><td>wi</td></tr><tr><td>Position:</td><td>Named</td></tr><tr><td>Default value:</td><td>None</td></tr><tr><td>Required:</td><td>False</td></tr><tr><td>Accept pipeline input:</td><td>False</td></tr><tr><td>Accept wildcard characters:</td><td>False</td></tr></tbody></table>

</div></div>## Inputs

**[String](https://learn.microsoft.com/en-us/dotnet/api/system.string)\[\]**

## Outputs

**[Object](https://learn.microsoft.com/en-us/dotnet/api/system.object)**

## Related Links

- [Windows LAPS Overview](https://go.microsoft.com/fwlink/?linkid=2233901)