commands

^

Enable-DbaFilestream

Author Stuart Moore ( @napalmgram ) , Chrissy LeMaire ( @cl )
Availability Windows only

 

Synopsis

Enables FileStream on specified SQL Server instances

Description

Connects to the specified SQL Server instances, and Enables the FileStream feature to the required value

To perform the action, the SQL Server instance must be restarted. By default we will prompt for confirmation for this action, this can be overridden with the -Force switch

Syntax

Enable-DbaFilestream
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Credential] <PSCredential>]
    [[-FileStreamLevel] <String>]
    [[-ShareName] <String>]
    [-Force]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Enable-DbaFilestream -SqlInstance server1\instance2 -FileStreamLevel TSql
PS C:\> Enable-DbaFilestream -SqlInstance server1\instance2 -FileStreamLevel 1

These commands are functionally equivalent, both will set Filestream level on server1\instance2 to T-Sql Only

Example: 2
PS C:\> Get-DbaFilestream -SqlInstance server1\instance2, server5\instance5, prod\hr | Where-Object InstanceAccessLevel -eq 0 | Enable-DbaFilestream -FileStreamLevel TSqlIoStreamingRemoteClient -Force

Using this pipeline you can scan a range of SQL instances and enable filestream on only those on which it's disabled.

Required Parameters

-SqlInstance

The target SQL Server instance or instances. Defaults to localhost.

Alias
Required True
Pipeline true (ByPropertyName)
Default Value

Optional Parameters

-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential). Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported. For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline true (ByPropertyName)
Default Value
-Credential

Login to the target server using alternative credentials.

Alias
Required False
Pipeline true (ByPropertyName)
Default Value
-FileStreamLevel

The level to of FileStream to be enabled: 1 or TSql - T-Sql Access Only 2 or TSqlIoStreaming - T-Sql and Win32 access enabled 3 or TSqlIoStreamingRemoteClient T-Sql, Win32 and Remote access enabled

Alias
Required False
Pipeline false
Default Value 1
Accepted Values TSql,TSqlIoStreaming,TSqlIoStreamingRemoteClient,1,2,3
-ShareName

Specifies the Windows file share name to be used for storing the FILESTREAM data.

Alias
Required False
Pipeline false
Default Value
-Force

Restart SQL Instance after changes. Use this parameter with care as it overrides whatif.

Alias
Required False
Pipeline false
Default Value False
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False
-WhatIf

Shows what would happen if the command runs. The command is not run unless Force is specified.

Alias wi
Required False
Pipeline false
Default Value
-Confirm

Prompts you for confirmation before running the command.

Alias cf
Required False
Pipeline false
Default Value

 

Want to see the source code for this command? Check out Enable-DbaFilestream on GitHub.
Want to see the Bill Of Health for this command? Check out Enable-DbaFilestream.