---
title: "Enable-DbaFilestream"
description: "Configures FILESTREAM feature at both instance and server levels on SQL Server"
url: "https://dbatools.io/Enable-DbaFilestream/"
availability: "Windows only"
tags: ["Filestream"]
author: "Stuart Moore (@napalmgram) | Chrissy LeMaire (@cl)"
source: "https://github.com/dataplat/dbatools/blob/master/public/Enable-DbaFilestream.ps1"
last_updated: "2024-01-01"
---

# Enable-DbaFilestream

## Synopsis

Configures FILESTREAM feature at both instance and server levels on SQL Server

## Description

Configures SQL Server's FILESTREAM feature by setting the FilestreamAccessLevel at the instance level and enabling the Windows service component at the server level. The function supports three access levels: T-SQL only, T-SQL with I/O streaming, or T-SQL with I/O streaming and remote client access. FILESTREAM allows storing large binary data like documents, images, and videos directly on the file system while maintaining transactional consistency with the database. SQL Server requires a restart after enabling FILESTREAM, and the function will prompt for confirmation unless the -Force parameter is used.

## Syntax

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

```

## Examples

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

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

### Example 2: Using this pipeline you can scan a range of SQL instances and enable filestream on only those on which it&#39;s...

```powershell
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.

| Property | Value |
| --- | --- |
| 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.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | true (ByPropertyName) |
| Default Value |  |

##### -Credential

Login to the target server using alternative credentials.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | true (ByPropertyName) |
| Default Value |  |

##### -FileStreamLevel

Specifies the access level for FILESTREAM functionality on the SQL Server instance. Controls how applications can access FILESTREAM data stored on the file system.  
Use level 1 (TSql) for basic database operations, level 2 (TSqlIoStreaming) when applications need direct file system access, or level 3 (TSqlIoStreamingRemoteClient) for remote client access   
scenarios.  
Accepts numeric values (1, 2, 3) or string equivalents (TSql, TSqlIoStreaming, TSqlIoStreamingRemoteClient). Defaults to level 1.

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

##### -ShareName

Specifies the Windows file share name used by remote clients to access FILESTREAM data over the network. Only applies when FileStreamLevel is set to 2 or 3.  
Use this when you need to customize the share name for organizational standards or security requirements. If not specified, SQL Server uses the default instance name as the share name.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -Force

Automatically restarts the SQL Server service after enabling FILESTREAM without prompting for confirmation. Required for FILESTREAM changes to take effect immediately.  
Use with caution in production environments as it will cause brief service interruption. Without this parameter, you must manually restart SQL Server for changes to apply.

| Property | Value |
| --- | --- |
| 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.

| Property | Value |
| --- | --- |
| 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.

| Property | Value |
| --- | --- |
| Alias | wi |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -Confirm

Prompts you for confirmation before running the command.

| Property | Value |
| --- | --- |
| Alias | cf |
| Required | False |
| Pipeline | false |
| Default Value |  |

## Outputs

**PSCustomObject**

Returns one object per SQL Server instance with the current FILESTREAM configuration status after the configuration change is applied (or would be applied with -WhatIf).

**Default display properties (via Select-DefaultView):**

- ComputerName: The name of the computer hosting the SQL Server instance
- InstanceName: The SQL Server instance name
- SqlInstance: The full SQL Server instance identifier (ComputerName\InstanceName)
- InstanceAccess: Human-readable description of the instance-level FILESTREAM access level (Disabled, T-SQL access enabled, or Full access enabled)
- ServiceAccess: Human-readable description of the service-level FILESTREAM access level (Disabled, FileStream enabled for T-SQL access, FileStream enabled for T-SQL and IO streaming access, or
FileStream enabled for T-SQL, IO streaming, and remote clients)

- ServiceShareName: The Windows file share name used for FILESTREAM remote client access, if configured

**Additional properties available (not displayed by default):**

- InstanceAccessLevel: Numeric value representing instance-level access (0 = Disabled, 1 = T-SQL access enabled, 2 = Full access enabled)
- ServiceAccessLevel: Numeric value representing service-level access (0 = Disabled, 1 = T-SQL only, 2 = T-SQL and IO streaming, 3 = T-SQL, IO streaming, and remote clients)
- SqlCredential: The SQL Server credentials used for the connection
- Credential: The Windows credentials used for the connection
All properties are accessible via Select-Object * if needed beyond the default display.

---

Part of [dbatools](https://dbatools.io/), a free and open source PowerShell module for SQL Server administration. Full command index: https://dbatools.io/commands/
