Random Password Function Powershell

To generate a random password for Active directory you can use this function Function Get-RandomPassword(){ Param ( [int]$length=5 ) $alphabet=$NULL;For ($a=65;$a –le 90;$a++) {$alphabet+=,[char][byte]$a } $ascii=$NULL;For ($a=33;$a –le 126;$a++) {$ascii+=,[char][byte]$a } For ($l=1; $l -le $length; $l++){ $tempPassword += ($alphabet | Get-Random) $tempPassword += ($ascii | Get-Random) } return $tempPassword }   Even though the […]