無人值守安裝BizTalk非常容易。您首先在具有所需選項的「參考」計算機上安裝BizTalk,然後生成在其他計算機上安裝時提供的「模板」文件。這裏是一個腳本,我寫的只是這樣做的部分:
$bizTalkFeatureFile = (Create-Unattended-Install-Config-File $global:RootInstallDir)
$bizTalkLogFile = $global:LogPath + "\BizTalkInstall_" + $(Get-Date).ToString("yyyy-MM-dd_HH_mm") + ".log"
$ExitCode = 0
Log-Info "`t`t$($MyInvocation.InvocationName): Starting unattended BizTalk installation from features file: $bizTalkFeatureFile"
if ($Is32bit) { $ExitCode = (Launch-Process "$global:BizTalkInstallDir\setup" "/CABPATH $bizTalkRunTimeDir\BTSRedistW2K8EN32.cab /S $bizTalkFeatureFile /L $bizTalkLogFile") }
if ($Is64bit) { $ExitCode = (Launch-Process "$global:BizTalkInstallDir\setup" "/CABPATH $bizTalkRunTimeDir\BTSRedistW2K8EN64.cab /S $bizTalkFeatureFile /L $bizTalkLogFile") }
if ($ExitCode -ne 0)
{ throw "BizTalk installation failed. See $BizTalkLogFile content" }
Log-Info "`t`t$($MyInvocation.InvocationName): BizTalk features installed"
Configure-BizTalk $bizTalkFeatureFile $bizTalkLogFile
的創建,無人值守安裝,配置文件中使用來自參考機導出的配置時,和「定製」,它的生成的XML文件要在其上安裝BizTalk(等與實際值替換數據庫,例如,密碼)系統:
function Create-Unattended-Install-Config-File
{
param (
[parameter(Mandatory = $true)][string] $baseDir
)
Log-Info "`t`t$($MyInvocation.InvocationName): Creating unattended installation configuration file"
try
{
$Error.Clear()
if ($Is64bit)
{ $bizTalkFeatureFileTemplate = $baseDir + "\ConfigFiles\Templates\BizTalk64HealthLink_Template.xml" }
else { $bizTalkFeatureFileTemplate = $baseDir + "\ConfigFiles\Templates\BizTalkHealthLink_Template.xml" }
$bizTalkFeatureFile = $baseDir + "\ConfigFiles\BizTalk_HealthLink.xml"
if (Test-Path $bizTalkFeatureFile)
{ Remove-Item $bizTalkFeatureFile }
Copy-Item $bizTalkFeatureFileTemplate $bizTalkFeatureFile
$Domain = (Get-Domain-Name)
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $DatabaseServer
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $INSTANCENAME
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $HealthLinkUser
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $Password
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $Domain
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $SSOAdministrators
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $SSOAffiliateAdministrators
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $BizTalkServerAdministrators
Replace-Word $bizTalkFeatureFile "@@BizTalkServerOpera[email protected]@" $BizTalkServerOperators
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $BizTalkApplicationUsers
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $BizTalkIsolatedHostUsers
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $SSO_ID_BACKUP_SECRET_FILE
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $SSO_ID_BACKUP_SECRET_PASSWORD
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $SSO_ID_BACKUP_SECRET_PASSWORD_CONFIRM
Replace-Word $bizTalkFeatureFile "@@[email protected]@" $SSO_ID_BACKUP_SECRET_REMINDER
}
catch
{
Log-Error "`t`t$($MyInvocation.InvocationName): $_"
}
Log-Info "`t`t$($MyInvocation.InvocationName): Configuration file created ($sqlConfigFile)"
return $bizTalkFeatureFile
}
最後,配置-的BizTalk功能使用相同的配置文件,以實際創建BizTalk數據庫,配置ENTSSO等等:
function Configure-BizTalk
{
param (
[parameter(Mandatory = $true)][string] $bizTalkFeatureFile,
[parameter(Mandatory = $true)][string] $bizTalkLogFile
)
Log-Info "`t`t$($MyInvocation.InvocationName): Configuring BizTalk from features file: $bizTalkFeatureFile"
try
{
$Error.Clear()
$ExitCode = 0
$ExitCode = (Launch-Process "$global:ProgramFiles32\Microsoft BizTalk Server 2009\Configuration.exe" "/s `"$bizTalkFeatureFile`" /l `"$bizTalkLogFile`"")
if ($ExitCode -ne 0)
{ throw "BizTalk configuration failed. See $bizTalkLogFile content" }
}
catch
{
Log-Error "`t`t$($MyInvocation.InvocationName): $_"
}
Log-Info "`t`t$($MyInvocation.InvocationName): BizTalk configured"
}
當然你也可以不使用上面的代碼「原樣」但我希望它可以給你如何進行一個大致的瞭解。