Created
March 14, 2022 09:07
-
-
Save mardahl/32aa727fd1025a8e170c4b39b3a2a62f to your computer and use it in GitHub Desktop.
Generate random bitlocker recovery keys
This file contains hidden or 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
#Generates 100 random bitlocker recovery key ID and keys | |
#By Michael Mardahl github.com/mardahl | |
#Use it for whatever... | |
$hash = @{} | |
for($i = 0;$i -lt 100;$i++) { | |
$id = "$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})-$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})$(Get-Random -minimum 100 -maximum 999)$((97..102) | Get-Random -Count 1 | % {[char]$_})$((97..102) | Get-Random -Count 1 | % {[char]$_})$(Get-Random -minimum 10 -maximum 99)$((97..102) | Get-Random -Count 1 | % {[char]$_})" | |
$key = "$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)-$(Get-Random -minimum 100000 -maximum 999999)" | |
$hash[$id]=$key | |
} | |
#output | |
$hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment