In a first approach you might think that it would be enough to change the credentials associated with the BizTalk Server service using the following script:
sc.exe config "Service Name" obj= "DOMAIN\User" password= "password"
However, if we do this, we will obtain configuration inconsistencies between the services and settings in the BizTalk administration console, as you can see in the picture:
And it might cause unforeseen errors.
To change user credentials of BizTalk Host Instances we need to follow a different approach.
Change user credentials of a BizTalk Host Instance
//Getting the list of BizTalk Host Instances objects $hosts = Get-WmiObject MSBTS_HostInstance -namespace 'root/MicrosoftBizTalkServer' # Getting the list of BizTalk Host Instances objects $hosts = Get-WmiObject MSBTS_HostInstance -namespace 'root/MicrosoftBizTalkServer' # Listing existing BizTalk Host Instances names $hosts | ft HostName # Getting/Filter the desired instance $MyHost = $hosts | ?{$_.HostName -eq "BizTalkDemoApplication"} # Change BizTalk Host Instance user credentials $MyHost.Install("DOMAIN\User", "password", "true")
Or simply
$hostApp = gwmi -n 'root/MicrosoftBizTalkServer' -q 'select * from MSBTS_HostInstance where HostName="BiztalkDemoApplication"' $hostApp.Install("DOMAIN\User", "password", "true")
Download
THESE POWERSHELL SCRIPTS ARE PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download Change user credentials of a BizTalk Host Instance with PowerShell from GitHub here: