November 5, 2011

Subscribe

Script Database Objects with Powershell

by Scott Newman

Here’s a quick script to script out all database objects using powershell. This was adapted (heavily) from the Hey Scripting Guy! blog script here. This also stores the password credential in a file on the server. You’ll need to generate the file before running the script. Remember to generate the file under the account that will be executing the script, as the contents of the file will be encrypted using the account that generated it. Use this script to create the file: