Deny-CMApprovalRequest

Denies a request to allow the installation of an application.

Syntax

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

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.

Examples

Example 1: Deny a request by application ID

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

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

Example 2: Deny a request from a specific user

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

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

Example 3: Deny a request by using a variable

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

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.

Required Parameters

-ApplicationName

Specifies an array of names of applications.

Type:String[]
Aliases:Application, Name
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
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
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-RequestGuid
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-User

Specifies an array of user names of persons who submitted the approval request. Use the format domain\user.

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

Optional Parameters

-Comment

Specifies a comment about the denial of the request.

Type:String
Aliases:Comments
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False