Freigeben über


Centralized way to manage MSMQ related properties – When MSMQ is in Active Directory mode

 

This is a continuation on an older post which talks about centralizing way to manage MSMQ related properties when MSMQ is in workgroup mode. So the scenario is same, you are a domain administrator and you have hundreds of computers to manage. All these computers are running MSMQ in AD mode. Now you got to change the MSMQ properties on all of these machines from the DC. How can you do it? Sure you can, by changing the properties of the MSMQ AD object for each of these computers but that would be very time consuming.

So a better way to do it is using PowerShell script. This PowerShell script iterates through all the MSMQ AD object you have on DC and change the value as you set with in the script. As in the old post, this script also changes the MachineQuota of the MSMQ AD object, but similar path can be followed for other properties as well. The script is attached to the blog.

The scrip define a variable which holds the value you want to set for the MachineQuota:
$msMQvalue=2097152 # Desired value for msMQQuota in KB

To run this script you can follow these steps:
1- Copy over the script to the DC.
2- Rename the file to give extension as .ps1 if not already
3- Launch PowerShell command prompt
4- Run Get-ExecutionPolicy and check if the output is set to “Restricted”. If it does, follow next step. Read more about this here
5- Run Set-ExecutionPolicy RemoteSigned
6- Run Get-ExecutionPolicy again to make sure it is set to “RemoteSigned”.
7- Navigate to the folder where you have the script copied.
8- Run .\ChangeMSMQQuota.ps1
9- Now you can open the “Active Directory Users and Computers” and check the properties of MSMQ AD object to confirm if the mSMQQuota has changed to “2097152”. This value is hard coded in the script and can be changed as per the need.
10- You can also go the member servers and re-confirm the change. 

Hope this helps and is reusable for other MSMQ properties as well.
Big thanks to Christopher Norris for helping out with this one.

 

Written by
Chirag Pavecha

Microsoft India GTSC

 

ChangeMSMQQuota.txt