Created
July 17, 2018 17:51
-
-
Save h3nryza/bbcb12cd307497d6e48a883a1f60e8f2 to your computer and use it in GitHub Desktop.
Powershell last shutdown events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $arrShutdown = Get-EventLog -LogName System -EntryType Information -InstanceId 2147484722 | sort-object $_.Time -descending | |
| foreach ($item in $arrShutdown) | |
| { | |
| $UserName = $item.UserName | |
| $Message = $item.Message | |
| $Time = $item.TimeGenerated | |
| write-host "UserName `t:$username `nTime `t`t:$time `nMessage `t:$Message `n`n" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment