I have this script:
$DCs = [DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() |
Select-Object -ExpandProperty Sites |
Select-Object -ExpandProperty Servers |
Select-Object -ExpandProperty Name
$results = Invoke-Command -ComputerName $DCs {
Get-EventLog -LogName 'DFS Replication' -Newest 100 | Where-Object {$_.EventID -eq 1206} |
Select-Object "EventID","MachineName","Message","TimeGenerated"
}
$results | Export-Csv -Path .\AllDCs_DFSLogs.csv -NoTypeInformation
…I really only want the first 5 events of that particular EventID. I put in “100” to cull through the log to at least find them, but how do I winnow exactly the ‘latest 5 of that EventID’?
thank you