이벤트 수집기 구독 삭제

로컬 컴퓨터에서 이벤트 수집기 구독을 삭제할 수 있습니다. 구독을 삭제하려면 먼저 구독 이름을 알고 있어야 합니다. 로컬 컴퓨터에서 현재 구독을 나열하는 방법에 대한 자세한 내용은 이벤트 수집기 구독 나열을 참조하거나 명령 프롬프트에서 다음 명령을 입력합니다.

wecutil es

참고

이 예제를 사용하여 이벤트 수집기 구독을 삭제하거나 명령 프롬프트에서 다음 명령을 입력할 수 있습니다.

wecutil dsSubscriptionName

 

삭제할 이벤트 수집기 구독의 이름을 검색한 후 구독 이름을 EcDeleteSubscription에 대한 매개 변수로 제공할 수 있습니다.

다음 C++ 코드 예제에서는 이벤트 수집기 구독을 삭제하는 방법을 보여줍니다.

#include <windows.h>
#include <EvColl.h>
#include <strsafe.h>

#pragma comment(lib, "wecapi.lib")

void __cdecl wmain()
{
    DWORD dwRetVal;
    LPWSTR lpSubname = L"MyTestSubscription";

    // Delete the specified Event Collector subscription.
    if (!EcDeleteSubscription(lpSubname, 0))
    {
        dwRetVal = GetLastError();
        LPVOID lpwszBuffer;

        FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
            NULL,
            dwRetVal,
            0,
            (LPWSTR) &lpwszBuffer,
            0,
            NULL);

        if (!lpwszBuffer)
        {
            wprintf(L"Failed to FormatMessage.  Operation Error Code: %u." 
                L"Error Code from FormatMessage: %u\n", dwRetVal, GetLastError());
            return;
        }

        wprintf(L"\nFailed to Perform Operation.\nError Code: %u\n"
            L"Error Message: %s\n", dwRetVal, lpwszBuffer);

        LocalFree(lpwszBuffer);
    }
}

이벤트 수집기 구독 나열

Windows 이벤트 수집기 참조