Enabling FileStream

This recipe explains how to enable FileStream in SQL Server.

How to do it...

Let's take a look at the steps to enable FileStream in SQL Server:

  1. Open PowerShell ISE as an administrator.
  2. Import the SQLPS module as follows:
    #import SQL Server module
    Import-Module SQLPS -DisableNameChecking
  3. Add the following script and run it:
    $instanceName = "localhost" $server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName <# These are the FileStreamLevel Enumeration values: Disabled TSqlAccess TSqlFullFileSystemAccess TSqlLocalFileSystemAccess #> #enable $server.Configuration.FilestreamAccessLevel.ConfigValue = [Microsoft.SqlServer.Management.Smo.FileStreamLevel]::TSqlLocalFileSystemAccess $server.Alter() ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.