The Multifunctioning DBA:

SMO

1

January 15, 2012  8:00 AM

Connect-sql Function



Posted by: Colin Smith
Powershell, Scripting, SMO

This is a function that I keep in my profile so I can call it in any of my scripts that will run from my profile. It makes it easier for me so it might for you. function connect-sql ($arg) { if($arg -eq $null) { $server = Read-Host "enter instance name to connect to" } else { $server =...

October 19, 2011  1:16 PM

Powershell Disable db File Autogrow



Posted by: Colin Smith
autogrow, file managemnt, Powershell, SMO, SQL Server

In order to Disable autogrow on your database files it is a bit tricky. One would think that in SMO you would have an autogrow flag that could be turned on and off like there is in the GUI. Well this is not the case. So if you take my script fromĀ 


October 14, 2011  8:25 AM

Powershell Script to change data and log files that are growing by percent



Posted by: Colin Smith
Powershell, SMO, SQL Server

This is the next step after finding all the files that are growing by percent and not by a fixed value. Below is the modified script to make the changes that I needed.
#### Check Log and Data Growth for all User Databases. If they are not set up correctly then change...


December 7, 2010  9:14 PM

Setting Min and Max Memory settings in SQL with Powershell



Posted by: Colin Smith
DBA, memory, Powershell, SMO, SQL Server

So today I was thinking about some of the things that are currently not set up properly on some of my servers. I got to thinking that a lot of them were never set up properly for Min and Max Server memory. Most of them, that were installed before my time, are set up with the defaults and as you all...


December 3, 2010  9:07 PM

Powershell SMO database size property incorrect



Posted by: Colin Smith
Bug, CU, Powershell, SMO, SP1

Ran into an issue while writing a script to gather database properties via smo and one that I want is database size. I wrote the script and started testing it and my values were all wrong and the same for all databases in the instance. I did a few things trying to figure out what I was doing wrong...


1

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: