WMI Query fails between different Domains

Joined
Aug 17, 2005
Messages
2
Reaction score
0
I am trying to connect from computerA to computerB to collect WMI data.
Error i get is 0x80070005[they say its common when trying for diff domains]
computerA : XP Professional under Domain 1 [DC: Linux]
computerB : Win2000 Professional under Domain 2 [DC: Windows 2000 server]

This is the code I have used, which is able to connect but Query fails.


CString IPAddress = "\\\\computerA\\ROOT\\CIMV2";
CString userName = "Domain2\\<Username>";
CString passWord = "<pwd>";
hres = pLoc->ConnectServer(
_bstr_t(IPAddress),
_bstr_t(userName), // User name
_bstr_t(passWord), // User password
0,
NULL, // Security flags
NULL, // Authority
0, // Context object
&pSvc // IWbemServices proxy
);


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

CString query = "Select ProcessorId from Win32_Processor";
hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t(query),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
//0,
NULL,
&pEnumerator);



Please help me to collect WMI data.
i tried RPC_C_AUTHN_LEVEL_CONNECTION in CoSetProxyBlanket() and many more combinations.
Error i get is 0x80070005[they say its common when trying for diff domains]
waiting for some one to solve this.
-prabhu
 
Last edited:
Joined
Aug 17, 2005
Messages
2
Reaction score
0
pls any one reply to me,
i tried most of the things
its working fine with Wbemtest[inbuilt] and WMIX products
so system settings is fine
the problem must be in code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top