# Active Directory Least Privilege

### Overview

When creating a PAM Directory Resource, it is recommended that you use a service account with the least required privileges to perform rotation.&#x20;

The following steps show you how to enable a service account to rotate credentials using Active Directory's Delegation of Control feature.&#x20;

{% hint style="info" %}
Before starting, create a service account for password rotation whose credentials you will store in the Keeper resource record.
{% endhint %}

### Procedure

1. Launch Active Directory Users and Computers
2. In the directory tree, select a node for which password rotation should be allowed.
3. Right-click on the node, then click Delegate Control.
4. In the Delegation of Control Wizard, click 'Add'.
5. Locate your chosen service account, then click 'OK'.

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FWvqmDHT3H2WPFXS81LST%2Fimage.png?alt=media&#x26;token=8594dced-2b6c-414e-bfe2-c64c9314d1bc" alt=""><figcaption><p>Selecting a service account to perform rotation</p></figcaption></figure>

6. Click 'Next' to advance to permission selection.
7. In 'Delegate the following common tasks', check the option for 'Reset user passwords and force password change at next logon', then click 'Next'.

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FbAX2oTrapAHXZA9hZ8mC%2Fimage.png?alt=media&#x26;token=1c8d3866-5b33-4554-9b69-c95169913a9c" alt=""><figcaption><p>Delegating permission to reset user passwords</p></figcaption></figure>

8. Add the service account's login and password to the Resource Record for the AD instance.
