Change user credentials of a BizTalk Host Instance with PowerShell

Posted: February 24, 2012  |  Categories: Administration Advance Configurations BizTalk PowerShell

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:

host instances credenciais

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:

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published.

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
cerebrata
Azur Developers

Cross platform desktop tool
for managing your Azure Resources

Learn More

Back to Top