Always On FailOver Events
    We can run below PowerShell and SQL Server commands when we want to find ou when the failover has happened.       cls     Get-winEvent  -ComputerName   ListerNameHere   -filterHashTable  @{logname = 'Microsoft-Windows-FailoverClustering/Operational' ; id = 1641 } |      Where-Object  { $_ . Timecreated -like  '*05/09/2020*' } | Format-Table  -AutoSize  -Wrap      <#   35201-->timeout alert run this by changing -LogName to System 41-->41 is power shutdown run this in system   #>   clear   Get-EventLog  -LogName  Application  -After ( Get-Date ) . AddHours( -48 ) |   Where-Object { $_ . EventID -in  ( 1100 , 1074 , 35201,41,1561,7024,1135,7032,1146 )} |  Format-Table  -AutoSize  -Wrap cls  Get-EventLog ` -LogName System |Where-Object{$_.EventID -in (1054,1053,1055,1138,1141,1142,5140,5142,1559,1560,1563,1588,1068,5144,1562,5143,5168,1564,1177)}|Format-Table -AutoSize -Wrap   EXEC sp_readerrorlog 0,1,'lease worker'     EXEC sp_readerrorlog 0,1,'...
Comments