2012-11-20 121 views
1

當通過WMI.NET連接到Biztalk Server 2010時,我能夠成功地瀏覽任何數量的類類型,但沒有任何Biztalk類。每個那些拋出以下異常空話:WMI.NET to MicrosoftBizTalkServer - 用戶登錄失敗ANONYMOUS LOGIN

BizTalk Server cannot access SQL server. This could be due to one of the following reasons: 
1. Access permissions have been denied to the current user. Either log on as a user that has been granted permissions to SQL and try again, or grant the current user permission to access SQL Server. 
2. The SQL Server does not exist or an invalid database name has been specified. Check the name entered for the SQL Server and database to make sure they are correct as provided during SQL Server installation. 
3. The SQL Server exists, but is not currently running. Use the Windows Service Control Manager or SQL Enterprise Manager to start SQL Server, and try again. 
4. A SQL database file with the same name as the specified database already exists in the Microsoft SQL Server data folder. 

Internal error from OLEDB provider: "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." 

測試代碼(無安全信息):

ConnectionOptions options; 
options = new ConnectionOptions(); 
options.Username = @"myusername"; 
options.Password = @"mypassword"; 
options.Authority = @"ntlmdomain:mydomain"; 

ManagementScope scope; 
scope = new ManagementScope(@"\\BIZSERVERNAME\root\MicrosoftBizTalkServer", options); 
scope.Connect(); 

ObjectQuery query = new ObjectQuery("SELECT * FROM MSBTS_Setting"); 
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope,query); 
var i = 0; 
foreach (ManagementObject key in searcher.Get()) 
{ 
    listBox1.Items.Add(key.ToString()); 
    i++; 
    if (i > 100) break; 
} 

變化MSBTS_Setting任何Biztalk的班級,並得到同樣的異常。 將其更改爲非biztalk類,它行得通。例如:CIM_Setting。

+0

另外,我得到同樣的錯誤嘗試瀏覽instsances與CIM Studio時。它可以列出Biztalk服務器上的類層次結構,但是當您單擊「實例」按鈕時,它將失敗並顯示相同的異常。 –

+0

這可能與UAC相關,因爲它位於Windows Server 2008 R2盒子上。我在考慮WMI.NET在BIZ框中與WMI連接時,它的所有查詢都是針對UAC提供的權限較低的安全令牌。因此,當WMI試圖調用MSBTS_ *類需要調用Biztalk的SQL數據庫時,而不是完整的特權安全令牌,則傳遞較低的安全令牌。現在我只是在猜測,但也許那個較低安全性的令牌實際上只是匿名登錄。 ??? –

+0

BizTalk有一組內置的用戶和組http://msdn.microsoft.com/en-us/library/aa577661.aspx。用於通過WMI連接的用戶帳戶 - 是否是任何BizTalk組的一部分? – HashName

回答

0

我認爲這可能是因爲您用來訪問WMI對象的帳戶不是「SSO管理員」組的成員。

我有一個非常類似的問題(BizTalk WMI訪問問題),並遇到這篇文章。將帳戶添加到「SSO管理員」組爲我工作。

2

你遇到了所謂的「雙跳」問題。 (這實際上不是WMI/BT的特定問題,它也是使用Windows身份驗證的IIS和Sql Server的常見問題)

當使用'BizTalk-WMI'時,基本上會發生這種情況(假設客戶端,BT服務器和BT -Management-DB在同一個域中,但在不同的機器上):

客戶端憑證發送到BT服務器/ WMI提供程序。 BT-Server也應該將證書傳送給Sql-Server,但Kerberos不允許這樣做(默認情況下)。

也看到這個TechNet文章:

Basicly你必須使用 'BT-WMI' 3個選項:

  1. 與運行代碼在BT主機上的WMI,這將只需要一個單跳到sql服務器。或者通過託管在BT主機上的Web服務公開必要的功能。
  2. 使用Microsoft.BizTalk.ExplorerOM組件
  3. 使能(在Active Directory)代表團對帳戶和BT主機(S)兩種:Allow a computer to be trusted for delegation for specific services
相關問題