Ошибка методов WMI для удаленного компьютера
Причем как в студии, так и в WMICodeCreator, вот пример кода:
Код:
ConnectionOptions co = new ConnectionOptions();
co.Username = User;
co.Password = Pass;
ManagementScope ms = new ManagementScope("\\\\" + CompName + "\\root\\cimv2", co);
ms.Connect();
ManagementObject classInstance = new ManagementObject(ms, new ManagementPath("Win32_OperatingSystem.ReplaceKeyPropery='ReplaceKeyPropertyValue'"), null);
ManagementBaseObject outParams = classInstance.InvokeMethod("Shutdown", null, null);
co.Username = User;
co.Password = Pass;
ManagementScope ms = new ManagementScope("\\\\" + CompName + "\\root\\cimv2", co);
ms.Connect();
ManagementObject classInstance = new ManagementObject(ms, new ManagementPath("Win32_OperatingSystem.ReplaceKeyPropery='ReplaceKeyPropertyValue'"), null);
ManagementBaseObject outParams = classInstance.InvokeMethod("Shutdown", null, null);