none
UnauthorizedAccessException?

    Question

  • Hi,
       Ive been developing a WMI based application for use within a domain. But I'm having issues with a workstation in my test environment, the code works fine checking a Windows 2003 Server from my XP SP2 machine(and vice-versa), but fails on another SP2 workstation(a fresh install running inside a virtual machine on the server) trigging this exception. Ofcourse I could handle the exception but the application would be useless.

     The code that triggers the exception is below(when the connection is first used. x being the name of a datarow):
                                 
       System.Management.ManagementObjectSearcher searcher2 =
                                            new System.Management.ManagementObjectSearcher("\\\\" + x.Hostname + "\\root\\CIMV2",
                                            "SELECT * FROM Win32_ComputerSystem");

                                    foreach (System.Management.ManagementObject queryObj in searcher2.Get())
                                    {
                                        x.Processor_Number = queryObj["NumberOfProcessors"].ToString();
                                    }

    The WMI Code Creator (from microsoft) also triggers an access denied method when used remotely so I think this is a machine-centric issue.
    The account the application is run from is a Domain wide admin, and the workstation has all the remote options ticked on the System, remote tab, has all of the RPC/NTLM authentication and WMI services set on automatic and running and has the firewall turned off. Are there any more options or services that need to be running?

    Thanks
    Saturday, March 22, 2008 2:19 AM