Create a Strong Random Password with VBScript

I had been using a simple script to create an alpha numeric password that was all lower case for quite some time. Recently though I decided to give the old password creation function an overhaul since the old password creation function was very weak.

This new function will create a new string that is alpha numeric, upper and lower case letters, and also valid type-able characters. I decided to filter out the quotation mark (“) because it can often time cause issues when you have to pass the password within scripts. It is replaced by the single quote when it happens to show up.

The really nice thing about this function is that you can create strings of variable length. So if you need a normal windows password you can pass a string of 15 characters. But if for some reason you need to create a string that is much longer, you can easily do that by just changing the value you pass to the function.

This particular function is a lifesaver when you use it to create user accounts with something like these functions I posted about earlier.

 

Leave a Comment