【发布时间】:2014-12-19 17:38:31
【问题描述】:
我正在尝试使用 BizTalk 2010 的 Powershell 扩展来添加主机实例(主机已存在)。
Add-PSSnapIn -Name BiztalkFactory.PowerShell.Extensions #NOTE: Must be in 32-bit version of Powershellto use this SnapIn
#get-PsSnapIn -registered ### list registered Snap-In's
$HostName = "TestNewHost"
$HostType = 1 # 1 = InProcess
$myNTHostGroupName = "BIZTALKDEV\Domain Users"
$AuthTrusted = $false
$domainName = "BizTalkDev"
$serverName = "BizTalkDev"
$defaultAdminUser = "Administrator"
$hostCredentials = $Host.ui.PromptForCredential("Logon Credentials","This account must have SQL Server permissions.", $domainName + "\" + $defaultAdminUser, "");
[String]$hostCredentialsPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($hostCredentials.Password));
#cd "Biztalk:\Platform Settings\Hosts"
#New-Item $HostName -HostType:$HostType -NtGroupName:$NTGroupName -AuthTrusted:$AuthTruste
#New-Item -path $hostName -HostType:$HostType -NtGroupName:$NTGroupName -AuthTrusted:$AuthTrusted
cd "BizTalk:\Platform Settings\Host Instances"
dir
Write-Host "Try to add New HostInstance=$hostName"
New-Item $hostName -HostName $hostName -Credentials $hostCredentials -RunningServer $serverName
dir
当我在凭据中提供有效的域用户/密码时,我收到此错误:
New-Item:未找到 WMI 类的实例。 未找到具有指定键的实例。这可能是实例被另一个 BizTalk 管理员会话删除的结果。在 E:\CreateHost_PSSnapIn.ps1:27 字符:1
如果我不使用 -Credentials 参数。它提示我有关用户/通行证的新项目,并且发生相同的错误。如果我提供了一个完全伪造的用户 ID/通行证,我仍然会得到同样的错误。
【问题讨论】:
标签: powershell biztalk credentials biztalk-2010