From 2e8a6a8f1d723dabbd2c1220773b5ac0c6d83443 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 11 Jun 2021 11:39:51 +0200 Subject: [PATCH 1/5] Fixing issue #1317 --- CHANGELOG.md | 5 +++++ .../MSFT_SPContentDatabase/MSFT_SPContentDatabase.psm1 | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a09134305..b941924dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- SPContentDatabase + - Fixed issue where WebAppUrl in the Desired State would could the test to fail, always resulting + in False. - SPInstallLanguagePack - Fixed detection of Norwegian language pack @@ -36,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added ability to configure generic authentication settings per zone, like allow anonymous authentication or a custom signin page +### Fixed + - SharePointDsc - Fixed code coverage in pipeline - SPConfigWizard diff --git a/SharePointDsc/DSCResources/MSFT_SPContentDatabase/MSFT_SPContentDatabase.psm1 b/SharePointDsc/DSCResources/MSFT_SPContentDatabase/MSFT_SPContentDatabase.psm1 index 2f7370015..9b13cb8d3 100644 --- a/SharePointDsc/DSCResources/MSFT_SPContentDatabase/MSFT_SPContentDatabase.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPContentDatabase/MSFT_SPContentDatabase.psm1 @@ -433,6 +433,7 @@ function Test-TargetResource Write-Verbose -Message "Testing content database configuration settings" $PSBoundParameters.Ensure = $Ensure + $PSBoundParameters.WebAppUrl = $WebAppUrl.TrimEnd("/") $CurrentValues = Get-TargetResource @PSBoundParameters From e5117525b3ad63cc2fa36bde1dea701d1a18afb3 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Thu, 17 Jun 2021 17:09:01 +0200 Subject: [PATCH 2/5] Fixed #1326 --- CHANGELOG.md | 7 +++++++ .../MSFT_SPManagedMetaDataServiceApp.psm1 | 2 +- SharePointDsc/DSCResources/MSFT_SPService/readme.md | 2 +- .../MSFT_SPWebAppAuthentication.schema.mof | 8 ++++---- .../MSFT_SPWebAppClientCallableSettings.schema.mof | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b941924dc..53e8f1c83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SPFarm - Added parameter SkipRegisterAsDistributedCacheHost +- SPWebAppAuthentication + - Updated the description for the new zone setting parameters +- SPWebAppClientCallableSettings + - Updated the description for the proxy library settings parameters ### Fixed @@ -17,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 in False. - SPInstallLanguagePack - Fixed detection of Norwegian language pack +- SPManagedMetaDataServiceApp + - Fix issue where a missing Service App Proxy was not detected correctly and therefore not + created, resulting in other errors. ## [4.7.0] - 2021-06-10 diff --git a/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 b/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 index 606b6b672..03fa1e024 100644 --- a/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 @@ -348,7 +348,7 @@ function Set-TargetResource $result = Get-TargetResource @PSBoundParameters $pName = "$Name Proxy" - if ($null -ne $result.ProxyName) + if ([String]::IsNullOrEmpty($result.ProxyName)) { $pName = $result.ProxyName } diff --git a/SharePointDsc/DSCResources/MSFT_SPService/readme.md b/SharePointDsc/DSCResources/MSFT_SPService/readme.md index 74d3312f6..70fe3b577 100644 --- a/SharePointDsc/DSCResources/MSFT_SPService/readme.md +++ b/SharePointDsc/DSCResources/MSFT_SPService/readme.md @@ -1,6 +1,6 @@ # Description -**Type:** Specific +**Type:** Distributed **Requires CredSSP:** No This resource is used to specify if a specific service should be provisioned diff --git a/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/MSFT_SPWebAppAuthentication.schema.mof b/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/MSFT_SPWebAppAuthentication.schema.mof index cbc888051..c27762d54 100644 --- a/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/MSFT_SPWebAppAuthentication.schema.mof +++ b/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/MSFT_SPWebAppAuthentication.schema.mof @@ -11,10 +11,10 @@ Class MSFT_SPWebAppAuthenticationMode [ClassVersion("1.0.0.0")] Class MSFT_SPWebAppZoneSettings { - [Write, Description("Use Basic Authentication (only for Windows Authentication)")] Boolean AnonymousAuthentication; - [Write, Description("Specifies the used authentication method")] String CustomSignInPage; - [Write, Description("Use Basic Authentication (only for Windows Authentication)")] Boolean EnableClientIntegration; - [Write, Description("Use Basic Authentication (only for Windows Authentication)")] Boolean RequireUseRemoteInterfaces; + [Write, Description("Use Anonymous Authentication for the zone")] Boolean AnonymousAuthentication; + [Write, Description("Specifies the URL to the custom signin page for the zone")] String CustomSignInPage; + [Write, Description("Enable the Client Integration features for the zone")] Boolean EnableClientIntegration; + [Write, Description("Enable the Require Use Remote Interfaces for the zone")] Boolean RequireUseRemoteInterfaces; }; [ClassVersion("1.0.0.0"), FriendlyName("SPWebAppAuthentication")] class MSFT_SPWebAppAuthentication : OMI_BaseResource diff --git a/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof b/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof index c0883304e..42a66e0b5 100644 --- a/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof +++ b/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof @@ -1,8 +1,8 @@ [ClassVersion("1.0.0.0")] Class MSFT_SPProxyLibraryEntry { - [Required, Description("Name of the account")] String AssemblyName; - [Write, Description("Permission level of the account")] Boolean SupportAppAuthentication; + [Required, Description("Name of the assembly to be configured")] String AssemblyName; + [Write, Description("Specify if App Authentication should be supported")] Boolean SupportAppAuthentication; }; [ClassVersion("1.0.0"), FriendlyName("SPWebAppClientCallableSettings")] class MSFT_SPWebAppClientCallableSettings : OMI_BaseResource From 5e9635dd362f3bff08f14385c275e44af4255f17 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Tue, 22 Jun 2021 15:40:31 +0200 Subject: [PATCH 3/5] Fixing #1322 --- CHANGELOG.md | 3 +++ .../MSFT_SPSearchTopology.psm1 | 27 +++---------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53e8f1c83..aec3165e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SPManagedMetaDataServiceApp - Fix issue where a missing Service App Proxy was not detected correctly and therefore not created, resulting in other errors. +- SPSearchTopology + - Fixed issue where an error was thrown if the specified RootDirectory didn't exist on the + current server but did exist on the target server. ## [4.7.0] - 2021-06-10 diff --git a/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 b/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 index 5aa3b4d0a..68337c3bf 100644 --- a/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 @@ -443,29 +443,10 @@ function Set-TargetResource "IndexComponent" { Write-Verbose -Message "Adding $ComponentToAdd to run an IndexComponent" - $installedVersion = Get-SPDscInstalledProductVersion - if ($installedVersion.FileMajorPart -eq 15) - { - Write-Verbose -Message "Using SharePoint 2013" - $indexServer = (Get-SPServer $ComponentToAdd).Name - $indexComponent = (New-Object Microsoft.Office.Server.Search.Administration.Topology.IndexComponent $indexServer, 0); - $indexComponent.RootDirectory = $params.FirstPartitionDirectory - $newTopology.AddComponent($indexComponent) - } - else - { - Write-Verbose -Message "Using SharePoint 2016 or later" - $NewComponentParams.Add("IndexPartition", 0) - if ($params.ContainsKey("FirstPartitionDirectory") -eq $true) - { - if ([string]::IsNullOrEmpty($params.FirstPartitionDirectory) -eq $false) - { - $dir = $params.FirstPartitionDirectory - $NewComponentParams.Add("RootDirectory", $dir) - } - } - $null = New-SPEnterpriseSearchIndexComponent @NewComponentParams - } + $indexServer = (Get-SPServer $ComponentToAdd).Name + $indexComponent = (New-Object Microsoft.Office.Server.Search.Administration.Topology.IndexComponent $indexServer, 0); + $indexComponent.RootDirectory = $params.FirstPartitionDirectory + $newTopology.AddComponent($indexComponent) } } } From 7936d42cc86e69ae8d72a00dcd7c2ea63bcb1e2d Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Tue, 29 Jun 2021 08:56:53 +0200 Subject: [PATCH 4/5] Fixing #1031 --- CHANGELOG.md | 1 + .../MSFT_SPSearchTopology.psm1 | 47 +++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aec3165e1..2c2703fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SPSearchTopology - Fixed issue where an error was thrown if the specified RootDirectory didn't exist on the current server but did exist on the target server. + - Fixed issue with using FQDNs instead of NetBIOS server names. ## [4.7.0] - 2021-06-10 diff --git a/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 b/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 index 68337c3bf..d2029eb63 100644 --- a/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPSearchTopology/MSFT_SPSearchTopology.psm1 @@ -382,6 +382,8 @@ function Set-TargetResource IndexPartition = "IndexComponent" } + $domain = "." + (Get-CimInstance -ClassName Win32_ComputerSystem).Domain + # Build up the topology changes for each object type @("Admin", "Crawler", @@ -400,18 +402,43 @@ function Set-TargetResource else { $ComponentsToAdd = $params.$CurrentSearchProperty | Where-Object -FilterScript { - $CurrentValues.$CurrentSearchProperty -contains $_ -eq $false + ($CurrentValues.$CurrentSearchProperty -contains $_ -eq $false) -and ` + ($CurrentValues.$CurrentSearchProperty -contains ($_ -replace $domain) -eq $false) } $ComponentsToRemove = $CurrentValues.$CurrentSearchProperty | Where-Object -FilterScript { - $params.$CurrentSearchProperty -contains $_ -eq $false + ($params.$CurrentSearchProperty -contains $_ -eq $false) -and ` + ($params.$CurrentSearchProperty -contains ($_ + $domain) -eq $false) } } + foreach ($ComponentToAdd in $ComponentsToAdd) { + Write-Verbose -Message "Processing Search Topology roles for '$ComponentToAdd'" + + # FIND SERVICE INSTANCE + if ($AllSearchServiceInstances.ContainsKey($ComponentToAdd)) + { + $serviceInstance = $AllSearchServiceInstances.$ComponentToAdd + } + elseif ($AllSearchServiceInstances.ContainsKey($ComponentToAdd + $domain)) + { + $serviceInstance = $AllSearchServiceInstances.($ComponentToAdd + $domain) + } + else + { + $message = ("Search service instance for component '$ComponentToAdd' was not " + ` + "found. Only found components on '$($ComponentsToAdd.Keys -join ", ")'") + Add-SPDscEvent -Message $message ` + -EntryType 'Error' ` + -EventID 100 ` + -Source $eventSource + throw $message + } + $NewComponentParams = @{ SearchTopology = $newTopology - SearchServiceInstance = $AllSearchServiceInstances.$ComponentToAdd + SearchServiceInstance = $serviceInstance } switch ($componentTypes.$CurrentSearchProperty) { @@ -458,7 +485,8 @@ function Set-TargetResource $component = Get-SPEnterpriseSearchComponent -SearchTopology $newTopology | ` Where-Object -FilterScript { ($_.GetType().Name -eq $componentTypes.$CurrentSearchProperty) ` - -and ($_.ServerName -eq $ComponentToRemove) ` + -and (($_.ServerName -eq $ComponentToRemove) ` + -or ($_.ServerName -eq ($ComponentToRemove -replace $domain))) ` -and ($_.IndexPartitionOrdinal -eq 0) } } @@ -467,7 +495,8 @@ function Set-TargetResource $component = Get-SPEnterpriseSearchComponent -SearchTopology $newTopology | ` Where-Object -FilterScript { ($_.GetType().Name -eq $componentTypes.$CurrentSearchProperty) ` - -and ($_.ServerName -eq $ComponentToRemove) + -and (($_.ServerName -eq $ComponentToRemove) ` + -or ($_.ServerName -eq ($ComponentToRemove -replace $domain))) } } @@ -547,6 +576,14 @@ function Set-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters + $domain = "." + (Get-CimInstance -ClassName Win32_ComputerSystem).Domain + $PSBoundParameters.Admin = $PSBoundParameters.Admin -replace $domain + $PSBoundParameters.Crawler = $PSBoundParameters.Crawler -replace $domain + $PSBoundParameters.ContentProcessing = $PSBoundParameters.ContentProcessing -replace $domain + $PSBoundParameters.AnalyticsProcessing = $PSBoundParameters.AnalyticsProcessing -replace $domain + $PSBoundParameters.QueryProcessing = $PSBoundParameters.QueryProcessing -replace $domain + $PSBoundParameters.IndexPartition = $PSBoundParameters.IndexPartition -replace $domain + Write-Verbose -Message "Current Values: $(Convert-SPDscHashtableToString -Hashtable $CurrentValues)" Write-Verbose -Message "Target Values: $(Convert-SPDscHashtableToString -Hashtable $PSBoundParameters)" From 7df4f7da18960c949e6cc5bd9385aed8824a9db6 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Thu, 8 Jul 2021 13:55:24 +0200 Subject: [PATCH 5/5] Updated review results --- CHANGELOG.md | 2 +- .../MSFT_SPManagedMetaDataServiceApp.psm1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c2703fa0..13e7c06e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - SPContentDatabase - - Fixed issue where WebAppUrl in the Desired State would could the test to fail, always resulting + - Fixed issue where WebAppUrl in the Desired State would cause the test to fail, always resulting in False. - SPInstallLanguagePack - Fixed detection of Norwegian language pack diff --git a/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 b/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 index 03fa1e024..3d39f0ae1 100644 --- a/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 @@ -348,7 +348,7 @@ function Set-TargetResource $result = Get-TargetResource @PSBoundParameters $pName = "$Name Proxy" - if ([String]::IsNullOrEmpty($result.ProxyName)) + if (-not [String]::IsNullOrEmpty($result.ProxyName)) { $pName = $result.ProxyName }