dsccommunity / dsccommunity/SqlServerDsc
SqlSecureConnection: Should support the property HideInstance
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 385
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
The HideInstance is not supported in any resource yet, suggest adding it to either SqlServerSecureConnection or a another more suitable resource.
HideInstance is a property in the DB instances network properties and found via SQL Server Configuration Manager, see sample code:
## apply surface area configuration control 2.12
$WmiObject = @{
ComputerName = $SQLServer.NetName
Namespace = "root\Microsoft\SqlServer\ComputerManagement$($SQLServer.VersionMajor)"
Class = "ServerSettingsGeneralFlag"
Filter = "FlagName = 'HideInstance'"
}
$HideInstance = Get-WmiObject @WmiObject
if ($HideInstance.FlagValue -eq $false) {
Write-Verbose "Setting HideInstance to True."
$HideInstance.SetValue($true) | Out-Null
Write-Verbose "HideInstance set to True"
}
## apply surface area configuration control 8.2
$WmiObject = @{
ComputerName = $SQLServer.NetName
Namespace = "root\Microsoft\SqlServer\ComputerManagement$($SQLServer.VersionMajor)"
Class = "ServerSettingsGeneralFlag"
Filter = "FlagName = 'ForceEncryption'"
}
$ForceEncryption = Get-WmiObject @WmiObject
if ($ForceEncryption.FlagValue -eq $false) {
Write-Verbose "Setting ForceEncryption to True."
$ForceEncryption.SetValue($true) | Out-Null
Write-Verbose "ForceEncryption set to True"
}
Note $SQLServer is the SMO object
However this would only be half a solution as some client may wish to apply the certificate with this option.
Originally posted by @SQLHorizons in https://github.com/dsccommunity/SqlServerDsc/issues/1161#issuecomment-423769834
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the SqlServerSecureConnection resource and the other resources that configure SQL Server network properties. Use the supplied ServerSettingsGeneralFlag example for HideInstance and compare it with existing ForceEncryption handling. Done means HideInstance is supported in a suitable resource, with the certificate interaction addressed or clearly scoped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100