Skip to content

May 13, 2013

Set PageVerify in Sql Server via Powershell

by Scott Newman

Quick post on how to set the page verification level in sql server with powershell.  This script will set all the user database page verification option to CheckSum if they’re not already set that way.  It’s best practice (and the safest option) to have this set to CheckSum.  For a more in-depth description of page verification, see here.  This uses SQLPSX.

Import-Module SqlServer

Get-SqlDatabase -sqlserver $(Get-SqlServer -sqlserver 'ServerName' -username 'UserName' -password 'Password') | where{-not $_.IsSystemObject} |%{
	if($_.PageVerify -ne [Microsoft.SqlServer.Management.Smo.PageVerify]::Checksum){
		$_.PageVerify = [Microsoft.SqlServer.Management.Smo.PageVerify]::Checksum
Read more from Powershell, SQL Server

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: