简体   繁体   English

2003服务器上的WMI访问被拒绝问题

[英]WMI Access Denied Problem on 2003 Server

I´m having a problem whenever i try to use WMI services on a virtual pc running a 2003 Server. 每当我尝试在运行2003 Server的虚拟PC上使用WMI服务时,我都会遇到问题。

The error message that i get is 'Access Denied'. 我收到的错误消息是“访问被拒绝”。 I have already checked the permissions of the user over the COM components. 我已经检查了用户对COM组件的权限。 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. 奇怪的是,我以管理员用户身份同时运行WMI服务和我的应用程序,因此我认为我在权限方面没有麻烦。

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);
        }

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. 我想这是域用户权限的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM