plugins/hosts/windows/scripts/check_credentials.ps1 in vagrant-unbundled-2.2.16.0 vs plugins/hosts/windows/scripts/check_credentials.ps1 in vagrant-unbundled-2.2.18.0
- old
+ new
@@ -9,11 +9,26 @@
$DSContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext(
[System.DirectoryServices.AccountManagement.ContextType]::Machine,
$env:COMPUTERNAME
)
+if ( $DSContext.ValidateCredentials( $username, $password ) ) {
+ exit 0
+}
+$DSContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext(
+ [System.DirectoryServices.AccountManagement.ContextType]::Domain,
+ $env:COMPUTERNAME
+)
if ( $DSContext.ValidateCredentials( $username, $password ) ) {
exit 0
-} else {
- exit 1
-}
\ No newline at end of file
+}
+
+$DSContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext(
+ [System.DirectoryServices.AccountManagement.ContextType]::ApplicationDirectory,
+ $env:COMPUTERNAME
+)
+if ( $DSContext.ValidateCredentials( $username, $password ) ) {
+ exit 0
+}
+
+exit 1