There are several ways to install (enable) MSMQ automatically.
The major issues are:
- The way to install MSMQ in different OS version are different.
- The supported components of MSMQ are different in different OS.
In below detail procedure for install MSMQ, you will see I enable different MSMQ components for different OS version. Those components are tested for me to use. If you need more components, you need to add them in command line, or un-attend file to enable them.
Windows 7
A simple command can install MSMQ for you.
start /wait ocsetup.exe MSMQ-Container;MSMQ-Server;MSMQ-Http
Cause ocsetup.exe is not a blocking application, we need to use “start /wait” for make sure the operation is finished.
REF: http://technet.microsoft.com/en-us/library/dd744383(WS.10).aspx
Windows Vista
Before using ocsetup.exe, we need to create a un-attend XML file as below.
<?xml version="1.0"?>
<unattend>
<servicing>
<package action="configure">
<assemblyIdentity name="Microsoft-Windows-Foundation-Package" version="6.0.6000.16386" language="neutral" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS"/>
<selection name="MSMQ-Container" state="true"/>
<selection name="MSMQ-Server" state="true"/>
<selection name="MSMQ-Triggers" state="false"/>
<selection name="MSMQ-DCOMProxy" state="false"/>
<selection name="MSMQ-Multicast" state="false"/>
<selection name="MSMQ-ADIntegration" state="false"/>
<selection name="MSMQ-HTTP" state="true"/>
</package>
</servicing>
</unattend>
I named the XML file above as “Unattended_MSMQ.xml”, and then we can use ocsetup.exe to install MSMQ.
start /wait ocsetup.exe MSMQ-Server /unattendFile:Unattended_MSMQ.xml /quiet /norestart /log:OCSetup_MSMQ.log
Windows XP & Windows 2003
Like the procedure in Vista, we need to create a un-attend file first, but it is a ANS file but not XML file.
[Version]
Signature = "$Windows NT$"
[Global]
FreshMode = Custom
MaintenanceMode = RemoveAll
UpgradeMode = UpgradeOnly
[Components]
msmq_Core = ON
msmq_LocalStorage = ON
;msmq_ADIntegrated = ON
msmq_TriggersService = ON
;msmq_HTTPSupport = ON
;msmq_RoutingSupport = OFF
;msmq_MQDSService = OFF
;[Msmq]
;ControllerServer = MyDomainController
;SupportingServer = MyDomainControllerOrRoutingServer
;SupportLocalAccountsOrNT4 = FALSE
;Site = DefaultFirstSiteName
I named this file as “Unattended_MSMQ.ans”. And there is no ocsetup.exe in windows XP and 2003, we use “sysocmgr.exe” instead.
sysocmgr.exe /i:sysoc.ing /u:Unattended_MSMQ.ans
REF: http://technet.microsoft.com/en-us/library/cc778216(WS.10).aspx
沒有留言:
張貼留言