Microsoft® Message Queuing (MSMQ) technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. MSMQ provides guaranteed message delivery, efficient routing, security, and priority-based messaging. It can be used to implement solutions for both asynchronous and synchronous messaging scenarios.

Enable MSMQ during an unattended installation

There are several ways you can enable MSMQ during an unattended Windows® installation by adding the required MSMQ package actions to your answer file.

Create a FirstLogonCommand that runs ServerManagerCmd.exe

For Windows Server® 2008 and Windows Server® 2008 R2, you can create a FirstLogonCommand that runs ServerManagerCmd.exe in your answer file that specifies the proper parameters for configuring MSMQ.

Note:

ServerManagerCmd.exe is only included with Windows Server 2008 and is not available with Windows Vista® or Windows® 7.

The following answer file snippet shows the ServerManagerCmd.exe syntax for installing MSMQ services.

<FirstLogonCommands>
   <SynchronousCommand wcm:action="add">
	<Order>1</Order>
	<CommandLine>ServerManagerCmd.exe -install MSMQ-Services -allSubFeatures -resultPath C:\Admin\MSMQServer.xml -restart</CommandLine>
	<Description>Configure MSMQ Services</Description>
   </SynchronousCommand>
</FirstLogonCommands>

Add Packages to an Unattended Setup Answer File

This procedure can be used for Windows Server 2008 R2 and Windows Server 2008 as well as Windows Vista and Windows 7. You can enable MSMQ on a Windows installation by enabling MSMQ packages during Windows Setup.

  1. Use Windows SIM to add the Microsoft-Windows-Foundation-Package to the answer file, and then specify the Action field to Configure.

    For more information about adding and configuring packages, see Add a Package to an Answer File and Understanding Settings and Properties.

  2. Select to Enable or Disable each of the MSMQ features that you want to configure.

    The following MSMQ packages are available.

    Name of feature displayed in SIM Command-Line Name Notes

    Microsoft Server Message Queue (MSMQ) Server

    MSMQ-Container

    • This package is available in all Windows Vista and Windows 7 editions. This package is required to configure MSMQ.

    • This package is not available in Windows Server 2008 or Windows Server 2008 R2 editions. If this feature is present in an answer file, installation may fail.

    Microsoft Server Message Queue (MSMQ) Server Core

    MSMQ-Server

    This package is available in all the Windows Vista and Windows 7 families as well as the Windows Server 2008 and Windows Server 2008 R2 families.

    MSMQ Active Directory Domain Services Integration

    MSMQ-ADIntegration

    This package is only available in editions of Windows Vista and Windows 7 that support joining a domain. This package is available in all editions of Windows Server 2008 and Windows Server 2008 R2 editions.

    MSMQ downlevel client server

    MSMQ-DownlevelClient

    This package is available only in Windows Server 2008 editions. This package does not exist in Windows Server 2008 R2.

    MSMQ routing server

    MSMQ-RoutingServer

    This package is available only in the Windows Server 2008 and Windows Server 2008 R2 editions.

    MSMQ HTTP Support

    MSMQ-HTTP

    This package is available only in some editions of Windows 7 and Windows Vista. This package is available in Windows Server 2008 and Windows Server 2008 R2 editions.

    Because MSMQ HTTP support depends on Internet Information Services (IIS) and Windows Activation Services (WAS), these features must be installed before the MSMQ HTTP feature can be enabled.

    For more information about these features, see the Unattended Windows Setup Reference.

    MSMQ Triggers

    MSMQ-Triggers

     

    Multicasting Support

    MSMQ-Multicast

     

    MSMQ DCOMProxy

    MSMQ-DCOMProxy

     

    Rights Management Services

    RightsManagementServices

     

Enable MSMQ on a running Windows system by using OCSetup

You can enable MSMQ on a running Windows Vista or Windows 7 system by using the OCsetup.exe command line tool. There are two ways to use OCsetup to configure MSMQ:

  • Use the MSMQ command-line names as arguments for OCSetup. The command line names are case sensitive.

    For example, to install only the MSMQ Core functionality, you can execute OCsetup.exe from a command prompt and specify MSMQ-Server as a parameter:

    ocsetup MSMQ-Container;MSMQ-Server
    
    Conversely, to uninstall MSMQ Core functionality, at a command prompt, run OCsetup.exe and specify MSMQ-Server as the argument for the <component> parameter and specify the /uninstall parameter:

    ocsetup MSMQ-Container;MSMQ-Server /uninstall
    
  • Use an answer file with OCSetup. By using the /unattend parameter, you can specify an unattended answer file to use to configure the Windows system. Use Windows SIM to create this answer file. Only package actions listed in the <servicing> section in the answer file are processed. All other settings in the answer file are ignored.

    Before running OCSetup with an answer file, ensure that any features listed in the answer file are available on the edition of Windows on which you are running OCSetup. If a feature is in the answer file and is not available in the Windows image, installation might fail. For example, if you attempt to run OCSetup with an answer file on Windows 7 Home Basic and the answer file lists the MSMQ-HTTP feature, then installation fails because Windows 7 Home Basic does not include MSMQ HTTP support.

    Use Windows SIM to validate an answer file against a Windows image.

For more information about the command line syntax for OCsetup, see OCSetup Command-Line Options.

For Windows Server 2008 R2, the recommended way to configure Server roles is to use the Server Manager User Interface or Command-line tool.

MSMQ Installation Limitations

The following sections describe some of the limitations and workarounds for configuring MSMQ.

Installing Active Directory on a Domain Controller

To configure Windows Server 2008 R2 domain controller for MSMQ, you must add Network Service to the domain controller computer object in Active Directory.

  1. Click Start, point to Administrative Tools, right-click Active Directory Users and Computers, and then click Run as administrator.

  2. Click View, and then click Advanced Features.

  3. Expand your domain's node, click the Domain Controllers node, right-click the Computer object, and then select Properties.

  4. Click the Security tab.

  5. Add Network Service and grant Full access, or, optionally, grant read/create or delete child objects/allowed to authenticate.

  6. Apply changes.

After Network Service is added, install MSMQ, Active Directory integration, and the downlevel service. If MSMQ is installed before the domain controller is promoted, then verify that the Workgroup registry key under HKLM\Software\Microsoft\MSMQ\Parameters\ is set to 1, and then restart MSMQ.

Verify that MSMQ is running in Domain mode after this procedure. In Computer Management, confirm that Message Queuing has a node called Public Queues.

Installing Routing on a Non-Domain Controller

To install routing on a computer that is not running as a domain controller, use the following procedure:

  1. Click Start, click Administrative Tools, and then right-click Active directory Sites and Services.

  2. Expand the Sites node.

  3. Expand the site node where the computer you want to configure is located.

  4. Right-click the server node of the computer you want to configure, and then click Properties.

  5. In the Security tab, add the following permissions for the computer. You may need to search for the computer.

    • Read

    • Write

    • Create all child objects

  6. Enable inheritance for the permissions:

    1. On the Security tab, click Advanced.

    2. For the computer object, click Edit.

    3. On the Object and Properties tabs, change the Apply to fields to This object and all descendant objects.

    4. Click OK twice to accept the settings.

  7. Click OK.

  8. Install the routing service on the computer.

See Also