Editar

Compartir a través de


Set-MsmqQueueACL

Modifies the access rights of queues.

Syntax

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

  • 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
Type:MessageQueueAccessRights
Accepted values:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:MessageQueue[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
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:

  • 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
Type:MessageQueueAccessRights
Accepted values:DeleteMessage, PeekMessage, ReceiveMessage, WriteMessage, DeleteJournalMessage, ReceiveJournalMessage, SetQueueProperties, GetQueueProperties, DeleteQueue, GetQueuePermissions, GenericWrite, GenericRead, ChangeQueuePermissions, TakeQueueOwnership, FullControl
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UserName

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

Type:String[]
Position:Named
Default value:None
Required:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Msmq.PowerShell.Commands.MessageQueue[]

Outputs

Object