Get-LocalUser
Gets local user accounts.
구문
Default (기본값)
Get-LocalUser
[[-Name] <String[]>]
[<CommonParameters>]
SecurityIdentifier
Get-LocalUser
[[-SID] <SecurityIdentifier[]>]
[<CommonParameters>]
Description
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.
예제
Example 1: Get an account by using its name
This example gets a user account named AdminContoso02.
Get-LocalUser -Name "AdminContoso02"
Name Enabled Description
---- ------- -----------
AdminContoso02 True Description of this account.
Example 2: Get an account that is connected to a Microsoft account
This example gets a user account that is connected to a Microsoft account. This example uses a placeholder value for the username of an account at Outlook.com.
Get-LocalUser -Name "MicrosoftAccount\username@Outlook.com"
Name Enabled Description
---- ------- -----------
MicrosoftAccount\username@outlook.com True Description of this account.
Example 3: Get an account that has the specified SID
This example gets a local user account that has the specified SID.
Get-LocalUser -SID S-1-5-21-9526073513-1762370368-3942940353-500
Name Enabled Description
---- ------- -----------
Administrator True Built-in account for administering the computer/___domain
매개 변수
-Name
Specifies an array of names of user accounts that this cmdlet gets. You can use the wildcard character.
매개 변수 속성
형식: | String[] |
Default value: | None |
와일드카드 지원: | True |
DontShow: | False |
매개 변수 집합
Default
Position: | 0 |
필수: | False |
파이프라인의 값: | True |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-SID
Specifies an array of security IDs (SIDs) of user accounts that this cmdlet gets.
매개 변수 속성
형식: | |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
SecurityIdentifier
Position: | 0 |
필수: | False |
파이프라인의 값: | True |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
입력
String
You can pipe a string to this cmdlet.
SecurityIdentifier
You can pipe a SID to this cmdlet.
출력
System.Management.Automation.SecurityAccountsManager.LocalUser
This cmdlet returns local user accounts.
참고
Windows PowerShell includes the following aliases for Get-LocalUser
:
glu
The PrincipalSource property on LocalUser, LocalGroup, and LocalPrincipal objects describes the source of the object. The possible sources are as follows:
- Local
- Active Directory
- Microsoft Entra group
- Microsoft Account
PrincipalSource is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank.