Set Recovery Mode on a target database
swinghouse
Posts: 120 Bronze 2
Is it possible to set Recovery Mode on a database being deployed by Deployment Manager? Perhaps with a PowerShell script?
I would like to be able to automatically set our test databases in Simple Recovery Mode.
I would like to be able to automatically set our test databases in Simple Recovery Mode.
Comments
I'll take a very quick look at the powershell forum to see if there's anything already there.
https://community.rackspace.com/products/f/18/t/1630
Got a modified version of that sample from https://community.rackspace.com/products/f/18/t/1630 working in the PostDeploy.ps1 script of a Deployment Manager project.
I didn't get the script to work with string representations of the RecoveryModel options, but had to use the enum representation like so:
And to apply SQL Server Authentication I had to add:
after instantiating the $smo object.
Thanks for the help!