2003 服务器上的 WMI 访问被拒绝问题
每当我尝试在运行 2003 Server 的虚拟 PC 上使用 WMI 服务时,都会遇到问题。
我收到的错误消息是“访问被拒绝”。我已经检查了用户对 COM 组件的权限。奇怪的是,我以管理员用户身份运行 WMI 服务和我的应用程序,所以我认为我在权限方面没有问题。
有人可以帮助我吗?
非常感谢你。
问题出在这个块上:
ManagementEventWatcher watcher;
try
{
numeros = devolverRandomicos();
string nros = "";
foreach (int num in numeros)
{
nros = nros + " " + num.ToString();
}
MessageBox.Show(nros);
watcher = new ManagementEventWatcher("root\\OnGuard", dataQry);
watcher.EventArrived += WMIEventArrieved;
watcher.Start();
}
catch (Exception e)
{
MessageBox.Show("ERROR CREANDO EL WATCHER: \n" + e.Message,"CatchToyota",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
I´m having a problem whenever i try to use WMI services on a virtual pc running a 2003 Server.
The error message that i get is 'Access Denied'. I have already checked the permissions of the user over the COM components. The curious thing is that i´m running both WMI service and my app as Administrator user, so i don´t think i have trouble with permissions.
Can Anyone help me??
Thanks you very much.
The problem is on this block:
ManagementEventWatcher watcher;
try
{
numeros = devolverRandomicos();
string nros = "";
foreach (int num in numeros)
{
nros = nros + " " + num.ToString();
}
MessageBox.Show(nros);
watcher = new ManagementEventWatcher("root\\OnGuard", dataQry);
watcher.EventArrived += WMIEventArrieved;
watcher.Start();
}
catch (Exception e)
{
MessageBox.Show("ERROR CREANDO EL WATCHER: \n" + e.Message,"CatchToyota",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后的问题出在我用来登录的域用户中。将计算机移出域后,一切都开始正常工作。
我猜这是域用户权限的问题。
The problem at last was in the Domain Users I was using to log in. After getting the machine out of the domain, all started to work just fine.
I guess it was a problem with permissions on domain users.