Approve-CMApprovalRequest

Approve-CMApprovalRequest

Approves a request to allow the installation of an application.

Syntax

Parameter Set: SearchByIdMandatory
Approve-CMApprovalRequest -Id <String[]> [-Comment <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Approve-CMApprovalRequest -ApplicationName <String[]> -User <String> [-Comment <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Approve-CMApprovalRequest -InputObject <IResultObject> [-Comment <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Approve-CMApprovalRequest cmdlet approves a request from a user to install an application. You can specify an approval request by application name, application ID, or by user. You can also use the Get-CMApprovalRequest cmdlet to view approval requests.

Parameters

-ApplicationName<String[]>

Specifies an array of names of applications.

Aliases

Application

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Comment<String>

Specifies a comment about the approval of the request.

Aliases

Comments

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of IDs of applications.

Aliases

CIUniqueid

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies an approval request object. To obtain an approval request object, use the Get-CMApprovalRequest cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-User<String>

Specifies the name of a user who submitted the approval request. Use the format domain\user.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Approve a request for a specific application

This command approves a request from a user to install an application specified by its ID.

PS C:\> Approve-CMApprovalRequest -Id "ScopeId_2A11048C-917A-4C11-9E77-7DCC402F30EC/Application_426dfca1-0cc0-4aa3-85f8-3cd1b184d494/1"

Example 2: Approve a request for a specific user

This command approves a request for an application named Test for the specified user. The command includes a comment.

PS C:\> Approve-CMApprovalRequest -Application "Test" -User "tsqa\davidchew" -Comment "Request approved."

Example 3: Approve a request by using a variable

The first command gets an approval request for a specified application ID and stores it in the variable $Approval.

The second command accepts the request stored in $Approval. The command includes a comment.

PS C:\> $Approval = Get-CMApprovalRequest -Id "ScopeId_2A11048C-917A-4C11-9E77-7DCC402F30EC/Application_d047e945-d6af-46f4-910f-ed36c880ae06/1"
PS C:\> Approve-CMApprovalRequest -InputObject $Approval -Comment "Request approved."

Deny-CMApprovalRequest

Get-CMApprovalRequest