Created
August 31, 2021 13:14
-
-
Save kshire/878bb5a567e88d5f1a810fefdface30e to your computer and use it in GitHub Desktop.
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
| Get-CimInstance -ClassName Win32_NetworkLoginProfile -ComputerName $env:COMPUTERNAME | | |
| Where-Object { $_.UserType -match 'Normal Account' -and $_.Privileges -match '1' } | | |
| Sort-Object -Property LastLogon -Descending | | |
| Select-Object -Property Name, FullName, LastLogon, PSComputerName -First 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment