Skip to content

Commit

Permalink
Merge pull request #1330 from ykuijs/bugfix
Browse files Browse the repository at this point in the history
Bugfix PR
  • Loading branch information
ykuijs committed Jul 8, 2021
2 parents 2fc3d9d + 7df4f7d commit 6e73437
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 36 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,25 @@ 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

- SPContentDatabase
- 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
- 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.
- Fixed issue with using FQDNs instead of NetBIOS server names.

## [4.7.0] - 2021-06-10

Expand All @@ -36,6 +50,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function Set-TargetResource
$result = Get-TargetResource @PSBoundParameters

$pName = "$Name Proxy"
if ($null -ne $result.ProxyName)
if (-not [String]::IsNullOrEmpty($result.ProxyName))
{
$pName = $result.ProxyName
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
{
Expand Down Expand Up @@ -443,29 +470,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)
}
}
}
Expand All @@ -477,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)
}
}
Expand All @@ -486,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)))
}
}

Expand Down Expand Up @@ -566,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)"

Expand Down
2 changes: 1 addition & 1 deletion SharePointDsc/DSCResources/MSFT_SPService/readme.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6e73437

Please sign in to comment.