0
我試圖執行機器B(域的一部分)從機器A(不是域的一部分)的程序。當我嘗試使用屬於計算機B的管理員組的一部分的域用戶時,我有以下代碼並引發「RPC服務器不可用」。當我使用本地用戶「管理員」,這也是機器B的管理員組的一部分,代碼工作正常。WMI:「RPC服務器不可用」錯誤只爲域用戶
兩臺機器都禁用了防火牆。我可以使用這兩個用戶從機器A登錄到機器B.
你能幫我嗎?
ConnectionOptions connectionOptions = new ConnectionOptions();
connectionOptions.Authority = "kerberos:" + domain + @"\" + machine;
connectionOptions.Impersonation = ImpersonationLevel.Impersonate;
connectionOptions.Authentication = AuthenticationLevel.PacketPrivacy;
connectionOptions.Username = username;
connectionOptions.Password = password;
ManagementScope scope = new ManagementScope(@"\\" + machine + "." + domain + @"\root\CIMV2", connectionOptions);
ManagementPath p = new ManagementPath("Win32_Process");
ManagementClass classInstance = new ManagementClass(scope, p, null);
ManagementClass startupSettings = new ManagementClass("Win32_ProcessStartup");
startupSettings.Scope = scope;
startupSettings["CreateFlags"] = 16777216;