The Multifunctioning DBA

Oct 19 2011   1:16PM GMT

Powershell Disable db File Autogrow

Colin Smith Colin Smith Profile: Colin Smith

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
and make a little bit of a change then the autogrow will be turned off.
Just set the Growth to 0 and most important is to change the growthtype to none:
$file.growth = 0
$file.growthtype = “none”
That is it and then when you look in the GUI autogrow will be off.

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

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:

Share this item with your network: