CmdID / PowerShell / Cmdlets / Get
Get-LocalUser
Gets local user accounts. PowerShell reference
From the PowerShell reference
2 parameters
Alias glu
What it does
Gets local user accounts. The Get-LocalUser cmdlet gets local user accounts. This cmdlet gets default built-in user accounts, local user accounts that you created, and local accounts that you connected to Microsoft accounts. NOTE: The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system.
Get-LocalUser [[-Name] <String[]>] [<CommonParameters>]Get-LocalUser [[-SID] <SecurityIdentifier[]>] [<CommonParameters>]
Get an account by using its name
Get-LocalUser -Name "AdminContoso02"IdentifyGet an account that is connected to a Microsoft account
Get-LocalUser -Name "MicrosoftAccount\username@Outlook.com"IdentifyGet an account that has the specified SID
Get-LocalUser -SID S-1-5-21-9526073513-1762370368-3942940353-500IdentifyIts page in the reference: Get-LocalUser.
Parameters
-NameSpecifies an array of names of user accounts that this cmdlet gets. You can use the wildcard character.-SIDSpecifies an array of security IDs (SIDs) of user accounts that this cmdlet gets.