Generating Random Passwords

by May 24, 2017

Here is a very simple way to create complex random passwords:

Add-Type -AssemblyName System.Web
$PasswordLength = 12
$SpecialCharCount = 3
[System.Web.Security.Membership]::GeneratePassword($PasswordLength, $SpecialCharCount)

The API call lets you choose the length of the password, and the number of non-alphanumeric characters it contains.

Twitter This Tip! ReTweet this Tip!