Hi All,
Below is the sample script for that.
$BizTalkGroupMgmtDbServerFullName = get-wmiobject MSBTS_GroupSetting -namespace root\MicrosoftBizTalkServer | select-object -expand MgmtDbServerName
$BizTalkGroupMgmtDbName = get-wmiobject MSBTS_GroupSetting -namespace root\MicrosoftBizTalkServer | select-object -expand MgmtDbName
if($BizTalkGroupMgmtDbServerFullName)
{
$BizTalkGroupMgmtDbServerFullNameArr = $BizTalkGroupMgmtDbServerFullName.Split(",")
$BizTalkGroupMgmtDbServerName = $BizTalkGroupMgmtDbServerFullNameArr[0]
}
[void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")
$Catalog = New-Object -TypeName Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer
$Catalog.ConnectionString = "SERVER=$BizTalkGroupMgmtDbServerName;DATABASE=$BizTalkGroupMgmtDbName;Integrated Security=SSPI"
$party = "PartyName"
Write-Host "Started Removing Party : ‘$Party’"
$partyinfo = $Catalog.parties[$Party]
$Catalog.RemoveParty($partyinfo);
$Catalog.SaveChanges();
You might receive this error in this process.
Exception calling "SaveChanges" with "0" argument(s): "The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can
be used to execute SQL statements."
Please check the MSDTC timeout setting. It should be more than a minute.
Regards,
Chaitanya