Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Msmq configuration from workgroup mode to domain mode?

Tags:

msmq

There is a public queue named queue1 on machine A. I want to send messages to this queue from machine B. In order to achieve this, I wrote that c# code.

if (MessageQueue.Exists("machineA\queue1"))
{
    label1.Text = "queue found";
}
else
{
    label1.Text = "queue could not be found";
}

But Exists() method return false on machine B. The same code works well on machine C.

I found somethings related with msmq domain mode and workgroup mode. I think that msmq installed in workgoup mode on machine B.

How can I change this configuration from workgroup mode to domain mode?

like image 973
mkus Avatar asked Feb 04 '10 09:02

mkus


People also ask

How do I install MSMQ in domain mode?

At first, make sure we install Message Queuing with the Active Directory Integration subcomponent. Because if we choose the other one “ Message Queuing will not access a directory service”, the MSMQ will be configured in Workgroup mode.

What is MSMQ in Active Directory?

The Microsoft Message Queuing (MSMQ) protocol set optionally supports a Directory Service to enable a set of features pertaining to message security, efficient routing, and the publishing of queues, distribution lists, and queue aliases.


2 Answers

HKEY_LOCAL_MACHINE\Software\Microsoft\MSMQ\Parameters\

Check the data for the REG_DWORD workgroup. Is it 1 or 0?

  • 1 is workgroup mode.
  • 0 is AD mode
like image 185
engin Avatar answered Sep 24 '22 18:09

engin


Basically the difference between domain and work group mode is not defined by the value of the registry flag "workgroup" mentioned by @engin. This flag just reflects current operational mode but doesn't set it.

Whether you run in domain or workgroup mode is defined whether you installed MSMQ on domain controller or on a member server. Details about differences between these two modes can be found here: https://support.microsoft.com/en-us/kb/884974/

MSMQ 1.0 used to support domain mode only. Current MSMQ version is 5.0.

Next you may see quite interesting behavior when you installed MSMQ on your DC, your workgroup flag continuously reverts to 1 after each MSMQ service restart. This means that you have to grant Network Service account the Create MSMQ Configuration Objects permission to the computer object in Active Directory Domain Services before installing the Directory Services Integration feature on a computer that is a domain controller.

You may find details on how to do it here: https://technet.microsoft.com/en-us/library/cc730960.aspx
MSMQ runs under the (less privileged) Network Service account instead of (all powerful) Local System account starting from version 4.0 (Vista/Server 2008)

So to answer @mkus question more directly to "set" domain mode you just install MSMQ on domain controller and make sure that proper permissions in place for Network Service account. Once this is done you well see it operating in domain mode with workgroup flag switched to 0 automatically to reflect this.

Also couple of links to clarify issues around MSMQ objects permissions and when/why you need to set them: http://blogs.msdn.com/b/johnbreakwell/archive/2009/08/03/default-msmq-queue-permissions-have-changed-in-msmq-4-0.aspx. In short starting from MSMQ 4.0 Everyone and Anonymous Logon were removed from default MSMQ objects ACLs as precaution against DoS attacks (though there are exlusions to this change and Workgroup mode is one of those).

And as you may read in Technet article below you need to go a grant certain rigts to MSMQ objects either to Network Service OR to Computer accounts when installing the Routing Service feature on a Windows Server 2008 R2 (or later) computer that is not a domain controller OR when installing the Directory Service Integration feature of Message Queuing on a Windows Server 2008 R2 (or later) computer that is a domain controller. See details here: https://technet.microsoft.com/en-us/library/cc749102(v=ws.10).aspx

like image 25
Mikhail Avatar answered Sep 24 '22 18:09

Mikhail