Skip to content

Instantly share code, notes, and snippets.

@Arefu
Created October 30, 2019 02:32
Show Gist options
  • Save Arefu/19e567870367452ad533af7178ed4b54 to your computer and use it in GitHub Desktop.
Save Arefu/19e567870367452ad533af7178ed4b54 to your computer and use it in GitHub Desktop.
Set Exam Account Passwords
[INT]$Count = Read-Host -Prompt "How Many Passwords?"
[INT]$Token = 1
[STRING]$Url = "https://www.dinopass.com/password/simple"
do
{
$Password = (Get-Culture).TextInfo.ToTitleCase((Invoke-WebRequest -UseBasicParsing -Uri $Url).Content)
#$Password = ConvertTo-SecureString $Password -AsPlainText -Force
Set-ADAccountPassword -Reset -NewPassword $(ConvertTo-SecureString $($Password) -AsPlainText -Force) -Identity $("Exam"+$Token)
Write-Host "Exam$Token - $Password"
$Token++
} while($Token -le $Count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment