Querying the event log is an activity that Windows administrators have to do from time to time. Whether it is a misbehaving application that logs its errors to the application log, or a critical kernel event, the event log has you covered.
As we use Get-WinEvent on PowerShell Core, this recipe will show you how to get the most performance out of it and still have manageable and readable code. We will use the security log as an example because this log tends to grow very large, very fast. You will use filters to find out whether and where, a specific user has logged on.