Edit

Share via


Approve-CMApprovalRequest

Approves a request to allow the installation of an application.

Syntax

SearchByValueMandatory (Default)

Approve-CMApprovalRequest
    -InputObject <IResultObject>
    [-Comment <String>]
    [-InstallActionBehavior <ActionBehavior>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SearchByNameMandatory

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

SearchByIdMandatory

Approve-CMApprovalRequest
    -Id <String[]>
    [-Comment <String>]
    [-InstallActionBehavior <ActionBehavior>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SearchByGuid

Approve-CMApprovalRequest
    -RequestGuid <String>
    [-Comment <String>]
    [-InstallActionBehavior <ActionBehavior>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

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.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Approve a request for a specific application

PS XYZ:\>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 XYZ:\>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 XYZ:\> $Approval = Get-CMApprovalRequest -Id "ScopeId_2A11048C-917A-4C11-9E77-7DCC402F30EC/Application_d047e945-d6af-46f4-910f-ed36c880ae06/1"
PS XYZ:\> 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.

Parameters

-ApplicationName

Specifies an array of names of applications.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Application, Name

Parameter sets

SearchByNameMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Comment

Specifies a comment about the approval of the request.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Comments

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Don't combine with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Don't combine with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specifies an array of IDs of applications.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:CIUniqueId

Parameter sets

SearchByIdMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

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

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByValueMandatory
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-InstallActionBehavior

Specifies when to install the application, either right away or during non-business hours.

Parameter properties

Type:ActionBehavior
Default value:InstallNow
Accepted values:InstallNow, InstallNonBusinessHours
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RequestGuid

Specifies the request ID.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByGuid
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-User

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByNameMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't make any changes.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object