惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 【当耐特】
博客园 - 聂微东
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
F
Full Disclosure
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
Cyberwarzone
Cyberwarzone
S
Schneier on Security
Know Your Adversary
Know Your Adversary
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
云风的 BLOG
云风的 BLOG
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 司徒正美
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
罗磊的独立博客
L
LangChain Blog
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog
P
Palo Alto Networks Blog
The Cloudflare Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
博客园 - Franky
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Securelist
NISL@THU
NISL@THU
L
LINUX DO - 最新话题
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News | PayPal Newsroom
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
V
V2EX

博客园 - Kevin Li

基于WS-AtomicTransaction标准的WCF远程分布式事务(补充) 基于WS-AtomicTransaction标准的WCF远程分布式事务(二) 基于WS-AtomicTransaction标准的WCF远程分布式事务(一) 在Jeffrey Zhao的基础上+反编译System.Web.Extensions.Design得到的完整Ajax代码 .net remoting的事务传播以及wcf分布式事务 在多线程环境下使用HttpWebRequest或者调用Web Service 一篇介绍.NET 2.0 范型挺全面的文章 C# 2.0中的范型和Nullable范型 Windows 2003 下分布式事务协调器(DTC)的配置 使用SQLSourceSafe控制数据库的版本 MySql 主键(自动增加)的数据类型所带来的错误 使用TraceListener 自动保存跟踪信息到文件中 接口属性集成与智能提示的奇怪问题 动态创建程序集中的类 动态创建程序集中的类 使用NUnit测试包含应用程序配置的dll文件 解决“COM+ 无法与 Microsoft 分布式事务协调程序交谈”的问题 [导入]一些很有用的Reflector 插件 Web安全性原则
使用WMI远程部署/更新BizTalk程序集
Kevin Li · 2007-06-12 · via 博客园 - Kevin Li

当BizTalk使用多服务器部署方案时,如果要更新BizTalk Application引用到的程序集,就必须将程序集同时更新到多台服务器的GAC中。如果每次更新以后,都需要手工在多台服务器更新,实在太麻烦。为了偷懒,就想到用WMI在远程服务器上创建进程来更新GAC中的程序集:)

用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"

接下来要做的就是将程序集,从Build机器copy到deploy服务器上,然后调用gacutil卸载程序集、重新安装程序集和重启BizTalk Host Instances了。把所有的命令都写到一个批处理文件就可以:

@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"

不过这种方式,只适合不影响到BizTalk的Bindings的时候,比如新的程序集相对原来的程序集,多了一个ReceivePort,这种方式没办法更新BizTalk的Bindings。

这种方式,也适用于daily build後将程序集部署到测试服务器上,只需要加一段自定义任务就可以。

<Target Name="AfterCompile">
        
<Exec Command="&quot;c:\mywmideploy.bat&quot;"/>
</Target>