Share via


Powershell Script to create an MSMQ

Here is a script to quickly create and delete queues. This was based out of this post.

 Usage :
    CreateQueue.ps1 <-c,d> <queuename> <Y/N - Private> <user> <all:restricted Permission> [T:Transactional]

CreateQueueu.ps1.txt

Comments

  • Anonymous
    October 26, 2010
    Nice Sajay. It'll be good to check the existance of Queue before we create Queue:    $qb = [System.Messaging.MessageQueue]::Exists($queuename)    if($qb ! $null)    {        exit    }    $qb = [System.Messaging.MessageQueue]::Create($queuename, $transactional) .. .. .. I don't know if syntax is correct or not, but you can correct it and add to the script.

  • Anonymous
    October 26, 2010
    Here is the correct 1: $qb = [System.Messaging.MessageQueue]::Exists($queuename)    if($qb -ne $null)    {        Write-Host "Alread have " $queuename "queue." exit    }    $qb = [System.Messaging.MessageQueue]::Create($queuename, $transactional) .. .. ..

  • Anonymous
    March 15, 2011
    Hi Sajay,  I have written a simple script using PSCX 2.0 to create Private MSMQ in windows but I am not able to add a label to the same. Find the script below : New-MSMQueue -QueueName scheduler.q -Private Any help????

  • Anonymous
    May 18, 2011
    The comment has been removed

  • Anonymous
    March 22, 2012
    Can you modify it so it will import queue names from a txt file?

  • Anonymous
    August 17, 2012
    This post is for others that need an example like myself :) -c = create myQ = the queue name n = not private everyone = the user or group name all = gives that user all permissions T = will make it transactional .createqueue.ps1 -c csrtofe n everyone all T

  • Anonymous
    November 09, 2012
    Is there a way to set permissions for more than one group, and get more granular than just "all"