Approve-CMApprovalRequest

Approves a request to allow the installation of an application.

Syntax

Approve-CMApprovalRequest
       -ApplicationName <String[]>
       [-Comment <String>]
       [-Confirm]
       [-DisableWildcardHandling]
       [-ForceWildcardHandling]
       -User <String>
       [-WhatIf]
       [<CommonParameters>]
Approve-CMApprovalRequest [-Comment ] [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -Id  [-WhatIf] []
Approve-CMApprovalRequest [-Comment ] [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -InputObject  [-WhatIf] []

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.

Examples

Example 1: Approve a request for a specific application

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

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

Example 2: Approve a request for a specific user

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

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

Example 3: Approve a request by using a variable

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."

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.

Required Parameters

-ApplicationName

Specifies an array of names of applications.

Type:String[]
Aliases:Application, Name
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies an array of IDs of applications.

Type:String[]
Aliases:CIUniqueId
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

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

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-User

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

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Comment

Specifies a comment about the approval of the request.

Type:String
Aliases:Comments
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False