> For the complete documentation index, see [llms.txt](https://docs.lithnet.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lithnet.io/resource-management-powershell/usage/cmdlet-reference/set-pendingapprovalrequest.md).

# Set-PendingApprovalRequest

### Description

The `Set-PendingApprovalRequest` cmdlet allows you approve or reject an approval request. The cmdlet can be combined with the [Get-ApprovalRequest](/resource-management-powershell/usage/cmdlet-reference/get-approvalrequest.md) to approve or reject pending approval requests for the current user.

{% hint style="info" %}
Approval operations are not supported when the client is connected using the `DirectNetTcp` connection mode. See [Connecting to the MIM service](/resource-management-powershell/installation/connecting-to-the-service.md).
{% endhint %}

### Syntax

```
Set-PendingApprovalRequest -ApprovalObject <RmaObject> [-Decision <ApprovalDecision>] [-Reason <string>]
```

### Parameters

**ApprovalObject**

Required. An `Approval` object obtained using the [Get-ApprovalRequest](/resource-management-powershell/usage/cmdlet-reference/get-approvalrequest.md) cmdlet that is in the `Pending` state

**Decision**

Optional. The approval decision. This can be either `Approve` or `Reject`. The default is `Approve`

**Reason**

Optional. The reason for the approval or rejection

### Examples

**Individually get and approve each request**

```powershell
$requests = Get-ApprovalRequest
foreach ($request in $requests)
{
   if ($request.Status -eq "Pending")
   {
       Set-PendingApprovalRequest -ApprovalObject $request -Decision Approve
   }
}
```

**Approve all pending requests using the pipeline**

```powershell
Get-ApprovalRequest -Status Pending | Set-PendingApprovalRequest -Decision Approve -Reason "Make it so!"
```

**Reject all pending requests using the pipeline**

```powershell
Get-ApprovalRequest -Status Pending | Set-PendingApprovalRequest -Decision Reject -Reason "Not today"
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lithnet.io/resource-management-powershell/usage/cmdlet-reference/set-pendingapprovalrequest.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
