Deny-CMApprovalRequest

Deny-CMApprovalRequest

Denies a request to allow the installation of an application.

Syntax

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

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

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

Detailed Description

The Deny-CMApprovalRequest cmdlet denies 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 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 denial 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 an array of user names of persons 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: Deny a request by application ID

This command denies a request for an application that has the specified ID. The command includes a comment.

PS C:\> Deny-CMApprovalRequest -Id "ScopeId_2A11048C-917A-4C11-9E77-7DCC402F30EC/Application_426dfca1-0cc0-4aa3-85f8-3cd1b184d494/1" -Comment "All requests for this application are denied."

Example 2: Deny a request from a specific user

This command denies a request for an application named Test for the specified user.

PS C:\> Deny-CMApprovalRequest -Application "Test" -User "tsqa\davidchew"

Example 3: Deny a request by using a variable

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

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

PS C:\> $Approval = Get-CMApprovalRequest -Id "ScopeId_2A11048C-917A-4C11-9E77-7DCC402F30EC/Application_426dfca1-0cc0-4aa3-85f8-3cd1b184d494/1"
PS C:\> Deny-CMApprovalRequest -InputObject $Approval -Comment "Request denied."

Approve-CMApprovalRequest

Get-CMApprovalRequest