Generating Passwords with Powershell

I’m generating passwords a lot these days and some customers hate complex passwords based on some random Letters, Numbers, Specials and an uppercase Letter here and there.

So why not generate a password based on a random word picked from an input file and add (or not) some fancy “complex” Special characters, numbers and/or uppercases.

This function uses four different input files to generate the passwords (two for each language). The _5 and _6 represent the length of the words (five or six letter words)

  • en_wordlist_5.txt
  • en_wordlist_6.txt
  • nl_wordlist_5.txt
  • nl_wordlist_6.txt

With the parameters -UseSpecials, -UseDigits, -RandomUppercase and -FirstUppercase you can make te output more complex if you like.

Examples:

The Generate-Password.ps1 available at the end of this blog also contains the function I use to create a complex passwords. This function is created by my colleague Arjan Mensch (https://msfreaks.wordpress.com/).

With these functions you can create one or more passwords to use in your own scripts.

Create 10 passwords for example:

Download my functions here : Generate Passwords.zip, this zip includes the random word lists in both dutch and english for five and six letter words.

Happy scripting.

Leave a Reply

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

captcha

Please enter the CAPTCHA text

This site uses Akismet to reduce spam. Learn how your comment data is processed.