views:

22

answers:

1

We are using Nant to deploy an application and need to create some MSMQ Queues during the process.

We use Nant/psexec/cscript to call a VBScript to create the queue itself but we also need to set the permissions.

Can this be done programmatically?

I am aware of Setting permissions on a MSMQ queue in script however that question asks for PowerShell or VBScript and has an accepted answer for PowerShell. We do not have PowerShell available to us so this question is specific to VBScript.

A: 

According to this post, MSMQ scripting API doesn't provide any means to set permissions on queries, so this task cannot be accomplished using VBScript.

I can suggest the following workarounds:

  • Use PowerShell, as illustrated in the post you linked to. (PowerShell can use the .NET Framework and, therefore, the MSMQ .NET API provided by the System.Messaging assembly.)
  • Create a custom utility that would set the necessary permissions and call this utility as part of your deployment process. For setting the queue security, you can use the following API functions:
Helen

related questions