當通過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。
另外,我得到同樣的錯誤嘗試瀏覽instsances與CIM Studio時。它可以列出Biztalk服務器上的類層次結構,但是當您單擊「實例」按鈕時,它將失敗並顯示相同的異常。 –
這可能與UAC相關,因爲它位於Windows Server 2008 R2盒子上。我在考慮WMI.NET在BIZ框中與WMI連接時,它的所有查詢都是針對UAC提供的權限較低的安全令牌。因此,當WMI試圖調用MSBTS_ *類需要調用Biztalk的SQL數據庫時,而不是完整的特權安全令牌,則傳遞較低的安全令牌。現在我只是在猜測,但也許那個較低安全性的令牌實際上只是匿名登錄。 ??? –
BizTalk有一組內置的用戶和組http://msdn.microsoft.com/en-us/library/aa577661.aspx。用於通過WMI連接的用戶帳戶 - 是否是任何BizTalk組的一部分? – HashName