WMI Mystery



Have an intereting problem. I have a remote server somewhere, not even on my
network. Accessing it through WMI Explorer works just fine with a user id +
password. I can connect and execute queries correctly.

I have my own c++ code to connect to WMI servers and run queries. It works
locally perfectly however when I use the same code for this remote server
with the user id + password, it connects successfully, but executing queries
gives me the good old "access denied":


Connected to ROOT\CIMV2 WMI namespace <- connection works nicely.
Query for operating system name failed. Error code = 0x80070005 <- query
fails! same query works fine using WMI explorer.


My question i guess is whether I'm doing something wrong with the
CoSetProxyBlanket. My implementation is:


hres = CoSetProxyBlanket(
pSvc, // Indicates the proxy to set
RPC_C_AUTHN_WINNT, // RPC_C_AUTHN_xxx
RPC_C_AUTHZ_NONE, // RPC_C_AUTHZ_xxx
NULL, // Server principal name
RPC_C_AUTHN_LEVEL_CALL, // RPC_C_AUTHN_LEVEL_xxx
RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx
NULL, // client identity
EOAC_NONE // proxy capabilities
);


any help would be appreciated.


Ron



.



Relevant Pages

  • Re: WMI Mystery
    ... "Gerry Hickman" wrote in message ... Accessing it through WMI Explorer works just fine with a user id + ... I can connect and execute queries correctly. ... Query for operating system name failed. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: WMI Mystery
    ... Ron M. Newman wrote: ... Accessing it through WMI Explorer works just fine with a user id + ... I can connect and execute queries correctly. ... Query for operating system name failed. ...
    (microsoft.public.win32.programmer.wmi)
  • troubleshooting no response to wmi query on remote server
    ... I've written a perl script to query the event logs on remote servers. ... In checking the wbemcore.log on a problematic remote server, ...
    (microsoft.public.win32.programmer.wmi)
  • Re: missing indexes
    ... My sql version is: Microsoft SQL Server ... >I've simplified the query a little, but it's still causing the error in my ...
    (microsoft.public.sqlserver.programming)
  • Re: remote query
    ... Did you meant tuning the "Query" in remote server. ... Open the query and execute using "Execution Plan' ...
    (microsoft.public.sqlserver.server)