SqlServerDsc
SqlServerDsc copied to clipboard
SqlSetup: Is it possible to configure FILESTREAM Feature via SqlServerDsc
As far as my googling goes it is possible to enable FILESTREAM feature in two ways:
- Install SQL Server 2016 from the Command Prompt/Config file/ SysPrep/ etc...
- Enable and Configure FILESTREAM by using SQL Server Configuration Manager
Is it also possible to enable FILESTREAM via DSC? If not, what would be the proper way to submit a feature request?
Thank you!
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.
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!
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.
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
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'
}