Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasayukiOzawa/06cac2e73b98b863ca7986bb067d5da8 to your computer and use it in GitHub Desktop.
Save MasayukiOzawa/06cac2e73b98b863ca7986bb067d5da8 to your computer and use it in GitHub Desktop.
$sqlinstancename = "MSSQL13.MSSQLSERVER"
$SQLBinPath = (Get-ItemProperty ([io.path]::combine("HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server", $sqlinstancename, "Setup"))).SQLBinRoot
$param = @{
ExclusionExtension = "mdf", "ldf", "ndf" , "bak", "trn"
ExclusionProcess = (Get-Item (Join-Path $SQLBinPath "sqlservr.exe"))
ExclusionPath = "C:\Windows\Cluster"
}
Set-MpPreference @param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment