Get-LocalUser
Use Get-LocalUser to list local user accounts on a Windows machine with their enabled state and password settings.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-LocalUser [[-Name] <string[]>] [-SID <SecurityIdentifier[]>] [<CommonParameters>]- Stage 1Get-LocalUser
-Name -SID
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Select Name, Enabled, PasswordLastSet, LastLogon
Show reference output
Sample output · fictional data, shaped like the real thing
Name Enabled PasswordLastSet LastLogon ------------- ------- --------------- -------------------- Administrator True 9/10/2026 7:52:09 PM svc_backup True 9/10/2026 2:00:15 AM
Filter by Enabled and PasswordExpires
Show reference output
Sample output · fictional data, shaped like the real thing
Name Enabled LastLogon ------------- ------- -------------------- Administrator True 9/10/2026 7:52:09 PM svc_backup True 9/10/2026 2:00:15 AM
Get-LocalUser -Name Administrator
Show reference output
Sample output · fictional data, shaped like the real thing
Name Enabled ------------- ------- Administrator True svc_backup True
Parameters
Parameter definitions:
-Name-SID
Practical use and troubleshooting
Practical scenario: Use Get-LocalUser when you need to list local user accounts on a Windows machine with their enabled state and password settings. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: Command not recognised can occur in an unsupported host architecture. The LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system; use the supported 64-bit host. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Get-LocalGroup. Get-LocalUser reads local accounts; Get-LocalGroup reads local groups. Local membership and Active Directory membership are separate inventories even when names look similar. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Get-LocalUser Use Get-LocalUser to list local user accounts on a Windows machine with their enabled state and password settings.
Next: Get-NetFirewallRule