查看登陆事件

Posted on 2019-07-01 21:03  努力成长静待花开  阅读(109)  评论(0编辑  收藏  举报

实现效果:

  

实现代码:

Get-EventLog -LogName Security -InstanceId 4624|
ForEach-Object{
    [PSCustomObject]@{
        Time=$_.TimeGenerated
        LogonType=$_.ReplacementStrings[8]
        ProcessName=$_.ReplacementStrings[17]
        Domain=$_.ReplacementStrings[6]
        User=$_.ReplacementStrings[5]
        ValidatePack=$_.ReplacementStrings[10]
        Source=$_.Source
    }
}|Out-GridView