Get-TcEvent
SYNOPSIS
Gets TwinCAT events from event logs on local and remote computers.
SYNTAX
Get-TcEvent [-MaxEvents <Int32>] [-ComputerName <String>] [-Credential <PSCredential>] [-Level <String[]>]
[-Source <String[]>] [-StartTime <DateTimeOffset>] [-EndTime <DateTimeOffset>] [-ID <Int32[]>]
[-Timeout <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
TwinCAT creates LogEntries in the Application log.
These most important entries for system diagnostics source from the TcSysUI Application and the TwinCAT System Service (TcSysSrv) containing the logentries from the TwinCAT Drivers.
This Get-TcEvent Cmdlet gets these events from the local system and as well from other reachable systems within the corporate network.
If you're not running PowerShell as an Administrator, you might see error messages that you cannot retrieve information about a log.
EXAMPLES
EXAMPLE 1
PS> get-tcevent -MaxEvents 30
ProviderName: TcSysUi
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:56:44 3 Information Process startup apps was already triggerd.
17.08.2021 15:56:44 1 Information Process startup apps after reaching RUN state.
ProviderName: TcSysSrv
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:56:44 66 Information Starting COM Server TcEventLogger !
17.08.2021 15:56:44 20000 Information TwinCAT System Message: Source: License Server; Timestamp: 8/17/2021 3:56:44 PM 345 ms Message: license validation status is Valid(3)
17.08.2021 15:56:44 15 Information TcRTime Server started: TcRTime.
17.08.2021 15:56:44 15 Information TcRtsObjects Server started: TcRtsObjects.
17.08.2021 15:56:44 15 Information TcPlc30 Server started: TcPlc30.
17.08.2021 15:56:44 15 Information TcIo Server started: TcIo.
17.08.2021 15:56:44 69 Information Initializing COM Server TcEventLogger !
17.08.2021 15:56:44 71 Information Loading configuration of COM server TcEventLogger !
ProviderName: TcSysUi
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:56:44 2 Information Process startup apps skipped after reaching state '4'.
17.08.2021 15:56:44 2 Information Process startup apps skipped after reaching state '6'.
ProviderName: TcSysSrv
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:56:43 67 Information Stopping COM Server TcEventLogger !
17.08.2021 15:56:43 28 Information TCIODRIVERS Server stopped.
17.08.2021 15:56:43 28 Information TCIOECAT Server stopped.
17.08.2021 15:56:43 28 Information TCIOETH Server stopped.
17.08.2021 15:56:43 28 Information TCRTSOBJECTS Server stopped.
17.08.2021 15:56:43 28 Information TCRTIME Server stopped.
17.08.2021 15:56:43 28 Information TCIO Server stopped.
17.08.2021 15:56:43 68 Information Shutting down COM Server TcEventLogger !
17.08.2021 15:56:42 70 Information Saving configuration of COM server TcEventLogger !
ProviderName: TcSysUi
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:56:42 2 Information Process startup apps skipped after reaching state '17'.
ProviderName: TcSysSrv
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:56:42 33 Information TwinCAT System Restart initiated from AmsNetId: 172.17.60.197.1.1 port 32894.
ProviderName: TcSysUi
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:50:56 2 Information Process startup apps skipped after reaching state '15'.
ProviderName: TcSysSrv
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:50:56 66 Information Starting COM Server TcEventLogger !
17.08.2021 15:50:55 15 Information TCIODRIVERS Server started: TCIODRIVERS.
Gets last 30 events (all events) on the local system.
EXAMPLE 2
PS> get-tcevent -computerName CX_1234 -Level Critical, Error, Warning -source TcSysSrv -StartTime([DateTime]::Now -[TimeSpan]::FromDays(1))
ProviderName: TcSysSrv
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:50:53 89 Error Error: .. checking TwinCAT Licenses!
17.08.2021 15:50:53 20000 Error TwinCAT System Message: Source: License Server; Timestamp: 8/17/2021 3:50:53 PM 145 ms Message: License Violation: License 'TC3 PLC' not found, Requested by 'PLC1 Instance', LicenseId = {666…
Getting the logged errors/warnings of system 'CX_1234' of the last 24 hours and filter the events for the Event provider 'TcSysSrv' (the TwinCAT System Service)
EXAMPLE 3
PS> get-tcevent --StartTime '2021-08-17 15:50:55' -EndTime '2021-08-17 15:55:56' -source TcSysSrv
ProviderName: TcSysSrv
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
17.08.2021 15:50:56 66 Information Starting COM Server TcEventLogger !
17.08.2021 15:50:55 15 Information TCIODRIVERS Server started: TCIODRIVERS.
17.08.2021 15:50:55 15 Information TCIOECAT Server started: TCIOECAT.
17.08.2021 15:50:55 15 Information TCIOETH Server started: TCIOETH.
17.08.2021 15:50:55 15 Information TCRTSOBJECTS Server started: TCRTSOBJECTS.
17.08.2021 15:50:55 15 Information TCRTIME Server started: TCRTIME.
17.08.2021 15:50:55 15 Information TCIO Server started: TCIO.
17.08.2021 15:50:55 69 Information Initializing COM Server TcEventLogger !
17.08.2021 15:50:55 71 Information Loading configuration of COM server TcEventLogger !
17.08.2021 15:50:55 67 Information Stopping COM Server TcEventLogger !
17.08.2021 15:50:55 68 Information Shutting down COM Server TcEventLogger !
Show EventLog of TwinCAT SystemService between two points in time.
PARAMETERS
-MaxEvents
Specifies the maximum number of events that are returned.
Enter an integer such as 100.
The default is to return all TwinCAT events.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ComputerName
Specifies the name of the computer that this cmdlet gets events from the event logs.
Type the NetBIOS name, an IP address, or the fully qualified domain name (FQDN) of the computer.
The default value is the local computer, localhost.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Credential
Specifies a user account that has permission to perform this action.
The default value is the current user.
Type a user name, such as User01 or Domain01\User01.Or, enter a PSCredential object, such as one generated by the Get-Credential cmdlet.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Level
The log level, that is determined.
By default, all EventLog content will be returned.
Allowed values are: - All - Critical - Error - Warning - Informational - Verbose
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
-Source
The log level, that is determined.
By default, all TwinCAT EventLog content will be returned.
Actually allowed values are: - All - TcSysUI - TcSysSrv - TcEventLogger - Tc3ScopeServer - 'TF3300 TwinCAT 3 Scope Server' - 'TwinCAT3 Scope Server'
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
-StartTime
Filters the EventLog to return only entries that were produced after the specified start time.
By default the start time is not set, returning Events from the beginning of the log.
Type: DateTimeOffset
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-EndTime
Filters the EventLog to return only entries that were produced up to the specified end time.
By default the end time is not set, returning the newest entries.
Type: DateTimeOffset
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ID
Filters the EventLog to the specified EventIds.
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Timeout
Timeout of the Read event log operation (default: no timeout).
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.