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

Version Path
vagrant-unbundled-2.2.16.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.14.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.10.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.9.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.8.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.7.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.6.2 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.6.1 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.6.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.5.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.4.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.3.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.2.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.2.0.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.1.4.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-unbundled-2.1.2.0 plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/hosts/windows/scripts/check_credentials.ps1
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/hosts/windows/scripts/check_credentials.ps1