Test Local User Account Credentials
Verifying a Local User Account Here is a snippet that verifies a local user account. Simply submit a username and a password. You get back...
- Written By: powershelltips
- Last Updated: April 22, 2025
- 1 minute read
Verifying a Local User Account Here is a snippet that verifies a local user account. Simply submit a username and a password. You get back...
Here is a snippet that verifies a local user account. Simply submit a username and a password. You get back either $true or $false:
$username = 'Administrator' $password = 'P@ssw0rd' $computer = $env:COMPUTERNAME Add-Type -AssemblyName System.DirectoryServices.AccountManagement $obj = New-Object System.DirectoryServices.AccountManagement.PrincipalContext('machine', $computer) $obj.ValidateCredentials($username, $password)
Contact our sales team to get a personalized demo of our database management software for SQL Server!