Summary
Unregisters a source registered by the Register-EventLogSink command
Syntax
Unregister-EventLogSink [[-source] <String>] [[-target] <String>] [<CommonParameters>]
Description
This command removes a registration that was previously registered by the Register-EventLogSink command.
Note: Switching between formats changes the file encoding. The 'Simple' mode uses unicode encoding (UTF-16) while the 'CMTrace' mode uses UTF-8. This is partly due to historical reasons (default encoding in UTF1-16 and existing log is UTF-16) and partly due to limitations in CMTrace tool, which seems to have trouble with UTF-16 in some cases.
As a result, it is important to start with a new log when switching modes. Writing UTF-8 to UTF-16 files or vice versa will cause encoding and display issues.
Parameters
Name | Argument | Description |
---|---|---|
source | <String> | Specifies the event log source that was registered via the Register-EventLogSink command. The source can also be specified via the HPSINK_EVENTLOG_MESSAGE_SOURCE environment variable. |
target | <String> | Specifies the target computer on which to perform this command. Local computer is assumed if not specified, unless environment variable HPSINK_EVENTLOG_MESSAGE_TARGET is defined. Important: the user identity running the PowerShell script must have permissions to write to the remote event log. |
Notes
This command reads the following environment variables for setting defaults:
- HPSINK_EVENTLOG_MESSAGE_SOURCE: override default source name
- HPSINK_EVENTLOG_MESSAGE_TARGET: override event log server name
Examples
PS C:\> Unregister-EventLogSink