Deploying local queues (MSMQ) with PowerShell

Posted: December 18, 2020  |  Categories: BizTalk Deployment Other PowerShell

When migrating your BizTalk Server environment or deploy to a new or different environment, there are many different resources or configurations that you need to take into considerations like:

  • local queue creations
  • cloud queue creations
  • folder creations
  • and so on.

In this blog post, I will address how we can easily “export” a list of existing local private Message Queues (MSMQ) and recreate them, and set proper permissions in a different environment/server.

PowerShell script to extract a list of all private Message Queues (MSMQ) names

With this PowerShell sample, we will be able to extract a list of all private Message Queues (MSMQ) names to a CSV file to be used on a different script to deployed these resources on a different BizTalk Server environment.

Get-MsmqQueue -QueueType Private | 
Select-Object QueueName, Transactional, UseJournalQueue | 
Export-Csv -Path c:\temp\queues.csv -Encoding ascii -NoTypeInformation

THIS POWERSHELL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download this script here: Extract a list of all Private Message Queuing (MSMQ) names to a CSV file with PowerShell

PowerShell script to create private Message Queues (MSMQ)

With this PowerShell sample, we will be able to create local Private Message Queues (MSMQ) and set proper permissions on a different BizTalk Server environment.

New-MsmqQueue -Name $queueName -Label $queueName -QueueType $queueType -Transactional | 
                Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl

THIS POWERSHELL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download this script here: Create local Private Message Queuing (MSMQ) and set proper permissions with PowerShell

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top