I wish this helpful for you Can anyone give me some pointers on how to set permissions on MSMQ queues in script, preferably PowerShell, but I'd use VBscript , A present (2015) day answer to this question. Example:
I think the issue was by ths following , We create the queues in an Installer subclass and execute it as part of the msi install. Ownership of the queue is a shortcut, but the relevant permissions can be set through AccessControlList:
MessageQueue queue = MessageQueue.Create(queueName, true);
AccessControlList permissions = new AccessControlList();
// Add additional permissions for admins & message-sending accounts
Updating MSMQ permissions on a private queue via C#
may help you . Project + Properties, Build tab. Change the "Target platform" setting from x86 to AnyCPU. This lets you program run in 64-mode so the c:\windows\system32 directory search doesn't get redirected to c:\windows\syswow64.
How to get the current permissions for an MSMQ private queue?
Does that help In PowerShell there's a commandlet for this called Set-MsmqQueueACL. I've used it in provisioning message queues in deployment scripts before and it works well. You first create the Message Queue using New-MsmqQueue and then pipe that to the commandlet or select it later and send it using Get-MsmqQueue. Full documentation for these commandlets can be found on Microsoft's site - https://technet.microsoft.com/en-us/library/dn391735(v=wps.630).aspx