Advertisement
guyrleech

Get Events Prior to Last Boot

Dec 7th, 2023
966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## Look for events in System event log prior to the last boot to get clues as to why it rebooted
  2. ## Assume system has been used in the preceding 24 hours
  3.  
  4. $boot = (gcim win32_operatingsystem).LastBootUpTime ; get-winEvent -FilterHashtable @{ LogName = 'System' ; EndTime = $boot ; StartTime = $boot.AddHours( -24 ) } -MaxEvents 50|select-object -property timecreated,Id,ProviderName,LevelDisplayName,Message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement