< Back
Enable-DbaFilestream
Post
NAME Enable-DbaFilestream
SYNOPSIS
Enables FileStream on specified SQL Server instances
SYNTAX
Enable-DbaFilestream [-SqlInstance] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]> [[-SqlCredential]
<Pscredential>] [[-Credential] <Pscredential>] [[-FileStreamLevel] <String>] [[-ShareName] <String>] [-Force
<Switch>] [-EnableException <Switch>] [<CommonParameters>]
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
PARAMETERS
-Credential [<Pscredential>]
Login to the target server using alternative credentials.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-EnableException [<Switch>]
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.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-FileStreamLevel [<String>]
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
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Force [<Switch>]
Restart SQL Instance after changes. Use this parameter with care as it overrides whatif.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-ShareName [<String>]
Specifies the Windows file share name to be used for storing the FILESTREAM data.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-SqlCredential [<Pscredential>]
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.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-SqlInstance [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]
The target SQL Server instance or instances. Defaults to localhost.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Tags: Filestream
Author: Stuart Moore ( @napalmgram ) | Chrissy LeMaire ( @cl )
Website: https://dbatools.io
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT https://opensource.org/licenses/MIT
-------------------------- 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.
RELATED LINKS
SYNOPSIS
Enables FileStream on specified SQL Server instances
SYNTAX
Enable-DbaFilestream [-SqlInstance] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]> [[-SqlCredential]
<Pscredential>] [[-Credential] <Pscredential>] [[-FileStreamLevel] <String>] [[-ShareName] <String>] [-Force
<Switch>] [-EnableException <Switch>] [<CommonParameters>]
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
PARAMETERS
-Credential [<Pscredential>]
Login to the target server using alternative credentials.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-EnableException [<Switch>]
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.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-FileStreamLevel [<String>]
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
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Force [<Switch>]
Restart SQL Instance after changes. Use this parameter with care as it overrides whatif.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-ShareName [<String>]
Specifies the Windows file share name to be used for storing the FILESTREAM data.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-SqlCredential [<Pscredential>]
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.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-SqlInstance [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]
The target SQL Server instance or instances. Defaults to localhost.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
Tags: Filestream
Author: Stuart Moore ( @napalmgram ) | Chrissy LeMaire ( @cl )
Website: https://dbatools.io
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT https://opensource.org/licenses/MIT
-------------------------- 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.
RELATED LINKS