Ошибка методов WMI для удаленного компьютера
![](http://i.codenet.ru/caq/files/3/2/5/t_523.png)
Причем как в студии, так и в 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);