Monday, September 23, 2019

Powershell: Generating random password

Here's method for generating random password by using Powershell.

# Add the System.Web assembly
PS C:\Users\drago> Add-Type -AssemblyName System.Web # Let's get random password by following method
# First parameter is length for the password, and second is the number of non-alphabetical characters.
PS C:\Users\drago> [System.Web.Security.Membership]::GeneratePassword(10,4)
.Ra45;)WQ}

No comments:

Post a Comment