Set-MsmqQueueACL

Modifies the access rights of queues.

Syntax

Set-MsmqQueueACL
   [-InputObject] <MessageQueue[]>
   [-Allow <MessageQueueAccessRights>]
   [-Confirm]
   [-Deny <MessageQueueAccessRights>]
   [-Remove <MessageQueueAccessRights>]
   -UserName <String[]>
   [-WhatIf]
   [<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:\> Get-MsmqQueue -Name "Order*" -QueueType Private | Set-MsmqQueueAcl -UserName "CONTOSO\DavidChew" -Allow Delete,Peek,Receive,Send -Deny TakeOwnership

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

Required Parameters

-InputObject

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

Type:MessageQueue[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-UserName

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

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

Optional Parameters

-Allow

Specifies an array of permissions that this cmdlet grants to a user account or group. The acceptable values for this parameter are:

  • Delete. Delete the specified queue.
  • FullControl. Full control of the specified queue.
  • GetPermissions. Get the permissions of the specified queue.
  • GetProperties. Get the properties of the specified queue.
  • JournalReceive. Receive a message from the specified queue journal queue.
  • Peek. Peek a message from the specified queue.
  • Receive. Receive a message from the specified queue.
  • Send. Send a message to the specified queue.
  • SetPermissions. Set the permissions of the specified queue.
  • SetProperties. Set the properties of the specified queue.
  • SpecialPermissions. Special permissions for the specified queue.
  • TakeOwnership. Assign the specified queue to oneself.
Type:MessageQueueAccessRights
Parameter Sets:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
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
-Deny

Specifies an array of permissions that the cmdlet revokes from a user account or group. The acceptable values for this parameter are:

  • Delete. Delete the specified queue.
  • FullControl. Full control of the specified queue.
  • GetPermissions. Get the permissions of the specified queue.
  • GetProperties. Get the properties of the specified queue.
  • JournalReceive. Receive a message from the specified queue journal queue.
  • Peek. Peek a message from the specified queue.
  • Receive. Receive a message from the specified queue.
  • Send. Send a message to the specified queue.
  • SetPermissions. Set the permissions of the specified queue.
  • SetProperties. Set the properties of the specified queue.
  • SpecialPermissions. Special permissions for the specified queue.
  • TakeOwnership. Assign the specified queue to oneself.
Type:MessageQueueAccessRights
Parameter Sets:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Remove

Specifies an array of permissions that this cmdlet removes from a user account or group. The acceptable values for this parameter are:

  • Delete. Delete the specified queue.
  • FullControl. Full control of the specified queue.
  • GetPermissions. Get the permissions of the specified queue.
  • GetProperties. Get the properties of the specified queue.
  • JournalReceive. Receive a message from the specified queue journal queue.
  • Peek. Peek a message from the specified queue.
  • Receive. Receive a message from the specified queue.
  • Send. Send a message to the specified queue.
  • SetPermissions. Set the permissions of the specified queue.
  • SetProperties. Set the properties of the specified queue.
  • SpecialPermissions. Special permissions for the specified queue.
  • TakeOwnership. Assign the specified queue to oneself.
Type:MessageQueueAccessRights
Parameter Sets:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
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