Grants a user permissions on an MSMQ message queue.


Grant-MsmqMessageQueuePermission [-Name] <String> [-Private] [-Username] <String> [-AccessRights] <MessageQueueAccessRights[]> [-WhatIf] [-Confirm] [<CommonParameters>]


If you want users to be able to access your queue, you need to grant them access. This function will do that.

The rights you can assign are specified using values from the MessageQueueAccessRights enumeration.

If your queue is private, make sure you set the Private switch.

Related Commands


Name Type Description Required? Pipeline Input Default Value
Name String

The queue name.

true false
Private SwitchParameter

Is the queue private?

false false False
Username String

The user to grant permissions to.

true false
AccessRights MessageQueueAccessRights[]

The rights to grant the user.

true false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.


Grant-MsmqMessageQueuePermission -Name MovieQueue -Username REGAL\Employees -AccessRights FullControl

Grants Regal Cinema employees full control over the MovieQueue.


Grant-MsmqMessageQueuePermission -Name MovieQueue -Private -Username REGAL\Critics -AccessRights WriteMessage

Grants all of Regal's approved movie critics permission to write to the private critic's MovieQueue. Lucky!