Get the Events from Specific Event ID to Specific Event ID (2 User Input : Event ID Upper Limit and Event ID Lower Limit)

Ravalika Mukka 21 Reputation points
2021-07-09T05:38:52.41+00:00

Get the Events from Specific Event ID to Specific Event ID (2 User Input : Event ID Upper Limit and Event ID Lower Limit)

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2021-07-09T08:03:19.447+00:00

    Hi,

    Please try this. Set $LogName to the name of the log you want to check.

    $LowerLimit = Read-Host -Prompt "Lower Limit"  
    $UpperLimit = Read-Host -Prompt "Upper Limit"  
    $LogName = "Microsoft-Windows-PowerShell/Operational"  
    Get-WinEvent -LogName $LogName | Where-Object { ($_.id -gt $LowerLimit) -and ($_.id -lt $UpperLimit)}  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.