dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Connects to the specified SQL Server instances, and sets the status of 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.




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

Set-DbaFileStream -SqlInstance server1\instance2 -FileStreamLevel T-Sql Only
Set-DbaFileStream -SqlInstance server1\instance2 -FileStreamLevel 1

Using this pipeline you can scan a range of SQL instances and disable filestream on only those on which it’s enabled.

Get-DbaFileStream -SqlInstance server1\instance2, server5\instance5 , prod\hr | Where-Object {$_.FileSteamStateID -gt 0} | Set-DbaFileStream -FileStreamLevel 0 -Force


This command was created by Stuart Moore. You can find Stuart on Twitter and his blog.


From PowerShell, execute Get-Help Set-DbaFileStream -Detailed for more information on this function.

Source Code

Want to see the source code? View Set-DbaFileStream.ps1 on GitHub

Related commands