Migration

This commit is contained in:
Alexandre MOTTIER 2024-10-14 14:20:38 +02:00
parent 2814e4ff1f
commit e6ec04b434
3 changed files with 23 additions and 1 deletions

BIN
CheckADPassword.exe Normal file

Binary file not shown.

22
CheckADPassword.ps1 Normal file
View File

@ -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."
}
}

View File

@ -1,2 +1,2 @@
# CheckADPassword # CheckADPassword
PowerShell tool to check AD password