Register-EventLogSink



Summary

Registers a source in an event log

Syntax

Register-EventLogSink [[-logname] <String>] [[-source] <String>] [[-target] <String>] [<CommonParameters>]

Description

This command registers a source in an event log. must be executed before sending messages to the event log via the Send-ToEventLog command. The source must match the source in the Send-ToEventLog command. By default, it is assumed that the source is 'HP-CSL'.

This command can be unregistered using the Unregister-EventLogSink command.

Parameters

Name Argument Description
logname <String> Specifies the log section in which to register this source
source <String> Specifies the event log source that will be used when logging.

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_LOG: override default message log name
  • HPSINK_EVENTLOG_MESSAGE_TARGET: override event log server name

Examples


PS C:\> Register-EventLogSink

See also