Skip to content

Commit

Permalink
Merge pull request #1325 from Yvand/Yvand/add-param-to-spfarm
Browse files Browse the repository at this point in the history
Add parameter SkipRegisterAsDistributedCacheHost to SPFarm
  • Loading branch information
ykuijs committed Jun 26, 2021
2 parents 1b7c1e1 + 70ddb1c commit 2fc3d9d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- SPFarm
- Added parameter SkipRegisterAsDistributedCacheHost

### Fixed

- SPInstallLanguagePack
- Fixed detection of Norwegian language pack

Expand All @@ -29,8 +36,6 @@ 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
16 changes: 15 additions & 1 deletion SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ function Get-TargetResource
[System.Management.Automation.PSCredential]
$ApplicationCredentialKey,

[Parameter()]
[System.Boolean]
$SkipRegisterAsDistributedCacheHost = $true,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
Expand Down Expand Up @@ -449,6 +453,10 @@ function Set-TargetResource
[System.Management.Automation.PSCredential]
$ApplicationCredentialKey,

[Parameter()]
[System.Boolean]
$SkipRegisterAsDistributedCacheHost = $true,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
Expand All @@ -467,6 +475,8 @@ function Set-TargetResource
throw $message
}

$PSBoundParameters.SkipRegisterAsDistributedCacheHost = $SkipRegisterAsDistributedCacheHost

if ($PSBoundParameters.ContainsKey("CentralAdministrationUrl"))
{
if ([string]::IsNullOrEmpty($CentralAdministrationUrl))
Expand Down Expand Up @@ -828,7 +838,7 @@ function Set-TargetResource
DatabaseServer = $params.DatabaseServer
DatabaseName = $params.FarmConfigDatabaseName
Passphrase = $params.Passphrase.Password
SkipRegisterAsDistributedCacheHost = $true
SkipRegisterAsDistributedCacheHost = $params.SkipRegisterAsDistributedCacheHost
}

$supportsSettingApplicationCredentialKey = $false
Expand Down Expand Up @@ -1306,6 +1316,10 @@ function Test-TargetResource
[System.Management.Automation.PSCredential]
$ApplicationCredentialKey,

[Parameter()]
[System.Boolean]
$SkipRegisterAsDistributedCacheHost = $true,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MSFT_SPFarm : OMI_BaseResource
[Write, Description("SharePoint 2016 & 2019 only - the MinRole role to enroll this server as"), ValueMap{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}, Values{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}] String ServerRole;
[Write, Description("Specifies the state of the Developer Dashboard ('OnDemand' is SP2013 only)"), ValueMap{"Off","On","OnDemand"}, Values{"Off","On","OnDemand"}] String DeveloperDashboard;
[Write, Description("Specifies the application credential key on the local server. Only supported for SP2019."), EmbeddedInstance("MSFT_Credential")] String ApplicationCredentialKey;
[Write, Description("Set to true to not register the server computer as a distributed cache host")] Boolean SkipRegisterAsDistributedCacheHost;
[Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount;
[Write, Description("Should SQL Server authentication be used to connect to the database?")] Boolean UseSQLAuthentication;
[Write, Description("If using SQL authentication, the SQL login to use to connect to the instance"), EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials;
Expand Down
3 changes: 3 additions & 0 deletions SharePointDsc/DSCResources/MSFT_SPFarm/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ The application credential key will only be set during initial farm creation and
when joining the farm. The ApplicationCredentialKey needs to be the same on each
server in the farm. ApplicationCredentialKey is only supported for SharePoint 2019.

If SkipRegisterAsDistributedCacheHost is set to true, the server is not registered
as a distributed cache host.

NOTE:
When using SharePoint 2016 and later and enabling the Developer Dashboard,
please make sure you also provision the Usage and Health service application
Expand Down

0 comments on commit 2fc3d9d

Please sign in to comment.