我正在尝试使用Powershell v5.1(Win2k16)在Msmq队列上设置ACL,但是即使我在遵循文档,也仍然会遇到错误。
Get-MsmqQueue -Name "s009_ClientsServiceBus" -QueueType Private | Set-MsmqQueueAcl -UserName "domain.com\WfxServiceBus" -Allow Peek,Write
Run Code Online (Sandbox Code Playgroud)
错误:
Set-MsmqQueueACL : Cannot convert 'System.Object[]' to the type
'System.Nullable`1[Microsoft.Msmq.PowerShell.Commands.MessageQueueAccessRights]' required by parameter 'Allow'. Specified method is
not supported.
At line:1 char:128
+ ... t-MsmqQueueAcl -UserName "domain.com\WfxServiceBus" -Allow Peek,Write
+ ~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-MsmqQueueACL], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Msmq.PowerShell.Commands.SetMSMQQueueACLCommand
Run Code Online (Sandbox Code Playgroud)
该文件显示下面的例子:
Get-MsmqQueue –Name Order* –QueueType Private | Set-MsmqQueueAcl –UserName “REDMOND\madmax” –Allow Delete,Peek,Receive,Send –Deny TakeOwnership
Run Code Online (Sandbox Code Playgroud)
运行该命令(授予的某些参数对于我的环境不正确,但存在相同的错误)...
PS C:\Users\user> Get-MsmqQueue -Name Order* -QueueType Private | …Run Code Online (Sandbox Code Playgroud)