commands

^

Disable-DbaFilestream

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

 

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

Synopsis

Sets the status of FileStream on specified SQL Server instances both at the server level and the instance level

Description

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

Syntax

Disable-DbaFilestream
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Credential] <PSCredential>]
    [-Force]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Disable-DbaFilestream -SqlInstance server1\instance2

Prompts for confirmation. Disables filestream on the service and instance levels.

Example: 2
PS C:\> Disable-DbaFilestream -SqlInstance server1\instance2 -Confirm:$false

Does not prompt for confirmation. Disables filestream on the service and instance levels.

Example: 3
PS C:\> Get-DbaFilestream -SqlInstance server1\instance2, server5\instance5, prod\hr | Where-Object InstanceAccessLevel -gt 0 | Disable-DbaFilestream -Force

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

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
-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