An image created using sysprep will choose a new computer name in order to join the domain the first time it boots. To get BizTalk Server running properly, we need to update various instances of the machine name that are stored in registry and databases as well. This document assumes that BizTalk Server is configured to run on a single machine and shows how to update those locations with the new machine name.
Where to Find This Sample
This sample is located in the following SDK location:
<SamplesPath>\ Admin\ Sysprep
Creating a Sysprep BizTalk VHD
Launch a VM and install/configure BizTalk Server.
Copy the contents of the included “scripts” folder to C:\scripts on the VM.
Prepare a sysprep answer file that will run the scripts on first boot. See the included SysprepAnswerFiles folder for Windows 2008 x86 and x64 examples. Lines that need to be updated have a “!” before them. You can use these as a template, or make your own and copy the <FirstLogonCommands> section over.
Replace all instances of “$(OLDCOMPUTERENAME)” with the VM’s current machine name in all scripts and answer files. User accounts, passwords, and company details should also be updated in UpdateSqlServerAndInstance.cmd and your sysprep xml.
Run sysprep. The command will look something like:
C:\windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown /unattend:c:\scripts\unattend_Win2K8x64.xml
After the VM shuts down, merge any snapshots and copy your VHD file to a safe location.
Descriptions of the included steps
These steps are all automated in the sysprep answer files described above. This section is for reference only. If you do need to run these scripts manually, run them in the order shown.
ReplaceMachineName.vbs
- Purpose: Opens a file and replaces all instances of a given string with the current computer name. Useful to prepare the other script and xml files, and to update bm.exe.config.
- Usage: ReplaceMachineName.vbs <file to open> <string to replace>
- Changes: created Dec 2008
UpdateRegistry.vbs
- Purpose: Updates the machine name stored in Biztalk’s registry settings
- Usage: UpdateRegistry.vbs <UpdateInfo.xml>. Make sure to replace all instances of $(OLDCOMPUTERNAME) and $(NEWCOMPUTERNAME) in this xml.
- Changes: Removed HWS and EDI sections
UpdateDatabase.vbs
- Purpose: Updates the machine name stored in Biztalk’s management databases
- Usage: UpdateDatabase.vbs <UpdateInfo.xml>
- Changes: removed HWS, added BAM and SSO settings, updated the Group's server entry
UpdateBAMDb.vbs
- Purpose: Updates the machine name stored in BAM’s databases
- Usage: UpdateBamDb.vbs <UpdateInfo.xml>
- Changes: created Dec 2008
UpdateSSO.cmd
- Purpose: Reconfigures the SSO Secret server
- Usage: sso.cmd <UpdateInfo.xml>
- Changes: created Dec 2008
UpdateSqlServerAndInstanceName.cmd
- Purpose: Reconfigures SQL and SQL express, restarts a series of dependent services, and reregisters BamAlerts
- Usage: Edit the script and replace all instances of $(NEWCOMPUTERNAME), and update the serviceusername and servicepassword for BAM Alerts. Then run UpdateSqlServerAndInstanceName.cmd passing the old machine name as the first argument.
- Changes: added more services to be restarted, force kill some stubborn services, and added BamAlerts service fix
Known Issue
These scripts do not modify your SharePoint Server. If you are using the WSS adapter, you will probably need to reconfigure SharePoint and then update the SharePointAdapterManagementGroup key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BizTalk Server\3.0\TPM.