Skip to content

Commit

Permalink
Merge branch 'dev' into workflow-scope-name
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Jan 11, 2019
2 parents 7826e76 + b2b01fc commit 4b4b336
Show file tree
Hide file tree
Showing 29 changed files with 656 additions and 620 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,18 +2,35 @@

## Unreleased

* Changes to SharePointDsc unit testing
* Implemented Strict Mode version 1 for all code run during unit tests.
* SPAuthenticationRealm
* New resource for setting farm authentication realm
* SPDistributedCacheService
* Fixed exception on Stop-SPServiceInstance with SharePoint 2019
* SPFarm
* Improved logging
* SPFarmSolution
* Fixed issue where uninstalling a solution would not work as expected if it
contained web application resources.
* SPInstallPrereqs
* Improved logging
* SPProductUpgrade
* Fixed issue where upgrading SP2013 would not properly detect the installed
version
* SPSearchAuthorativePage
* Fixed issue where modifying search query would not target the correct
search application
* SPSearchResultSource
* Updated resource to allow localized ProviderTypes
* SPServiceAppSecurity
* Updated resource to allow localized permission levels
* SPSite
* Improved logging
* SPUserProfileSyncService
* Fixed issue where failure to configure the sync service would not throw error
* SPWebAppPolicy
* Fixed issue where parameter MembersToExclude did not work as expected
* SPWorkflowService
* Added support for specifying scope name.
* Added support for detecting incorrect configuration for scope name and
Expand Down
Expand Up @@ -246,9 +246,17 @@ function Set-TargetResource

Add-SPDistributedCacheServiceInstance

Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance"
} | Stop-SPServiceInstance -Confirm:$false
try
{
Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance"
} | Stop-SPServiceInstance -Confirm:$false
}
catch
{
# In SharePoint 2019, Stop-SPServiceInstance throws an exception if service
# is not running on the server, try/catch handles this scenario
}

$count = 0
$maxCount = 30
Expand Down Expand Up @@ -309,7 +317,14 @@ function Set-TargetResource
$account = Get-SPManagedAccount -Identity $params.ServiceAccount
$cacheService.ProcessIdentity.ManagedAccount = $account
$cacheService.ProcessIdentity.Update()
$cacheService.ProcessIdentity.Deploy()
try
{
$cacheService.ProcessIdentity.Deploy()
}
catch
{
# In SharePoint 2019, ProcessIdentity.Deploy() may throw an exception
}
}
}
}
Expand Down
Expand Up @@ -243,6 +243,8 @@ function Set-TargetResource
$runParams.Add("Confirm", $false)
$runParams.Add("Verbose", $false)

$solution = Get-SPSolution -Identity $params.Name -Verbose:$false

if ($solution.ContainsWebApplicationResource)
{
if ($null -eq $webApps -or $webApps.Length -eq 0)
Expand Down
Expand Up @@ -33,6 +33,7 @@ function Get-TargetResource
$nonCompliantServices = Get-SPService | Where-Object -FilterScript {
$_.CompliantWithMinRole -eq $false
}
$params = $args[0];

if ($null -eq $nonCompliantServices)
{
Expand Down
Expand Up @@ -154,9 +154,7 @@ function Get-TargetResource
# Check SharePoint version information.
$servicepack = $true
$versionInfo = Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $productName `
-ScriptBlock {
$productToCheck = $args[0]
return Get-SPDscFarmVersionInfo -ProductToCheck "Microsoft SharePoint Server 2013"
}
}
Expand All @@ -165,9 +163,7 @@ function Get-TargetResource
Write-Verbose -Message "Update is a Cumulative Update."
# Cumulative Update is multi-lingual. Check version information of all products.
$versionInfo = Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $productName `
-ScriptBlock {
$productToCheck = $args[0]
return Get-SPDscFarmVersionInfo
}
}
Expand Down Expand Up @@ -327,7 +323,7 @@ function Set-TargetResource

# To prevent an endless loop: Check if an upgrade is required.
$installedVersion = Get-SPDSCInstalledProductVersion
if ($spVersion.FileMajorPart -eq 15)
if ($installedVersion.FileMajorPart -eq 15)
{
$wssRegKey ="hklm:SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS"
}
Expand Down
Expand Up @@ -122,10 +122,11 @@ function Get-TargetResource
$adGroup = Convert-SPDscADGroupIDToName -GroupId $script:groupDataSet.SecurityGroups.WSEC_GRP_AD_GUID
}

$groupMembers = @()

if ($adGroup -eq "")
{
# No AD group is set, check for individual members
$groupMembers = @()
$script:groupDataSet.GroupMembers.Rows | ForEach-Object -Process {
$groupMembers += Get-SPDscProjectServerResourceName -ResourceId $_["RES_UID"] -PwaUrl $params.Url
}
Expand Down
Expand Up @@ -46,7 +46,7 @@ function Get-TargetResource
Action = $params.Action
Ensure = "Absent"
InstallAccount = $params.InstallAccount
}
}

$serviceApp = Get-SPEnterpriseSearchServiceApplication -Identity $params.ServiceAppName
if($null -eq $serviceApp)
Expand All @@ -67,9 +67,9 @@ function Get-TargetResource
{
return $nullReturn
}
else
else
{

return @{
ServiceAppName = $params.ServiceAppName
Path = $params.Path
Expand All @@ -80,7 +80,7 @@ function Get-TargetResource
}
}
}
else
else
{
$queryDemoted = $serviceApp | Get-SPEnterpriseSearchQueryDemoted -Identity $params.Path `
-Owner $searchOwner `
Expand All @@ -90,7 +90,7 @@ function Get-TargetResource
{
return $nullReturn
}
else
else
{
return @{
ServiceAppName = $params.ServiceAppName
Expand All @@ -104,7 +104,7 @@ function Get-TargetResource

}
return $result

}


Expand Down Expand Up @@ -140,7 +140,7 @@ function Set-TargetResource
[System.Management.Automation.PSCredential]
$InstallAccount
)

Write-Verbose -Message "Setting Authoratative Page Settings for '$Path'"

$CurrentResults = Get-TargetResource @PSBoundParameters
Expand All @@ -155,7 +155,7 @@ function Set-TargetResource
$serviceApp = Get-SPEnterpriseSearchServiceApplication -Identity $params.ServiceAppName
$searchObjectLevel = [Microsoft.Office.Server.Search.Administration.SearchObjectLevel]::Ssa
$searchOwner = New-Object -TypeName "Microsoft.Office.Server.Search.Administration.SearchObjectOwner" -ArgumentList $searchObjectLevel

if($null -eq $serviceApp)
{
throw "Search Service App was not available."
Expand All @@ -167,13 +167,13 @@ function Set-TargetResource
-Owner $searchOwner `
-Level $params.Level
}
else
else
{
New-SPEnterpriseSearchQueryDemoted -Url $params.Path -SearchApplication $serviceApp -Owner $searchOwner
}
}
}
if($CurrentResults.Ensure -eq "Present" -and $Ensure -eq "Present")
if($CurrentResults.Ensure -eq "Present" -and $Ensure -eq "Present")
{
$result = Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
Expand All @@ -192,7 +192,7 @@ function Set-TargetResource
if($params.Action -eq "Authoratative")
{
Set-SPEnterpriseSearchQueryAuthority -Identity $params.ServiceAppName `
-SearchApplication $ssa `
-SearchApplication $serviceApp `
-Owner $searchOwner `
-Level $params.Level
}
Expand All @@ -216,14 +216,14 @@ function Set-TargetResource
if($params.Action -eq "Authoratative")
{
Remove-SPEnterpriseSearchQueryAuthority -Identity $params.ServiceAppName `
-SearchApplication $ssa `
-SearchApplication $serviceApp `
-Owner $searchOwner `
-ErrorAction SilentlyContinue
}
else
else
{
Remove-SPEnterpriseSearchQueryDemoted -Identity $params.ServiceAppName `
-SearchApplication $ssa `
-SearchApplication $serviceApp `
-Owner $searchOwner `
-ErrorAction SilentlyContinue
}
Expand All @@ -245,7 +245,7 @@ function Test-TargetResource
[Parameter(Mandatory = $true)]
[System.String]
$Path,

[Parameter()]
[ValidateRange(0.0, 2.0)]
[System.Single]
Expand Down Expand Up @@ -280,7 +280,7 @@ function Test-TargetResource
-ValuesToCheck @("ServiceAppName",
"Path",
"Level",
"Action",
"Action",
"Ensure")
}
else
Expand All @@ -289,7 +289,7 @@ function Test-TargetResource
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("ServiceAppName",
"Path",
"Action",
"Action",
"Ensure")
}
}
Expand All @@ -298,7 +298,7 @@ function Test-TargetResource
return Test-SPDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("ServiceAppName",
"Action",
"Action",
"Ensure")
}
}
Expand Down

0 comments on commit 4b4b336

Please sign in to comment.