diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c76e642e..f85f4ef8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- SPWebApplication + - Fixed an issue where the Set method tried to use the Parameter SecureSocketsLayer with Set-SPWebApplication on SharePoint Server older than Subscription Edition. + ## [5.1.0] - 2022-02-24 ### Added diff --git a/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 b/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 index 3acd52cd3..de71eab9f 100644 --- a/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 @@ -618,10 +618,6 @@ function Set-TargetResource { $updateWebAppParams.Add("AllowLegacyEncryption", $params.AllowLegacyEncryption) } - if ((New-Object -TypeName System.Uri $params.WebAppUrl).Scheme -eq "https") - { - $updateWebAppParams.Add("SecureSocketsLayer", $true) - } $productVersion = Get-SPDscInstalledProductVersion if ($productVersion.FileMajorPart -eq 16 -and ` @@ -636,6 +632,11 @@ function Set-TargetResource { $updateWebAppParams.Add("Port", $params.Port) } + + if ((New-Object -TypeName System.Uri $params.WebAppUrl).Scheme -eq "https") + { + $updateWebAppParams.Add("SecureSocketsLayer", $true) + } } Write-Verbose -Message "Updating web application with these parameters: $(Convert-SPDscHashtableToString -Hashtable $updateWebAppParams)"