Edit

Share via


Set-MsmqQueueACL

Modifies the access rights of queues.

Syntax

Default (Default)

Set-MsmqQueueACL
    [-InputObject] <MessageQueue[]>
    -UserName <String[]>
    [-Allow <MessageQueueAccessRights>]
    [-Deny <MessageQueueAccessRights>]
    [-Remove <MessageQueueAccessRights>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-MsmqQueueACL cmdlet modifies the access rights of queues. This cmdlet returns the updated MsmqQueueAcl object. The cmdlet modifies private, public, journal, system journal, system dead-letter, and system transactional dead-letter queues.

Examples

Example 1: Modify the ACLs of queues specified by name

PS C:\> $queue = Get-MsmqQueue -Name "Order*" -QueueType Private
PS C:\> $rights = "DeleteQueue", "PeekMessage", "ReceiveMessage", "WriteMessage"
PS C:\> $rights | Foreach-Object { Set-MsmqQueueAcl -InputObject $queue -UserName "CONTOSO\DavidChew" -Allow $PSItem}
PS C:\> Set-MsmqQueueAcl -InputObject $queue -UserName "CONTOSO\DavidChew" -Deny TakeQueueOwnership

This command gets all the private queues that have names that start with the string Order by using the Get-MsmqQueue cmdlet. The current cmdlet modifies the ACL of the queues.

Parameters

-Allow

Specifies an array of permissions that this cmdlet grants to a user account or group.

The acceptable values for this parameter are:

  • DeleteQueue - Delete the specified queue
  • FullControl - Full control of the specified queue
  • GetQueuePermissions - Get the permissions of the specified queue
  • GetQueueProperties - Get the properties of the specified queue
  • ReceiveJournalMessage - Receive messages from the journal queue. This includes the rights to delete and peek messages from the journal queue
  • DeleteJournalMessage - Delete messages from the journal queue
  • PeekMessage - Peek a message from the specified queue
  • ReceiveMessage - Receive messages from the queue. This includes the rights to delete and peek messages
  • WriteMessage - Send a message to the specified queue
  • DeleteMessage - Delete a message from the specified queue
  • ChangeQueuePermissions - Set the permissions of the specified queue
  • SetQueueProperties - Set the properties of the specified queue
  • TakeQueueOwnership - Assign the specified queue to oneself
  • GenericRead - A combination of GetQueueProperties, GetQueuePermissions, ReceiveMessage, and ReceiveJournalMessage
  • GenericWrite - A combination of GetQueueProperties, GetQueuePermissions, and WriteMessage

Parameter properties

Type:MessageQueueAccessRights
Default value:None
Accepted values:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
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

-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

-Deny

Specifies an array of permissions that the cmdlet revokes from a user account or group.

The acceptable values for this parameter are:

  • DeleteQueue - Delete the specified queue
  • FullControl - Full control of the specified queue
  • GetQueuePermissions - Get the permissions of the specified queue
  • GetQueueProperties - Get the properties of the specified queue
  • ReceiveJournalMessage - Receive messages from the journal queue. This includes the rights to delete and peek messages from the journal queue
  • DeleteJournalMessage - Delete messages from the journal queue
  • PeekMessage - Peek a message from the specified queue
  • ReceiveMessage - Receive messages from the queue. This includes the rights to delete and peek messages
  • WriteMessage - Send a message to the specified queue
  • DeleteMessage - Delete a message from the specified queue
  • ChangeQueuePermissions - Set the permissions of the specified queue
  • SetQueueProperties - Set the properties of the specified queue
  • TakeQueueOwnership - Assign the specified queue to oneself
  • GenericRead - A combination of GetQueueProperties, GetQueuePermissions, ReceiveMessage, and ReceiveJournalMessage
  • GenericWrite - A combination of GetQueueProperties, GetQueuePermissions, and WriteMessage

Parameter properties

Type:MessageQueueAccessRights
Default value:None
Accepted values:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
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

-InputObject

Specifies an array of MsmqQueue objects. This cmdlet updates permissions for the queues that the MsmqQueue objects specify. This parameter accepts pipeline input.

Parameter properties

Type:

MessageQueue[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Remove

Specifies an array of permissions that this cmdlet removes from a user account or group.

The acceptable values for this parameter are:

  • DeleteQueue - Delete the specified queue
  • FullControl - Full control of the specified queue
  • GetQueuePermissions - Get the permissions of the specified queue
  • GetQueueProperties - Get the properties of the specified queue
  • ReceiveJournalMessage - Receive messages from the journal queue. This includes the rights to delete and peek messages from the journal queue
  • DeleteJournalMessage - Delete messages from the journal queue
  • PeekMessage - Peek a message from the specified queue
  • ReceiveMessage - Receive messages from the queue. This includes the rights to delete and peek messages
  • WriteMessage - Send a message to the specified queue
  • DeleteMessage - Delete a message from the specified queue
  • ChangeQueuePermissions - Set the permissions of the specified queue
  • SetQueueProperties - Set the properties of the specified queue
  • TakeQueueOwnership - Assign the specified queue to oneself
  • GenericRead - A combination of GetQueueProperties, GetQueuePermissions, ReceiveMessage, and ReceiveJournalMessage
  • GenericWrite - A combination of GetQueueProperties, GetQueuePermissions, and WriteMessage

Parameter properties

Type:MessageQueueAccessRights
Default value:None
Accepted values:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
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

-UserName

Specifies the user account or group whose permissions the cmdlet changes.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
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 is not run.

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.Msmq.PowerShell.Commands.MessageQueue

Outputs

Object