Harv
Harv

Reputation: 555

Can I change global MSMQ settings programmatically?

Specifically I'm wondering if I can change the "Limit message storage to (KB)" global setting using Powershell? I need to turn off this option. At the moment we aren't doing a programmatic installation of MSMQ so my other option would be to add this to our installation documentation as part of the setup, but I'd like to know if this option is there first before doing that.

Please note that this is the global setting, not the queue setting.

Upvotes: 2

Views: 1528

Answers (2)

John Breakwell
John Breakwell

Reputation: 4687

The solution depends on how MSMQ is installed.

  • AD-integrated MSMQ - The setting is a property of the computer object in Active Directiry
  • Workgroup mode - The setting is the MachineQuota registry value.

How to set up computer quotas and queue quotas in Microsoft Message Queuing

Cheers
John

Upvotes: 2

CB.
CB.

Reputation: 60928

If this is the rigth registry value for "Limit message Storage to (KB)" how I believe, you can do something like this in the registry provider of powershell.

cd hklm:

New-ItemProperty "HKLM:\SOFTWARE\Microsoft\MSMQ\SimpleClient" -Name "MachineQuota" -Value 2048 -PropertyType "DWord"

2048 is the default value for MSMQ machine.

Upvotes: 0

Related Questions