Commands / System

Get-LocalUser

List local user accounts

beginner System

Get-LocalUser
 Get-LocalUser | Select-Object Name, Enabled, LastLogon
Works on
Windows
PowerShell
5.1 and later
Reference
Microsoft Learn: Get-LocalUser

Lists accounts stored on this computer only. Domain and Microsoft-account sign-ins appear here only if they also have a local account.

Reading the list does not need an administrator prompt. Creating or changing accounts does.

Try this

Who is in the local Administrators group?

Get-LocalGroupMember -Group Administrators

Enabled accounts that have not signed in for 90 days:

Get-LocalUser |
    Where-Object { $_.Enabled -and $_.LastLogon -lt (Get-Date).AddDays(-90) } |
    Select-Object Name, LastLogon

Coming from another shell

ShellWhat you might type
cmd.exenet user

More in From bash and From cmd.

Related commands