Re: WMI Mystery



Hi Ron,

I think it basically means your code is wrong.

I don't use C++ for this type of thing, so can't help much, but I note you are using RPC_C_IMP_LEVEL_IMPERSONATE, but you say you are passing credentials? That's probably not correct.

Ron M. Newman wrote:
Hi,

Yes, WbemTest successfully connects with the same credentials I use in the code which won't work for queries (but will connect successfully).

Any ideas?

Ron

"Gerry Hickman" <gerry666uk@xxxxxxxxxxxxxxxx> wrote in message news:OtTFEqPuHHA.4504@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

Please can you test it again

A) Using WbemTest
B) Using Scripting

Ron M. Newman wrote:
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





--
Gerry Hickman (London UK)



--
Gerry Hickman (London UK)
.



Relevant Pages

  • 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)
  • WMI Mystery
    ... I have a remote server somewhere, ... 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
    ... WbemTest successfully connects with the same credentials I use in the code which won't work for queries. ... "Gerry Hickman" wrote in message ... Accessing it through WMI Explorer works just fine with a user id + ... Query for operating system name failed. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Uniqe list
    ... > data into a storage doc, then want to create automatic reports. ... >> A query would probably address your problem, but I am not sure how ... I belive you can execute queries in Excel through ...
    (microsoft.public.excel.programming)
  • Re: SELECT Queries. A straight answer.
    ... I'm trying to execute queries from VBA without much luck so far. ... I use doCmd.openQuery and it runs without error, ... "Executing" a query normally refers to action queries (UPDATE, APPEND, ...
    (comp.databases.ms-access)