Category Archives: Scripting

PowerShell Random Password Function

Generating a password with PowerShell is relatively easy if you leverage a particular method of .Net, System.Web.Security.Membership. Add-Type -AssemblyName System.Web[System.Web.Security.Membership]::GeneratePassword(8,2) Simple and to the point. But below is a pretty good function to do something similar, if you are curious about string operations with PowerShell. function Get-RandomPassword($length){    $length-=1    $lower = ‘abcdefghijklmnopqrstuvwxyz’    $upper = $lower.ToUpper()    $number = 0..9    $special=’~!@#$%^&*()_+|}{[]\’    $chars = “$lower$special$upper”.ToCharArray() $pass = Get-Random -InputObject… Read More »

8 Useful PowerShell Quickies

In my current position, I use PowerShell quite a bit, but not just for automation of repetitive tasks. I thought I would take a few minutes to jot down a few one-offs that might be of use to other folks. Some of these might even be useful in larger scripts.

Dumping from a Database, Revisited

Some time ago, a user named VB6Boy posted a handy little VBScript that dumps out records from a database table to a series of text files. The method works fine, but takes an exorbitant amount of time for large datasets. Can we do better? Another user commented on the post mentioned above, stating that he (or she) was using the script as… Read More »