Hi @Trần Ngọc Nam ,
you can use the cmdlet Get-LocalUser
to get the details of a local user: Get-LocalUser
# Result is $true or $false depending if the account is enabled or disabled
(Get-LocalUser -Name "Administrator").Enabled
If (((Get-LocalUser -Name "Administrator").Enabled) -eq $true){
Write-Output "Account enabled"
} else {Write-Output "Account disabled"}
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards Andreas Baumgarten