SqlServerDsc icon indicating copy to clipboard operation
SqlServerDsc copied to clipboard

SqlSetup: Is it possible to configure FILESTREAM Feature via SqlServerDsc

Open dvdgutzmann opened this issue 8 years ago • 5 comments

As far as my googling goes it is possible to enable FILESTREAM feature in two ways:

Is it also possible to enable FILESTREAM via DSC? If not, what would be the proper way to submit a feature request?

Thank you!

dvdgutzmann avatar Aug 08 '16 14:08 dvdgutzmann

Yes take a look at xSQLServerConfiguration. Specifically look at this example --> https://github.com/PowerShell/xSQLServer/blob/dev/Examples/xSQLServerConfiguration.ps1 This gives you the ability to configure anything that is in sp_configure.

aultt avatar Aug 08 '16 14:08 aultt

Thank you for the quick response @aultt! I'm not sure though, if reconfiguring filestream_access_level would be enough to enable this feature.

Enable and Configure FILESTREAM states

Before you can start to use FILESTREAM, you must enable FILESTREAM on the instance of the SQL Server Database Engine.

In the meantime I found people doing it via WMI (C# VB). I would like to avoid going down that particular road.

I wonder if there is a possibility to achive enabling FILESTREAM on the instance solely by means of DSC. If not, wouldn't that be something for xSQLServerSetup ?

Thank you for your time!

dvdgutzmann avatar Aug 08 '16 19:08 dvdgutzmann

I realise just now, that the title of the issue might have been misleading. My question is about enabling filestream, not only about configuring it. Thank you.

dvdgutzmann avatar Aug 08 '16 19:08 dvdgutzmann

Sorry you are correct I was looking at configuring Filestream. To enable it there are a couple options as you pointed out. One at installation time which would require modification to xSQLServerSetup. Currently it doesn't have this capability. Since this can be done through WMI it could also be done via a DSC Script task. If you are looking to build new servers with this feature enabled I would suggest entering an issue requesting for the ability to be added to xSQLServerSetup

aultt avatar Aug 08 '16 19:08 aultt

JIC someone stumbles on this, below will enable, but it's just modifying the registry via computermanagementdsc. This is relevant to sql 2016 so change version appropriately.

Registry RegistrySqlEnableFilestream { Ensure = "Present" # You can also set Ensure to "Absent" Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQLServer\Filestream" ValueType = "Dword" ValueName = "EnableLevel" ValueData = "3" }

Edit, got sqlconfiguration to work by modifying the option name to remove underscores.

	SqlConfiguration SQLFilestreamAccess
    {

        InstanceName   = 'MSSQLSERVER'
        OptionName     = 'filestream access level'
        OptionValue    = 2
        RestartService = $false
		DependsOn  = '[SqlSetup]DefaultInstance'
    }

quillypowers avatar Aug 17 '20 20:08 quillypowers