Use WMI to remotely deploy/update BizTalk assembly

Source: Internet
Author: User

When BizTalk uses a multi-server deployment scheme, if you want to updateProgramYou must update the Assembly to the GAC of multiple servers at the same time. It is too troublesome to manually update multiple servers after each update. To be lazy, you can use WMI to create a process on the remote server to update the assembly in the GAC :)

Run the following command to create a process on a remote server Using WMI:
WMIC/node: server01/User: mydomain \ myusername/password: Pass @ word1 process call create "C: \ gacutil/u mybizassembly"
WMIC/node: server01/User: mydomain \ myusername/password: Pass @ word1 process call create "C: \ gacutil/I c: \ deploy \ mybizassembly. dll"

The next step is to copy the Assembly from the build machine to the deploy server, then call gacutil to uninstall the Assembly, reinstall the assembly, and restart BizTalk host instances. You can write all the commands to a batch file:

@ Echo Copy files
Copy c: \ build \ mybizassembly. dll \ server01 \ deploy \ mybizassembly. dll
Copy c: \ build \ mybizassembly. dll \ server02 \ deploy \ mybizassembly. dll
Copy c: \ build \ mybizassembly. dll \ server03 \ deploy \ mybizassembly. dll

@ Echo Install assemblies To GAC
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / U mybizassembly"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / I c: \ deploy \ mybizassembly. dll"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / U mybizassembly"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / I c: \ deploy \ mybizassembly. dll"
WMIC / Node: server03 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / U mybizassembly"
WMIC / Node: server03 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "C: \ gacutil / I c: \ deploy \ mybizassembly. dll"

@ Echo Restart host instances
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net stop btssvc $ biztalkreceivehost"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net start btssvc $ biztalkreceivehost"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net stop btssvc $ biztalkprocesshost"
WMIC / Node: server02 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net start btssvc $ biztalkprocesshost"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net stop btssvc $ biztalksendhost"
WMIC / Node: server01 / User : Mydomain \ myusername / Password: Pass @ Word1 Process call Create "Net start btssvc $ biztalksendhost"

However, this method is only applicable when the bindings of BizTalk is not affected. For example, if the new assembly is replaced by the original assembly with an exteneport, this method cannot update the bindings of BizTalk.

This method also applies to deploying the assembly to the test server after daily build. You only need to add a custom task.

< Target Name = "Aftercompile" >
< Exec Command = "& Quot; C: \ mywmideploy. BAT & quot ;" />
</ Target >

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.