PowerShell Script to Auto generate Random Simple String Passwords

image

Script:

cls

$Private:OFS = ""

$PasswordLength = 8

$InclChars = ‘abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ123456789’

$RandomNums = 1..$PasswordLength | ForEach-Object { Get-Random -Maximum $InclChars.length }

$RandomPassowrd = [String]$InclChars[$RandomNums]

Write-Host $RandomPassowrd

 

 

Output:

cAbfE1GN

Ea5kMabu

spx3sFW7

 

 

Script:

2 thoughts on “PowerShell Script to Auto generate Random Simple String Passwords

  1. This is great, I modified it a little to generate random large strings of characters for sending large test emails in my virtual environment. Just what I was looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *