EvtOpenChannelEnum access denied
I'm calling EvtOpenChannelEnum
after having gotten a valid session handle with EvtOpenSession
. EvtOpenSession
worked, but EvtOpenChannelEnum
is returning access denied (GetLastError = 5
).
Why would t开发者_运维问答his be? If there was an access problem, I'd expect to hit it with the EvtOpenSession
call. What's more perplexing, the user can get on the same computer with my program, logged in as the same user, and use the Windows Event Log Viewer (2008, so assuming it's using the same API) and it works fine.
Stumped...
You do not have the required permission on the remote server. This is not checked immediately, but when you use the handle for the first time.
From the docs for EvtOpenSession:
This function does not validate the credentials; the credentials are validated the first time you try to use the session handle. If the credentials are not valid, the call will fail with ERROR_ACCESS_DENIED.
精彩评论