The first part is easy enough but the second is tricky.

For example, here's how to create a public queue with 'Old School' VBScript:

set iq=CreateObject("MSMQ.MSMQQueueInfo")


iq.Label=”The queue”

iq.Create (IsTransactional=0)


There's no way to add permissions to this queue at the same time as the COM/scripting API doesn't have that functionality.

System.Messaging (.Net) and the native C/C++ API expose functions for queue security, such as MQSetQueueSecurity(), but they can't be using in VBScript.

The way forward may be PowerShell as that uses the .Net Framework.

I'll add writing such a script to my ever-growing 'cool things to do' list...