Re: WMI Mystery
- From: Gerry Hickman <gerry666uk@xxxxxxxxxxxxxxxx>
- Date: Sun, 08 Jul 2007 01:26:33 +0100
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@xxxxxxxxxxxxxxxxxxxxxxxHi,
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)
.
- Prev by Date: Re: Future of the MSI provider?
- Next by Date: Re: Determine SP Lenvel of .NET
- Previous by thread: Not able to connect using C#
- Next by thread: Querying permissions hangs/ takes forever
- Index(es):
Relevant Pages
|