Sha256: e35788c8daa586c54f87c8e46f51ce48e12d05234dfc124eb73870c2c7318a42
Contents?: true
Size: 483 Bytes
Versions: 30
Compression:
Stored size: 483 Bytes
Contents
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 }
Version data entries
30 entries across 26 versions & 4 rubygems