Gets local users.
Get-User [[-UserName] <String>] [<CommonParameters>]
Get-User gets all local users. Use the UserName parameter to get a specific user by its username.
The objects returned by Get-User are instances of System.DirectoryServices.AccountManagement.UserPrincipal. These objects use external resources, which, if they are disposed of correctly, will cause memory leaks. When you're done using the objects returne by Get-User, call Dispose() on each one to clean up its external resources.
Get-User is new in Carbon 2.0.
| Name | Type | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|---|
| UserName | String | The username for the user. |
false | false |
Get-User
Demonstrates how to get all local users.
Get-User -Username LSkywalker
Demonstrates how to get a specific user.