diff --git a/CheckADPassword.exe b/CheckADPassword.exe new file mode 100644 index 0000000..9fd1f7a Binary files /dev/null and b/CheckADPassword.exe differ diff --git a/CheckADPassword.ps1 b/CheckADPassword.ps1 new file mode 100644 index 0000000..feeb9cb --- /dev/null +++ b/CheckADPassword.ps1 @@ -0,0 +1,22 @@ +While(0 -lt 1) + { + Function Test-ADAuthentication { + param($username,$password) + (new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null + } + Write-Host -ForegroundColor Yellow "...::: Outil de vérification de mot de passe Active Directory :::..." + $login = Read-Host "Quel est l'identifiant de la session ?" + $password = Read-Host "Quel est le mot de passe de la session ?"-AsSecureString + + $password = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password) + $password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($password) + + $result = Test-ADAuthentication "$login" "$password" + + If($result -eq "True") + { + Write-Host -ForegroundColor Green "Le mot de passe AD est correct !" + }else{ + Write-Host -ForegroundColor Red "Le mot de passe AD est incorrect." + } +} diff --git a/README.md b/README.md index 4f095e7..898f3de 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # CheckADPassword - +PowerShell tool to check AD password