Discussion:
How to set WBEM_ENABLE and WBEM_REMOTE_ENABLE with C++
(too old to reply)
Bernd Wessels
2009-11-16 04:26:10 UTC
Permalink
Hello,

I am trying to call the following function:

hResult = m_pWbemServices->ExecNotificationQueryAsync(
_bstr_t("WQL"),
_bstr_t("SELECT * FROM __InstanceCreationEvent WITHIN 1
WHERE TargetInstance ISA 'Win32_NTLogEvent'"),
WBEM_FLAG_SEND_STATUS,
NULL,
m_pStubWbemObjectSink);

BUT in some cases it returns access denied.

The reason is that I have to set WBEM_ENABLE and WBEM_REMOTE_ENABLE
before.

BUT I dont know how to do it from C++ ???

Please please help, it drives me crazy.

Thanks

Bernd



For details see here:
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/c6482c2a-88ca-467a-af74-b8b3e412ad0d/
r***@gmail.com
2013-05-07 11:10:09 UTC
Permalink
Post by Bernd Wessels
Hello,
hResult = m_pWbemServices->ExecNotificationQueryAsync(
_bstr_t("WQL"),
_bstr_t("SELECT * FROM __InstanceCreationEvent WITHIN 1
WHERE TargetInstance ISA 'Win32_NTLogEvent'"),
WBEM_FLAG_SEND_STATUS,
NULL,
m_pStubWbemObjectSink);
BUT in some cases it returns access denied.
The reason is that I have to set WBEM_ENABLE and WBEM_REMOTE_ENABLE
before.
BUT I dont know how to do it from C++ ???
Please please help, it drives me crazy.
Thanks
Bernd
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/c6482c2a-88ca-467a-af74-b8b3e412ad0d/
Hi,

Were you able to resolve this issue? I am trying the same in a C++ app where ExecQueryAsync works for a local host but fails with ACCESS_DENIED for a remote host. Can you please throw light on this?

Thanks,
Ram

Loading...