mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-02-22 09:21:40 -05:00
19 lines
No EOL
483 B
PowerShell
19 lines
No EOL
483 B
PowerShell
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$username,
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$password
|
|
)
|
|
|
|
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
|
|
|
|
$DSContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext(
|
|
[System.DirectoryServices.AccountManagement.ContextType]::Machine,
|
|
$env:COMPUTERNAME
|
|
)
|
|
|
|
if ( $DSContext.ValidateCredentials( $username, $password ) ) {
|
|
exit 0
|
|
} else {
|
|
exit 1
|
|
} |