> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/privileged-access-manager/references/active-directory-least-privilege.md).

# Active Directory Least Privilege

Granting a service account the minimum permissions to rotate

### Overview

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

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

{% 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&amp;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&amp;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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeper.io/keeperpam/privileged-access-manager/references/active-directory-least-privilege.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
