WMI访问被拒绝问题 [英] WMI Access Denied Issue

查看:454
本文介绍了WMI访问被拒绝问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在获取访问被拒绝"异常而,
尝试在远程计算机上运行过程...给定的用户凭据


使用C#,WMI,有关代码的详细信息

object[] theProcessToRun = { "calc.exe" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Username = "chester";
theConnection.Password = "";
ManagementScope theScope = new ManagementScope("\\\\" + "192.168.10.15" + "\\root\\cimv2", theConnection);
theScope.Connect();  // TO PUT THIS OR NOT ???
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);



是否输入theScope.Connect();?

解决方案

您使用的用户凭证必须具有在尝试使用的计算机上运行该进程的权限.


尝试设置 EnablePrivileges [ ^ ]设置为true. /blockquote>

I am getin "Access is denied" exception while,
tryin to run a PROCESS on REMOTE MACHINE... User Credentials given


Using C#, WMI, Details about the code,

object[] theProcessToRun = { "calc.exe" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Username = "chester";
theConnection.Password = "";
ManagementScope theScope = new ManagementScope("\\\\" + "192.168.10.15" + "\\root\\cimv2", theConnection);
theScope.Connect();  // TO PUT THIS OR NOT ???
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);



Whether to PUT theScope.Connect(); ?

解决方案

The user credential you are using must have the rights to run the process on the machine you are trying.


Try to set EnablePrivileges[^] to true.


这篇关于WMI访问被拒绝问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆