이벤트 로그를 수집하려고하는데 관리자 권한없이 수행하려고합니다. 내가 액세스 거부 오류가이 작업을 수행 할 때 관리자 권한이없는 Windows API를 사용하여 이벤트 로그 수집
이
은 ..#include "stdafx.h"
#pragma comment(lib, "wevtapi.lib")
#include <Windows.h>
#include <winevt.h>
int _tmain(int argc, _TCHAR* argv[])
{
BOOL flag=EvtExportLog(
NULL,
L"%SystemRoot%\\System32\\Winevt\\Logs\\System.evtx",
L"*",
L"D:\\SomePath\\Des.evtx",
EvtExportLogFilePath
);
int i = GetLastError();
}
내 코드입니다. 나는 eventvwr
을 사용하여 이벤트 로그를 볼 수 있으며 로그 파일의 경로는 %SystemRoot%\System32\Winevt\Logs\System.evtx
일 수 있습니다. 그러나 다시 시도 할 때 액세스를 거부당한 run
에 경로를 표시하려고 시도합니다.
관리자 권한없이 해당 .evtx
로그 파일을 복사하려고합니다. 그렇게 할 방법이 있습니다.