Using the Windows Events Command-Line Utility for Event Monitoring
The Windows Events Command-Line Utility (Wevtutil.exe) lets you manage event logs on a computer from the command line by performing tasks such as:
- Retrieving information about event logs and publishers.
- Installing and uninstalling event manifests.
- Executing queries for specific event.
- Exporting, archiving, and clearing event logs.
Wevtutil should be run from an elevated command prompt. The general syntax for Wevtutil is as follows.
wevtutil command [argument [argument] ...] [/option:value [/option:value] ...]
Here, command can be any of the following:
- al (archive-log) Archives an exported log
- cl (clear-log) Clears a log
- el (enum-logs) Lists log names
- ep (enum-publishers) Lists event publishers
- epl (export-log) Exports a log
- gl (get-log) Gets log configuration information
- gli (get-log-info) Gets log status information
- gp (get-publisher) Gets publisher configuration information
- im (install-manifest) Installs event publishers and logs from manifest
- qe (query-events) Queries events from a log or log file
- sl (set-log) Modifies configuration of a log
- um (uninstall-manifest) Uninstalls event publishers and logs from manifest
Common examples for option include:
- /r:value (remote) If specified, runs the command on a remote computer named value. Note that im (install-manifest) and um (uninstall-manifest) do not support remote operation.
- /u:value (username) Specifies a different user to log on to a remote computer. Here value is a user name in the form domain\user or user. This option is applicable only when option /r (remote) is specified.
- /p:value (password) Specifies a password for the specified user. If not specified, or if the value is "*", the user will be prompted to enter a password. This option is applicable only when the /u (user name) option is specified.
- /a:value (authentication) Specifies an authentication type for connecting to a remote computer. The value can be Default, Negotiate, Kerberos, or NTLM. The default is Negotiate.
- /uni:value (unicode) Displays output in Unicode. The value can be true or false (if true, output is in Unicode).
Note You can use either the short (ep /uni) or long (enum-publishers /unicode) version of the command and option names; and all commands, options, and option values are case-insensitive.
More Info To learn more about a specific command, type wevtutil command /? at an elevated command prompt. For additional information concerning Wevtutil.exe, see http://technet.microsoft.com/en-us/library/cc732848.aspx.
In this tutorial:
- Windows 7 Desktop Maintenance
- Performance Monitoring
- Improvements to Performance Monitoring in Windows 7
- Using Performance Monitor
- Real-Time Performance Monitoring
- Performance Monitor Logging
- Creating a Data Collector Set
- Configuring a Data Collector Set
- Using Data Manager to View Performance Data
- Starting and Stopping Data Logging
- Viewing Performance Data
- Comparing Performance Monitor Logs
- Performance Monitor User Rights
- Remote Data Collection
- Using Windows PowerShell for Performance Monitoring
- Resource Monitor
- Overview Tab
- CPU Tab
- Memory Tab
- Disk Tab
- Network Tab
- Reliability Monitor
- How Reliability Monitor Works
- Windows Performance Tools Kit
- Event Monitoring
- Understanding the Windows Event Architecture
- Channels
- Improvements to Event Monitoring in Windows 7
- Using Event Viewer
- Understanding Views
- Viewing Event Logs
- Saving Event Logs
- Configuring Event Subscriptions
- Considerations for Workgroup Environments
- Creating a New Subscription
- Using the Windows Events Command-Line Utility for Event Monitoring
- Using Windows PowerShell for Event Monitoring
- Using Task Scheduler
- Improvements to Task Scheduler in Windows 7
- Understanding Tasks
- Understanding the Task Scheduler Architecture
- Understanding Task Scheduler Security
- Credentials Management
- Securing Running Tasks
- Understanding AT and Task Scheduler v1.0 Compatibility Modes
- Understanding the Task Scheduler Snap-in
- Understanding Default Tasks
- Creating Tasks
- Defining Triggers
- At Startup Trigger
- On Connection To AND Disconnect From User Session Triggers
- On Workstation Lock AND Unlock Triggers
- Defining Actions
- Defining Conditions
- Defining Settings
- Managing Tasks
- Viewing History
- Using SchTasks.exe for Creating and Managing Tasks
- Task Scheduler Events
- Troubleshooting Task Scheduler
- Tasks Won't Run If the Service Is Not Started
- The Task Will Run Only When a Certain User Is Logged On
- The Task Action Failed to Execute
- Interpreting Result and Return Codes
- Understanding the Windows System Assessment Tool
- Understanding WinSAT Assessment Tests
- Examining the WinSAT Features Assessment
- Running WinSAT from the Command Line
- Understanding WinSAT Command Exit Values
- Running WinSAT Using Performance Information and Tools
- System Capabilities Section
- OEM Upsell And Help Section
- Understanding Windows Error Reporting
- Overview of Windows Error Reporting
- How WER Works
- Store Management System
- ReportArchive Folder
- WER Service
- Understanding the Error Reporting Cycle
- Understanding WER Data
- Configuring WER Using Group Policy
- Configuring WER Using the Action Center