I\'m trying to set ACL on a Msmq Queue using Powershell v5.1 (Win2k16) - but even though I\'m following the documentation - I keep getting an error.
Get-Msmq
The docs are likely missing quotes; it's expecting an enum that supports bitfields, so most likely you'd do it like this (I don't have the msmq cmdlets or types on my 2016 PS 5.1 boxes so I can't test), using bitwise or
:
$allows = [Microsoft.Msmq.PowerShell.Commands.MessageQueueAccessRights]::Peek -bor
[Microsoft.Msmq.PowerShell.Commands.MessageQueueAccessRights]::Send -bor
[Microsoft.Msmq.PowerShell.Commands.MessageQueueAccessRights]::Receive
Set-MsmqQueueAcl -UserName "REDMOND\madmax" -Allow $allows
It should work by putting all the values in quotes (that is, not an array, a string with commas in it), but you said you tried it that way and it didn't work; did that produce a different error?