From 69ad0ad4ae746b8713cb9a4d5442afbf842169a3 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 1 Dec 2015 12:24:35 +1100 Subject: [PATCH 01/19] Commiting to merge with release candidate branch --- .../Modules/xSharePoint.Util/xSharePoint.Util.psm1 | 7 ++++++- .../xSPWebApplication.Throttling.psm1 | 6 +----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 029372282..779801a5d 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -148,7 +148,12 @@ function Test-xSharePointObjectHasProperty() { [parameter(Mandatory = $true,Position=1)] [Object] $Object, [parameter(Mandatory = $true,Position=2)] [String] $PropertyName ) - return [bool]($Object.PSobject.Properties.name -contains $PropertyName) + if (([bool]($Object.PSobject.Properties.name -contains $PropertyName)) -eq $true) { + if ($Object.$PropertyName -ne $null) { + return $true + } + } + return $false } function Test-xSharePointSpecificParameters() { diff --git a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 index 2cf146ee2..7a1010640 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 @@ -55,13 +55,9 @@ function Set-xSPWebApplicationThrottlingSettings { -ParamKey "RequestThrottling" # Create time span object separately - if (Test-xSharePointObjectHasProperty $Settings "ChangeLogExpiryDays") { + if ((Test-xSharePointObjectHasProperty $Settings "ChangeLogExpiryDays") -eq $true) { $WebApplication.ChangeLogRetentionPeriod = New-TimeSpan -Days $Settings.ChangeLogExpiryDays } - - - - } From 50d3dd9a58f26847b35f68d9491bb22d16a95243 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 1 Dec 2015 21:01:44 +1100 Subject: [PATCH 02/19] Fixed issue with name of blocked file types CIM object --- .../MSFT_xSPWebApplication.schema.mof | 4 ++-- ...harePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof index a407d5d93..1e236d6c9 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof @@ -1,5 +1,5 @@ [ClassVersion("1.0.0")] -Class MSFT_xSPFilesTypes +Class MSFT_xSPBlockedFileTypes { [write] string Blocked[]; [write] string EnsureBlocked[]; @@ -99,6 +99,6 @@ class MSFT_xSPWebApplication : OMI_BaseResource [Write, EmbeddedInstance("MSFT_xSPWebApplicationSettings")] string GeneralSettings; [Write, EmbeddedInstance("MSFT_xSPWebApplicationWorkflowSettings")] string WorkflowSettings; [Write, EmbeddedInstance("MSFT_xSPWebApplicationThrottling")] string ThrottlingSettings; - [Write, EmbeddedInstance("MSFT_xSPFilesTypes")] string BlockedFileTypes; + [Write, EmbeddedInstance("MSFT_xSPBlockedFileTypes")] string BlockedFileTypes; }; diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 index ebe4eecb5..786582648 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPWebApplication (Blocked file types)" { ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPFilesTypes -Property @{ + BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ Blocked = @("exe", "dll", "ps1") } -ClientOnly) } @@ -121,7 +121,7 @@ Describe "xSPWebApplication (Blocked file types)" { ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPFilesTypes -Property @{ + BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ EnsureBlocked = @("exe") EnsureAllowed = @("pdf") } -ClientOnly) @@ -238,7 +238,7 @@ Describe "xSPWebApplication (Blocked file types)" { ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPFilesTypes -Property @{ + BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ Blocked = @("exe", "dll", "ps1") EnsureBlocked = @("exe", "dll") EnsureAllowed = @("ps1") @@ -287,7 +287,7 @@ Describe "xSPWebApplication (Blocked file types)" { ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPFilesTypes -Property @{ + BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ } -ClientOnly) } From 20f7893d14b507d3408590e6f50d64f9c0797602 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 2 Dec 2015 00:29:18 +1100 Subject: [PATCH 03/19] Removing unused module file --- .../MSFT_xSPWebApplication.Set.ps1 | 188 ------------------ 1 file changed, 188 deletions(-) delete mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.Set.ps1 diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.Set.ps1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.Set.ps1 deleted file mode 100644 index c3af6e4d3..000000000 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.Set.ps1 +++ /dev/null @@ -1,188 +0,0 @@ -function Set-BlockedFiles($blockedFiles, $wa) -{ - - if($blockedFiles -eq $null){return;} - if($blockedFiles.Blocked -ne $null ){ - $wa.BlockedFileExtensions.Clear(); - $blockedFiles.Blocked| % { - $wa.BlockedFileExtensions.Add($_) ; - - } - } - if($blockedFiles.EnsureBlocked -ne $null){ - $blockedFiles.EnsureBlocked| % { - if(!$wa.BlockedFileExtensions.ContainExtension($_)){ - $wa.BlockedFileExtensions.Add($_) ; - } - } - } - if($blockedFiles.EnsureAllowed -ne $null){ - $blockedFiles.EnsureAllowed | % { - if($wa.BlockedFileExtensions.ContainExtension($_)){ - $wa.BlockedFileExtensions.Remove($_) - } - } - } - -} -function Get-ValueOrDefault($input, $attribute, $defaultValue) -{ - try{ - if($input."$attribute" -ne $null) - { - return $input."$attribute" - }else { - return $defaultValue - } - }catch - { - return $defaultValue - } -} -function Set-GeneralSettings($generalSettings, $wa) -{ - if($generalSettings -eq $null){ return;} - - #TODO: Quota Template - $wa.DefaultTimeZone =Get-ValueOrDefault $generalSettings "TimeZone" $wa.DefaultTimeZone - $wa.AlertsEnabled = Get-ValueOrDefault $generalSettings "Alerts" $wa.AlertsEnabled - $wa.AlertsMaximum = Get-ValueOrDefault $generalSettings "AlertsLimit" $wa.AlertsMaximum - $wa.SyndicationEnabled = Get-ValueOrDefault $generalSettings "RSS" $wa.RSS - $wa.MetaWeblogEnabled = Get-ValueOrDefault $generalSettings "BlogAPI" $wa.BlogAPI - $wa.MetaWeblogAuthenticationEnabled = Get-ValueOrDefault $generalSettings "BlogAPIAuthenticated" $wa.BlogAPIAuthenticated - $wa.BrowserFileHandling = Get-ValueOrDefault $generalSettings "BrowserFileHandling" $wa.BrowserFileHandling - $wa.FormDigestSettings.Enabled = Get-ValueOrDefault $generalSettings "SecurityValidation" $wa.FormDigestSettings.Enabled - $wa.MaximumFileSize = Get-ValueOrDefault $generalSettings "MaximumUploadSize" $wa.MaximumUploadSize - $wa.RecycleBinEnabled = Get-ValueOrDefault $generalSettings "RecycleBinEnabled" $wa.RecycleBinEnabled - $wa.RecycleBinCleanupEnabled = Get-ValueOrDefault $generalSettings "RecycleBinCleanupEnabled" $wa.RecycleBinCleanupEnabled - $wa.RecycleBinRetentionPeriod = Get-ValueOrDefault $generalSettings "RecycleBinRetentionPeriod" $wa.RecycleBinRetentionPeriod - $wa.SecondStageRecycleBinQuota = Get-ValueOrDefault $generalSettings "SecondStageRecycleBinEnabled" $wa.SecondStageRecycleBinQuota - $wa.BrowserCEIPEnabled = Get-ValueOrDefault $generalSettings "CustomerExperienceProgram" $wa.BrowserCEIPEnabled - $wa.PresenceEnabled = Get-ValueOrDefault $generalSettings "Presence" $wa.BrowserCEIPEnabled - $wa.Update(); -} -function Set-WorkflowSettings ($workflowSettings, $wa) -{ - if($workflowSettings -eq $null ){ return;} - if($workflowSettings.UserDefinedWorkflowsEnabled -ne $null){ - $wa.UserDefinedWorkflowsEnabled = $workflowSettings.UserDefinedWorkflowsEnabled; - } - if($workflowSettings.EmailToNoPermissionWorkflowParticipantsEnable -ne $null){ - $wa.EmailToNoPermissionWorkflowParticipantsEnabled = $workflowSettings.EmailToNoPermissionWorkflowParticipantsEnable; - } - if($workflowSettings.ExternalWorkflowParticipantsEnabled -ne $null){ - $wa.ExternalWorkflowParticipantsEnabled = $workflowSettings.ExternalWorkflowParticipantsEnabled; - } - - $wa.UpdateWorkflowConfigurationSettings(); - $wa.Update(); -} - -function Set-ThrottlingSettings ($throttlingSettings, $wa) -{ - if($throttlingSettings -eq $null){ return;} - if($throttlingSettings.ListViewThreshold -ne $null ){ - $wa.MaxItemsPerThrottledOperation = $throttlingSettings.ListViewThreshold - } - if($throttlingSettings.AllowObjectModelOverride -ne $null){ - $wa.AllowOMCodeOverrideThrottleSettings = $throttlingSettings.AllowObjectModelOverride - } - if($throttlingSettings.AdminThreshold -ne $null){ - $wa.MaxItemsPerThrottledOperationOverride = $throttlingSettings.AdminThreshold - } - if($throttlingSettings.ListViewLookupThreshold -ne $null){ - $wa.MaxQueryLookupFields = $throttlingSettings.ListViewLookupThreshold - } - if($throttlingSettings.HappyHourEnabled -ne $null){ - $wa.UnthrottledPrivilegedOperationWindowEnabled =$throttlingSettings.HappyHourEnabled - } - if($throttlingSettings.HappyHour -ne $null){ - $happyHour =$throttlingSettings.HappyHour; - if(($happyHour.Hour -ne $null) -and ($happyHour.Minute -ne $null) -and ($happyHour.Duration -ne $null)){ - if(($happyHour.Hour -le 24) -and ($happyHour.Minute -le 24) -and ($happyHour.Duration -le 24)){ - $wa.DailyStartUnthrottledPrivilegedOperationsHour = $happyHour.Hour - $wa.DailyStartUnthrottledPrivilegedOperationsMinute = $happyHour.Minute - $wa.DailyUnthrottledPrivilegedOperationsDuration = $happyHour.Duration - }else{ - throw "the valid range hour, minute and duration is 0-24"; - } - - }else { - throw "You need to Provide Hour, Minute and Duration when providing HappyHour settings"; - } - } - if($throttlingSettings.UniquePermissionThreshold){ - $wa.MaxUniquePermScopesPerList = $throttlingSettings.UniquePermissionThreshold - } - if($throttlingSettings.EventHandlersEnabled){ - $wa.EventHandlersEnabled = $throttlingSettings.EventHandlersEnabled - } - if($throttlingSettings.RequestThrottling){ - $wa.HttpThrottleSettings.PerformThrottle = $throttlingSettings.RequestThrottling - } - if($throttlingSettings.ChangeLogEnabled){ - $wa.ChangeLogExpirationEnabled = $throttlingSettings.ChangeLogEnabled - } - if($throttlingSettings.ChangeLogExpiryDays){ - $wa.ChangeLogRetentionPeriod = New-TimeSpan -Days $throttlingSettings.ChangeLogExpiryDays - } - $wa.Update(); -} - -function GetAndRemove-Parameter($params, $name){ - $result =$null - if($params.ContainsKey($name)) - { - $result = $params.$name - $params.Remove( $name) - } - return $result; -} -function Sanitize-ComplexTypes{ - param( - [Parameter(Position = 0)] - - $params - ) - -$blocked =GetAndRemove-Parameter $params "BlockedFileTypes" - return @{ - GeneralSettings = GetAndRemove-Parameter $params "GeneralSettings" - WorkflowSettings = GetAndRemove-Parameter $params "WorkflowSettings" - Extensions = GetAndRemove-Parameter $params "Extensions" - ThrottlingSettings = GetAndRemove-Parameter $params "ThrottlingSettings" - BlockedFileTypes = $blocked - } -} - - -$params = $args[0] - -$settings = Sanitize-ComplexTypes $params - -$wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue -if ($null -eq $wa) { - if ($params.ContainsKey("AuthenticationMethod") -eq $true) { - if ($params.AuthenticationMethod -eq "NTLM") { - $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos - } else { - $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication - } - $params.Remove("AuthenticationMethod") - $params.Add("AuthenticationProvider", $ap) - } - - if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - if ($params.ContainsKey("AllowAnonymous")) { - $params.Remove("AllowAnonymous") | Out-Null - $params.Add("AllowAnonymousAccess", $true) - } - - $wa = New-SPWebApplication @params -} - -Set-ThrottlingSettings $settings.ThrottlingSettings $wa -Set-WorkflowSettings $settings.WorkflowSettings $wa -Set-BlockedFiles $settings.BlockedFileTypes $wa -Set-GeneralSettings $settings.GeneralSettings $wa - \ No newline at end of file From ca374247fa4d44eca3cd59d1afb6bf56d7e11dd0 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 2 Dec 2015 00:31:35 +1100 Subject: [PATCH 04/19] Updated MOF to match required properties in script --- .../MSFT_xSPOutgoingEmailSettings.schema.mof | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof index ac95787f2..292799962 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof @@ -20,10 +20,10 @@ It is possible to set the outgoing server, from address, reply to address and th class MSFT_xSPOutgoingEmailSettings : OMI_BaseResource { [key] string WebAppUrl; - [Write] string SMTPServer; - [Write] string FromAddress; - [Write] string ReplyToAddress; - [Write] string CharacterSet; + [Required] string SMTPServer; + [Required] string FromAddress; + [Required] string ReplyToAddress; + [Required] string CharacterSet; [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; From 484ddf72e9d9145b013dc1e06d8d15a8c3cbb7d8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 12:15:50 +1100 Subject: [PATCH 05/19] Split apart xSPWebApplication to workaround issue with DSC complex types --- .../MSFT_xSPWebAppBlockedFileTypes.psm1 | 88 +++++++++++++ .../MSFT_xSPWebAppBlockedFileTypes.schema.mof | 9 ++ .../MSFT_xSPWebAppGeneralSettings.psm1 | 124 ++++++++++++++++++ .../MSFT_xSPWebAppGeneralSettings.schema.mof | 21 +++ .../MSFT_xSPWebAppThrottlingSettings.psm1 | 118 +++++++++++++++++ ...SFT_xSPWebAppThrottlingSettings.schema.mof | 26 ++++ .../MSFT_xSPWebAppWorkflowSettings.psm1 | 87 ++++++++++++ .../MSFT_xSPWebAppWorkflowSettings.schema.mof | 9 ++ .../MSFT_xSPWebApplication.psm1 | 19 +-- .../MSFT_xSPWebApplication.schema.mof | 67 +--------- .../xSPWebApplication.BlockedFileTypes.psm1 | 25 ++-- .../xSPWebApplication.GeneralSettings.psm1 | 4 +- .../xSPWebApplication.Throttling.psm1 | 6 +- .../xSPWebApplication.Workflow.psm1 | 10 +- ...Point.xSPWebAppBlockedFileTypes.Tests.ps1} | 40 ++---- ...ePoint.xSPWebAppGeneralSettings.Tests.ps1} | 72 +++++----- ...int.xSPWebAppThrottlingSettings.Tests.ps1} | 122 ++++++++--------- ...Point.xSPWebAppWorkflowSettings.Tests.ps1} | 16 +-- 18 files changed, 609 insertions(+), 254 deletions(-) create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.psm1 create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.psm1 create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.psm1 create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.psm1 create mode 100644 Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof rename Tests/xSharePoint/{xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 => xSharePoint.xSPWebAppBlockedFileTypes.Tests.ps1} (86%) rename Tests/xSharePoint/{xSharePoint.xSPWebApplication.GeneralSettings.Tests.ps1 => xSharePoint.xSPWebAppGeneralSettings.Tests.ps1} (67%) rename Tests/xSharePoint/{xSharePoint.xSPWebApplication.Throttling.Tests.ps1 => xSharePoint.xSPWebAppThrottlingSettings.Tests.ps1} (73%) rename Tests/xSharePoint/{xSharePoint.xSPWebApplication.Workflow.Tests.ps1 => xSharePoint.xSPWebAppWorkflowSettings.Tests.ps1} (88%) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.psm1 new file mode 100644 index 000000000..d18569e3b --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.psm1 @@ -0,0 +1,88 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.String[]] $Blocked, + [parameter(Mandatory = $false)] [System.String[]] $EnsureBlocked, + [parameter(Mandatory = $false)] [System.String[]] $EnsureAllowed, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Getting web application '$url' blocked file types" + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { return $null } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.BlockedFileTypes.psm1" -Resolve) + + $result = Get-xSPWebApplicationBlockedFileTypes -WebApplication $wa + $result.Add("Url", $params.Url) + $result.Add("InstallAccount", $params.InstallAccount) + return $result + } + return $result +} + + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.String[]] $Blocked, + [parameter(Mandatory = $false)] [System.String[]] $EnsureBlocked, + [parameter(Mandatory = $false)] [System.String[]] $EnsureAllowed, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Setting web application '$Url' blocked file types" + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { + throw "Web application $($params.Url) was not found" + return + } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.BlockedFileTypes.psm1" -Resolve) + Set-xSPWebApplicationBlockedFileTypes -WebApplication $wa -Settings $params + $wa.Update() + } +} + + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.String[]] $Blocked, + [parameter(Mandatory = $false)] [System.String[]] $EnsureBlocked, + [parameter(Mandatory = $false)] [System.String[]] $EnsureAllowed, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing for web application '$Url' blocked file types" + if ($null -eq $CurrentValues) { return $false } + + Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.BlockedFileTypes.psm1" -Resolve) + return Test-xSPWebApplicationBlockedFileTypes -CurrentSettings $CurrentValues -DesiredSettings $PSBoundParameters +} + + +Export-ModuleMember -Function *-TargetResource + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof new file mode 100644 index 000000000..993caed58 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -0,0 +1,9 @@ +[ClassVersion("1.0.0"), FriendlyName("xSPBlockedFileTypes")] +Class MSFT_xSPBlockedFileTypes +{ + [Key] string Url; + [write] string Blocked[]; + [write] string EnsureBlocked[]; + [write] string EnsureAllowed[]; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; +}; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.psm1 new file mode 100644 index 000000000..167a00d21 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.psm1 @@ -0,0 +1,124 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.UInt32] $TimeZone, + [parameter(Mandatory = $false)] [System.Boolean] $Alerts, + [parameter(Mandatory = $false)] [System.UInt32] $AlertsLimit, + [parameter(Mandatory = $false)] [System.Boolean] $RSS, + [parameter(Mandatory = $false)] [System.Boolean] $BlogAPI, + [parameter(Mandatory = $false)] [System.Boolean] $BlogAPIAuthenticated, + [parameter(Mandatory = $false)] [ValidateSet("Stric","Permissive")] [System.String] $BrowserFileHandling, + [parameter(Mandatory = $false)] [System.Boolean] $SecurityValidation, + [parameter(Mandatory = $false)] [System.Boolean] $RecycleBinEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $RecycleBinCleanupEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $RecycleBinRetentionPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $SecondStageRecycleBinQuota, + [parameter(Mandatory = $false)] [System.UInt32] $MaximumUploadSize, + [parameter(Mandatory = $false)] [System.Boolean] $CustomerExperienceProgram, + [parameter(Mandatory = $false)] [System.Boolean] $PresenceEnabled, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Getting web application '$url' general settings" + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { return $null } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.GeneralSettings.psm1" -Resolve) + + $result = Get-xSPWebApplicationGeneralSettings -WebApplication $wa + $result.Add("Url", $params.Url) + $result.Add("InstallAccount", $params.InstallAccount) + return $result + } + return $result +} + + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.UInt32] $TimeZone, + [parameter(Mandatory = $false)] [System.Boolean] $Alerts, + [parameter(Mandatory = $false)] [System.UInt32] $AlertsLimit, + [parameter(Mandatory = $false)] [System.Boolean] $RSS, + [parameter(Mandatory = $false)] [System.Boolean] $BlogAPI, + [parameter(Mandatory = $false)] [System.Boolean] $BlogAPIAuthenticated, + [parameter(Mandatory = $false)] [ValidateSet("Stric","Permissive")] [System.String] $BrowserFileHandling, + [parameter(Mandatory = $false)] [System.Boolean] $SecurityValidation, + [parameter(Mandatory = $false)] [System.Boolean] $RecycleBinEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $RecycleBinCleanupEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $RecycleBinRetentionPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $SecondStageRecycleBinQuota, + [parameter(Mandatory = $false)] [System.UInt32] $MaximumUploadSize, + [parameter(Mandatory = $false)] [System.Boolean] $CustomerExperienceProgram, + [parameter(Mandatory = $false)] [System.Boolean] $PresenceEnabled, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Applying general settings '$Url'" + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { + throw "Web application $($params.Url) was not found" + return + } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.GeneralSettings.psm1" -Resolve) + Set-xSPWebApplicationGeneralSettings -WebApplication $wa -Settings $params + $wa.Update() + } +} + + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.UInt32] $TimeZone, + [parameter(Mandatory = $false)] [System.Boolean] $Alerts, + [parameter(Mandatory = $false)] [System.UInt32] $AlertsLimit, + [parameter(Mandatory = $false)] [System.Boolean] $RSS, + [parameter(Mandatory = $false)] [System.Boolean] $BlogAPI, + [parameter(Mandatory = $false)] [System.Boolean] $BlogAPIAuthenticated, + [parameter(Mandatory = $false)] [ValidateSet("Stric","Permissive")] [System.String] $BrowserFileHandling, + [parameter(Mandatory = $false)] [System.Boolean] $SecurityValidation, + [parameter(Mandatory = $false)] [System.Boolean] $RecycleBinEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $RecycleBinCleanupEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $RecycleBinRetentionPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $SecondStageRecycleBinQuota, + [parameter(Mandatory = $false)] [System.UInt32] $MaximumUploadSize, + [parameter(Mandatory = $false)] [System.Boolean] $CustomerExperienceProgram, + [parameter(Mandatory = $false)] [System.Boolean] $PresenceEnabled, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing for web application general settings '$Url'" + if ($null -eq $CurrentValues) { return $false } + + Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.GeneralSettings.psm1" -Resolve) + return Test-xSPWebApplicationGeneralSettings -CurrentSettings $CurrentValues -DesiredSettings $PSBoundParameters +} + + +Export-ModuleMember -Function *-TargetResource + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof new file mode 100644 index 000000000..b31f2b26d --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof @@ -0,0 +1,21 @@ +[ClassVersion("1.0.0"), FriendlyName("xSPWebAppGeneralSettings")] +Class MSFT_xSPWebAppGeneralSettings +{ + [Key] string Url; + [write] uint32 TimeZone; + [write] boolean Alerts; + [write] uint32 AlertsLimit; + [write] boolean RSS; + [write] boolean BlogAPI; + [write] boolean BlogAPIAuthenticated; + [write, ValueMap{"Strict","Permissive"}, Values{"Stric","Permissive"}] String BrowserFileHandling; + [write] boolean SecurityValidation; + [write] boolean RecycleBinEnabled; + [write] boolean RecycleBinCleanupEnabled; + [write] uint32 RecycleBinRetentionPeriod; + [write] uint32 SecondStageRecycleBinQuota; + [write] uint32 MaximumUploadSize; + [write] boolean CustomerExperienceProgram; + [write] boolean PresenceEnabled; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; +}; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.psm1 new file mode 100644 index 000000000..9484b4ecc --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.psm1 @@ -0,0 +1,118 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.UInt32] $ListViewThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $AllowObjectModelOverride, + [parameter(Mandatory = $false)] [System.UInt32] $AdminThreshold, + [parameter(Mandatory = $false)] [System.UInt32] $ListViewLookupThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $HappyHourEnabled, + [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $HappyHour, + [parameter(Mandatory = $false)] [System.UInt32] $UniquePermissionThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $RequestThrottling, + [parameter(Mandatory = $false)] [System.Boolean] $ChangeLogEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $ChangeLogExpiryDays, + [parameter(Mandatory = $false)] [System.Boolean] $EventHandlersEnabled, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Getting web application '$url' throttling settings" + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { return $null } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) + + $result = Get-xSPWebApplicationThrottlingSettings -WebApplication $wa + $result.Add("Url", $params.Url) + $result.Add("InstallAccount", $params.InstallAccount) + return $result + } + return $result +} + + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.UInt32] $ListViewThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $AllowObjectModelOverride, + [parameter(Mandatory = $false)] [System.UInt32] $AdminThreshold, + [parameter(Mandatory = $false)] [System.UInt32] $ListViewLookupThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $HappyHourEnabled, + [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $HappyHour, + [parameter(Mandatory = $false)] [System.UInt32] $UniquePermissionThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $RequestThrottling, + [parameter(Mandatory = $false)] [System.Boolean] $ChangeLogEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $ChangeLogExpiryDays, + [parameter(Mandatory = $false)] [System.Boolean] $EventHandlersEnabled, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Setting web application '$Url' throttling settings" + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { + throw "Web application $($params.Url) was not found" + return + } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) + Set-xSPWebApplicationThrottlingSettings -WebApplication $wa -Settings $params + $wa.Update() + + # Happy hour settings + if ($params.ContainsKey("HappyHour") -eq $true) { + # Happy hour settins use separate update method so use a fresh web app to update these + $wa2 = Get-SPWebApplication -Identity $params.Url + Set-xSPWebApplicationHappyHourSettings -WebApplication $wa2 -Settings $params.HappyHour + } + } +} + + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.UInt32] $ListViewThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $AllowObjectModelOverride, + [parameter(Mandatory = $false)] [System.UInt32] $AdminThreshold, + [parameter(Mandatory = $false)] [System.UInt32] $ListViewLookupThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $HappyHourEnabled, + [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $HappyHour, + [parameter(Mandatory = $false)] [System.UInt32] $UniquePermissionThreshold, + [parameter(Mandatory = $false)] [System.Boolean] $RequestThrottling, + [parameter(Mandatory = $false)] [System.Boolean] $ChangeLogEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $ChangeLogExpiryDays, + [parameter(Mandatory = $false)] [System.Boolean] $EventHandlersEnabled, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing for web application '$Url' throttling settings" + if ($null -eq $CurrentValues) { return $false } + + Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) + return Test-xSPWebApplicationThrottlingSettings -CurrentSettings $CurrentValues -DesiredSettings $PSBoundParameters +} + + +Export-ModuleMember -Function *-TargetResource + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof new file mode 100644 index 000000000..eaa3ddb15 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof @@ -0,0 +1,26 @@ +[ClassVersion("1.0.0")] +Class MSFT_xSPWebApplicationHappyHour +{ + [write] uint32 Hour; + [write] uint32 Minute; + [write] uint32 Duration; + +}; + +[ClassVersion("1.0.0"), FriendlyName("xSPWebAppThrottlingSettings")] +Class MSFT_xSPWebAppThrottlingSettings +{ + [Key] string Url; + [write] uint32 ListViewThreshold; + [write] boolean AllowObjectModelOverride; + [write] uint32 AdminThreshold; + [write] uint32 ListViewLookupThreshold; + [write] boolean HappyHourEnabled; + [Write, EmbeddedInstance("MSFT_xSPWebApplicationHappyHour")] string HappyHour; + [write] uint32 UniquePermissionThreshold; + [write] boolean RequestThrottling; + [write] boolean ChangeLogEnabled; + [write] uint32 ChangeLogExpiryDays; + [write] boolean EventHandlersEnabled; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; +}; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.psm1 new file mode 100644 index 000000000..c5841a5d6 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.psm1 @@ -0,0 +1,87 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.Boolean] $ExternalWorkflowParticipantsEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $UserDefinedWorkflowsEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $EmailToNoPermissionWorkflowParticipantsEnable, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Getting web application '$url' workflow settings" + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { return $null } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Workflow.psm1" -Resolve) + + $result = Get-xSPWebApplicationWorkflowSettings -WebApplication $wa + $result.Add("Url", $params.Url) + $result.Add("InstallAccount", $params.InstallAccount) + return $result + } + return $result +} + + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.Boolean] $ExternalWorkflowParticipantsEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $UserDefinedWorkflowsEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $EmailToNoPermissionWorkflowParticipantsEnable, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Setting web application '$Url' workflow settings" + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @($PSBoundParameters,$PSScriptRoot) -ScriptBlock { + $params = $args[0] + $ScriptRoot = $args[1] + + $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + if ($null -eq $wa) { + throw "Web application $($params.Url) was not found" + return + } + + Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Workflow.psm1" -Resolve) + Set-xSPWebApplicationWorkflowSettings -WebApplication $wa -Settings $params + } +} + + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.Boolean] $ExternalWorkflowParticipantsEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $UserDefinedWorkflowsEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $EmailToNoPermissionWorkflowParticipantsEnable, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing for web application '$Url' workflow settings" + if ($null -eq $CurrentValues) { return $false } + + Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Workflow.psm1" -Resolve) + return Test-xSPWebApplicationWorkflowSettings -CurrentSettings $CurrentValues -DesiredSettings $PSBoundParameters +} + + +Export-ModuleMember -Function *-TargetResource + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof new file mode 100644 index 000000000..3cfcd9edd --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof @@ -0,0 +1,9 @@ +[ClassVersion("1.0.0"), FriendlyName("xSPWebAppWorkflowSettings")] +Class MSFT_xSPWebAppWorkflowSettings +{ + [Key] string Url; + [write] boolean ExternalWorkflowParticipantsEnabled; + [write] boolean UserDefinedWorkflowsEnabled; + [write] boolean EmailToNoPermissionWorkflowParticipantsEnable; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; +}; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index b7b829558..fd2359148 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -15,11 +15,7 @@ function Get-TargetResource [parameter(Mandatory = $false)] [System.String] $Path, [parameter(Mandatory = $false)] [System.String] $Port, [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, - [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $GeneralSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $WorkflowSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $ThrottlingSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $BlockedFileTypes + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting web application '$Name'" @@ -28,7 +24,6 @@ function Get-TargetResource $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $wa) { return $null } @@ -79,11 +74,7 @@ function Set-TargetResource [parameter(Mandatory = $false)] [System.String] $Path, [parameter(Mandatory = $false)] [System.String] $Port, [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, - [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $GeneralSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $WorkflowSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $ThrottlingSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $BlockedFileTypes + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating web application '$Name'" @@ -181,11 +172,7 @@ function Test-TargetResource [parameter(Mandatory = $false)] [System.String] $Path, [parameter(Mandatory = $false)] [System.String] $Port, [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, - [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $GeneralSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $WorkflowSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $ThrottlingSettings, - [parameter(Mandatory = $false)] [Microsoft.Management.Infrastructure.CimInstance] $BlockedFileTypes + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof index 1e236d6c9..fff10e1a3 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof @@ -1,65 +1,4 @@ -[ClassVersion("1.0.0")] -Class MSFT_xSPBlockedFileTypes -{ - [write] string Blocked[]; - [write] string EnsureBlocked[]; - [write] string EnsureAllowed[]; -}; - -[ClassVersion("1.0.0")] -Class MSFT_xSPWebApplicationHappyHour -{ - [write] uint32 Hour; - [write] uint32 Minute; - [write] uint32 Duration; - -}; - -[ClassVersion("1.0.0")] -Class MSFT_xSPWebApplicationThrottling -{ - [write] uint32 ListViewThreshold; - [write] boolean AllowObjectModelOverride; - [write] uint32 AdminThreshold; - [write] uint32 ListViewLookupThreshold; - [write] boolean HappyHourEnabled; - [Write, EmbeddedInstance("MSFT_xSPWebApplicationHappyHour")] string HappyHour; - [write] uint32 UniquePermissionThreshold; - [write] boolean RequestThrottling; - [write] boolean ChangeLogEnabled; - [write] uint32 ChangeLogExpiryDays; - [write] boolean EventHandlersEnabled; -}; - -[ClassVersion("1.0.0")] -Class MSFT_xSPWebApplicationWorkflowSettings -{ - [write] boolean ExternalWorkflowParticipantsEnabled; - [write] boolean UserDefinedWorkflowsEnabled; - [write] boolean EmailToNoPermissionWorkflowParticipantsEnable; -}; - -[ClassVersion("1.0.0")] -Class MSFT_xSPWebApplicationSettings -{ - [write] uint32 TimeZone; - [write] boolean Alerts; - [write] uint32 AlertsLimit; - [write] boolean RSS; - [write] boolean BlogAPI; - [write] boolean BlogAPIAuthenticated; - [write, ValueMap{"Strict","Permissive"}, Values{"Stric","Permissive"}] String BrowserFileHandling; - [write] boolean SecurityValidation; - [write] boolean RecycleBinEnabled; - [write] boolean RecycleBinCleanupEnabled; - [write] uint32 RecycleBinRetentionPeriod; - [write] uint32 SecondStageRecycleBinQuota; - [write] uint32 MaximumUploadSize; - [write] boolean CustomerExperienceProgram; - [write] boolean PresenceEnabled; -}; - -/* +/* **Description** This resource is responsible for creating a web application within the local SharePoint farm. @@ -96,9 +35,5 @@ class MSFT_xSPWebApplication : OMI_BaseResource [Write] string Path; [Write] string Port; [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; - [Write, EmbeddedInstance("MSFT_xSPWebApplicationSettings")] string GeneralSettings; - [Write, EmbeddedInstance("MSFT_xSPWebApplicationWorkflowSettings")] string WorkflowSettings; - [Write, EmbeddedInstance("MSFT_xSPWebApplicationThrottling")] string ThrottlingSettings; - [Write, EmbeddedInstance("MSFT_xSPBlockedFileTypes")] string BlockedFileTypes; }; diff --git a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 index 137401e5b..2096f1a67 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 @@ -15,25 +15,25 @@ function Set-xSPWebApplicationBlockedFileTypes { [CmdletBinding()] param( [parameter(Mandatory = $true)] $WebApplication, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $Settings + [parameter(Mandatory = $true)] $Settings ) - if ((Test-xSharePointObjectHasProperty $Settings "Blocked") -eq $true -and ((Test-xSharePointObjectHasProperty $Settings "EnsureBlocked") -eq $true -or (Test-xSharePointObjectHasProperty $Settings "EnsureAllowed") -eq $true)) { + if (($Settings.ContainsKey("Blocked") -eq $true) -and (($Settings.ContainsKey("EnsureBlocked") -eq $true) -or ($Settings.ContainsKey("EnsureAllowed") -eq $true))) { throw "Blocked file types must use either the 'blocked' property or the 'EnsureBlocked' and/or 'EnsureAllowed' properties, but not both." } - if ((Test-xSharePointObjectHasProperty $Settings "Blocked") -eq $false -and (Test-xSharePointObjectHasProperty $Settings "EnsureBlocked") -eq $false -and (Test-xSharePointObjectHasProperty $Settings "EnsureAllowed") -eq $false) { + if (($Settings.ContainsKey("Blocked") -eq $false) -and ($Settings.ContainsKey("EnsureBlocked") -eq $false) -and ($Settings.ContainsKey("EnsureAllowed") -eq $false)) { throw "Blocked file types must specify at least one property (either 'Blocked, 'EnsureBlocked' or 'EnsureAllowed')" } - if((Test-xSharePointObjectHasProperty $Settings "Blocked") -eq $true) { + if($Settings.ContainsKey("Blocked") -eq $true) { $WebApplication.BlockedFileExtensions.Clear(); $Settings.Blocked | ForEach-Object { $WebApplication.BlockedFileExtensions.Add($_.ToLower()); } } - if((Test-xSharePointObjectHasProperty $Settings "EnsureBlocked") -eq $true) { + if($Settings.ContainsKey("EnsureBlocked") -eq $true) { $Settings.EnsureBlocked | ForEach-Object { if(!$WebApplication.BlockedFileExtensions.Contains($_.ToLower())){ $WebApplication.BlockedFileExtensions.Add($_.ToLower()); @@ -41,7 +41,7 @@ function Set-xSPWebApplicationBlockedFileTypes { } } - if((Test-xSharePointObjectHasProperty $Settings "EnsureAllowed") -eq $true) { + if($Settings.ContainsKey("EnsureAllowed") -eq $true) { $Settings.EnsureAllowed | ForEach-Object { if($WebApplication.BlockedFileExtensions.Contains($_.ToLower())){ $WebApplication.BlockedFileExtensions.Remove($_.ToLower()); @@ -55,28 +55,27 @@ function Test-xSPWebApplicationBlockedFileTypes { [OutputType([System.Boolean])] param( [parameter(Mandatory = $true)] $CurrentSettings, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $DesiredSettings + [parameter(Mandatory = $true)] $DesiredSettings ) - Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.Util\xSharePoint.Util.psm1" -Resolve) - if ((Test-xSharePointObjectHasProperty $DesiredSettings "Blocked") -eq $true -and ((Test-xSharePointObjectHasProperty $DesiredSettings "EnsureBlocked") -eq $true -or (Test-xSharePointObjectHasProperty $DesiredSettings "EnsureAllowed") -eq $true)) { + if (($DesiredSettings.ContainsKey("Blocked") -eq $true) -and (($DesiredSettings.ContainsKey("EnsureBlocked") -eq $true) -or ($DesiredSettings.ContainsKey("EnsureAllowed") -eq $true))) { throw "Blocked file types must use either the 'blocked' property or the 'EnsureBlocked' and/or 'EnsureAllowed' properties, but not both." } - if ((Test-xSharePointObjectHasProperty $DesiredSettings "Blocked") -eq $false -and (Test-xSharePointObjectHasProperty $DesiredSettings "EnsureBlocked") -eq $false -and (Test-xSharePointObjectHasProperty $DesiredSettings "EnsureAllowed") -eq $false) { + if (($DesiredSettings.ContainsKey("Blocked") -eq $false) -and ($DesiredSettings.ContainsKey("EnsureBlocked") -eq $false) -and ($DesiredSettings.ContainsKey("EnsureAllowed") -eq $false)) { throw "Blocked file types must specify at least one property (either 'Blocked, 'EnsureBlocked' or 'EnsureAllowed')" } - if((Test-xSharePointObjectHasProperty $DesiredSettings "Blocked") -eq $true) { + if($DesiredSettings.ContainsKey("Blocked") -eq $true) { $compareResult = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.Blocked if ($compareResult -eq $null) { return $true } else { return $false } } - if((Test-xSharePointObjectHasProperty $DesiredSettings "EnsureBlocked") -eq $true) { + if($DesiredSettings.ContainsKey("EnsureBlocked") -eq $true) { $itemsToRemove = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.EnsureBlocked -ExcludeDifferent if ($itemsToRemove -ne $null) { return $false } } - if((Test-xSharePointObjectHasProperty $DesiredSettings "EnsureAllowed") -eq $true) { + if($DesiredSettings.ContainsKey("EnsureAllowed") -eq $true) { $itemsToAdd = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.EnsureAllowed | Where-Object { $_.SideIndicator -eq "=>"} if ($itemsToAdd -ne $null) { $compareResult = Compare-Object -ReferenceObject $DesiredSettings.EnsureAllowed -DifferenceObject $itemsToAdd.InputObject diff --git a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.GeneralSettings.psm1 b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.GeneralSettings.psm1 index 81c37ac6e..feb2197c3 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.GeneralSettings.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.GeneralSettings.psm1 @@ -28,7 +28,7 @@ function Set-xSPWebApplicationGeneralSettings { [CmdletBinding()] param( [parameter(Mandatory = $true)] $WebApplication, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $Settings + [parameter(Mandatory = $true)] $Settings ) # Format here is SPWebApplication property = Custom settings property @@ -67,7 +67,7 @@ function Test-xSPWebApplicationGeneralSettings { [OutputType([System.Boolean])] param( [parameter(Mandatory = $true)] $CurrentSettings, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $DesiredSettings + [parameter(Mandatory = $true)] $DesiredSettings ) diff --git a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 index 2335d377c..cf6dff20f 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Throttling.psm1 @@ -27,7 +27,7 @@ function Set-xSPWebApplicationThrottlingSettings { [CmdletBinding()] param( [parameter(Mandatory = $true)] $WebApplication, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $Settings + [parameter(Mandatory = $true)] $Settings ) # Format here is SPWebApplication property = Custom settings property @@ -65,7 +65,7 @@ function Set-xSPWebApplicationHappyHourSettings { [CmdletBinding()] param( [parameter(Mandatory = $true)] $WebApplication, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $Settings + [parameter(Mandatory = $true)] $Settings ) if ((Test-xSharePointObjectHasProperty $Settings "Hour") -eq $false -or (Test-xSharePointObjectHasProperty $Settings "Minute") -eq $false -or (Test-xSharePointObjectHasProperty $Settings "Duration") -eq $false) { @@ -89,7 +89,7 @@ function Test-xSPWebApplicationThrottlingSettings { [OutputType([System.Boolean])] param( [parameter(Mandatory = $true)] $CurrentSettings, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $DesiredSettings + [parameter(Mandatory = $true)] $DesiredSettings ) Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.Util\xSharePoint.Util.psm1" -Resolve) diff --git a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Workflow.psm1 b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Workflow.psm1 index aa3a80634..8a6485c3c 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Workflow.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.Workflow.psm1 @@ -15,15 +15,15 @@ function Set-xSPWebApplicationWorkflowSettings { [CmdletBinding()] param( [parameter(Mandatory = $true)] $WebApplication, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $Settings + [parameter(Mandatory = $true)] $Settings ) - if((Test-xSharePointObjectHasProperty $Settings "UserDefinedWorkflowsEnabled") -eq $true) { + if($Settings.ContainsKey("UserDefinedWorkflowsEnabled") -eq $true) { $WebApplication.UserDefinedWorkflowsEnabled = $Settings.UserDefinedWorkflowsEnabled; } - if((Test-xSharePointObjectHasProperty $Settings "EmailToNoPermissionWorkflowParticipantsEnable") -eq $true) { + if($Settings.ContainsKey("EmailToNoPermissionWorkflowParticipantsEnable") -eq $true) { $WebApplication.EmailToNoPermissionWorkflowParticipantsEnabled = $Settings.EmailToNoPermissionWorkflowParticipantsEnable; } - if((Test-xSharePointObjectHasProperty $Settings "ExternalWorkflowParticipantsEnabled") -eq $true) { + if($Settings.ContainsKey("ExternalWorkflowParticipantsEnabled") -eq $true) { $WebApplication.ExternalWorkflowParticipantsEnabled = $Settings.ExternalWorkflowParticipantsEnabled; } $WebApplication.UpdateWorkflowConfigurationSettings(); @@ -34,7 +34,7 @@ function Test-xSPWebApplicationWorkflowSettings { [OutputType([System.Boolean])] param( [parameter(Mandatory = $true)] $CurrentSettings, - [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance] $DesiredSettings + [parameter(Mandatory = $true)] $DesiredSettings ) Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.Util\xSharePoint.Util.psm1" -Resolve) diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebAppBlockedFileTypes.Tests.ps1 similarity index 86% rename from Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 rename to Tests/xSharePoint/xSharePoint.xSPWebAppBlockedFileTypes.Tests.ps1 index 786582648..81d906782 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.BlockedFileTypes.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebAppBlockedFileTypes.Tests.ps1 @@ -9,20 +9,14 @@ Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule -$ModuleName = "MSFT_xSPWebApplication" +$ModuleName = "MSFT_xSPWebAppBlockedFileTypes" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Describe "xSPWebApplication (Blocked file types)" { +Describe "xSPWebAppBlockedFileTypes" { InModuleScope $ModuleName { $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ - Blocked = @("exe", "dll", "ps1") - } -ClientOnly) + Blocked = @("exe", "dll", "ps1") } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") @@ -116,15 +110,9 @@ Describe "xSPWebApplication (Blocked file types)" { } $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ - EnsureBlocked = @("exe") - EnsureAllowed = @("pdf") - } -ClientOnly) + EnsureBlocked = @("exe") + EnsureAllowed = @("pdf") } Context "The web appliation exists and a list of types to include and exclude both match" { @@ -233,16 +221,10 @@ Describe "xSPWebApplication (Blocked file types)" { } $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ - Blocked = @("exe", "dll", "ps1") - EnsureBlocked = @("exe", "dll") - EnsureAllowed = @("ps1") - } -ClientOnly) + Blocked = @("exe", "dll", "ps1") + EnsureBlocked = @("exe", "dll") + EnsureAllowed = @("ps1") } It "throws an exception on the test method" { @@ -282,13 +264,7 @@ Describe "xSPWebApplication (Blocked file types)" { } $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - BlockedFileTypes = (New-CimInstance -ClassName MSFT_xSPBlockedFileTypes -Property @{ - } -ClientOnly) } It "throws an exception on the test method" { diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.GeneralSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebAppGeneralSettings.Tests.ps1 similarity index 67% rename from Tests/xSharePoint/xSharePoint.xSPWebApplication.GeneralSettings.Tests.ps1 rename to Tests/xSharePoint/xSharePoint.xSPWebAppGeneralSettings.Tests.ps1 index 48063a362..154fc4bc2 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.GeneralSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebAppGeneralSettings.Tests.ps1 @@ -9,35 +9,29 @@ Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule -$ModuleName = "MSFT_xSPWebApplication" +$ModuleName = "MSFT_xSPWebAppGeneralSettings" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Describe "xSPWebApplication (General Settings)" { +Describe "xSPWebAppGeneralSettings" { InModuleScope $ModuleName { $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - GeneralSettings = (New-CimInstance -ClassName MSFT_xSPWebApplicationSettings -Property @{ - TimeZone = 3081 - Alerts = $true - AlertsLimit = 10 - RSS = $true - BlogAPI = $true - BlogAPIAuthenticated = $true - BrowserFileHandling = "Permissive" - SecurityValidation = $true - RecycleBinEnabled = $true - RecycleBinCleanupEnabled = $true - RecycleBinRetentionPeriod = 30 - SecondStageRecycleBinQuota = 30 - MaximumUploadSize = 100 - CustomerExperienceProgram = $true - PresenceEnabled = $true - } -ClientOnly) + TimeZone = 3081 + Alerts = $true + AlertsLimit = 10 + RSS = $true + BlogAPI = $true + BlogAPIAuthenticated = $true + BrowserFileHandling = "Permissive" + SecurityValidation = $true + RecycleBinEnabled = $true + RecycleBinCleanupEnabled = $true + RecycleBinRetentionPeriod = 30 + SecondStageRecycleBinQuota = 30 + MaximumUploadSize = 100 + CustomerExperienceProgram = $true + PresenceEnabled = $true } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") @@ -70,23 +64,23 @@ Describe "xSPWebApplication (General Settings)" { @{ Path = "C:\inetpub\wwwroot\something" } ) Url = $testParams.Url - DefaultTimeZone = $testParams.GeneralSettings.TimeZone - AlertsEnabled = $testParams.GeneralSettings.Alerts - AlertsMaximum = $testParams.GeneralSettings.AlertsLimit - SyndicationEnabled = $testParams.GeneralSettings.RSS - MetaWeblogEnabled = $testParams.GeneralSettings.BlogAPI - MetaWeblogAuthenticationEnabled = $testParams.GeneralSettings.BlogAPIAuthenticated - BrowserFileHandling = $testParams.GeneralSettings.BrowserFileHandling + DefaultTimeZone = $testParams.TimeZone + AlertsEnabled = $testParams.Alerts + AlertsMaximum = $testParams.AlertsLimit + SyndicationEnabled = $testParams.RSS + MetaWeblogEnabled = $testParams.BlogAPI + MetaWeblogAuthenticationEnabled = $testParams.BlogAPIAuthenticated + BrowserFileHandling = $testParams.BrowserFileHandling FormDigestSettings = @{ - Enabled = $testParams.GeneralSettings.SecurityValidation + Enabled = $testParams.SecurityValidation } - RecycleBinEnabled = $testParams.GeneralSettings.RecycleBinEnabled - RecycleBinCleanupEnabled = $testParams.GeneralSettings.RecycleBinCleanupEnabled - RecycleBinRetentionPeriod = $testParams.GeneralSettings.RecycleBinRetentionPeriod - SecondStageRecycleBinQuota = $testParams.GeneralSettings.SecondStageRecycleBinQuota - MaximumFileSize = $testParams.GeneralSettings.MaximumUploadSize - BrowserCEIPEnabled = $testParams.GeneralSettings.CustomerExperienceProgram - PresenceEnabled = $testParams.GeneralSettings.PresenceEnabled + RecycleBinEnabled = $testParams.RecycleBinEnabled + RecycleBinCleanupEnabled = $testParams.RecycleBinCleanupEnabled + RecycleBinRetentionPeriod = $testParams.RecycleBinRetentionPeriod + SecondStageRecycleBinQuota = $testParams.SecondStageRecycleBinQuota + MaximumFileSize = $testParams.MaximumUploadSize + BrowserCEIPEnabled = $testParams.CustomerExperienceProgram + PresenceEnabled = $testParams.PresenceEnabled } $webApp = $webApp | Add-Member ScriptMethod Update { $Global:xSPWebApplicationUpdateCalled = $true @@ -154,7 +148,7 @@ Describe "xSPWebApplication (General Settings)" { } $Global:xSPWebApplicationUpdateCalled = $false - It "updates the workflow settings" { + It "updates the general settings" { Set-TargetResource @testParams $Global:xSPWebApplicationUpdateCalled | Should Be $true } diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Throttling.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebAppThrottlingSettings.Tests.ps1 similarity index 73% rename from Tests/xSharePoint/xSharePoint.xSPWebApplication.Throttling.Tests.ps1 rename to Tests/xSharePoint/xSharePoint.xSPWebAppThrottlingSettings.Tests.ps1 index d11984155..22dff8dfd 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Throttling.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebAppThrottlingSettings.Tests.ps1 @@ -9,34 +9,28 @@ Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule -$ModuleName = "MSFT_xSPWebApplication" +$ModuleName = "MSFT_xSPWebAppThrottlingSettings" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Describe "xSPWebApplication (Throttling)" { +Describe "xSPWebAppThrottlingSettings" { InModuleScope $ModuleName { $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - ThrottlingSettings = (New-CimInstance -ClassName MSFT_xSPWebApplicationThrottling -Property @{ - ListViewThreshold = 1000 - AllowObjectModelOverride = $true - AdminThreshold = 2000 - ListViewLookupThreshold = 12 - HappyHourEnabled = $true - HappyHour = (New-CimInstance -ClassName MSFT_xSPWebApplicationHappyHour -Property @{ - Hour = 2 - Minute = 0 - Duration = 1 - } -ClientOnly) - UniquePermissionThreshold = 100 - RequestThrottling = $true - ChangeLogEnabled = $true - ChangeLogExpiryDays = 30 - EventHandlersEnabled = $true + ListViewThreshold = 1000 + AllowObjectModelOverride = $true + AdminThreshold = 2000 + ListViewLookupThreshold = 12 + HappyHourEnabled = $true + HappyHour = (New-CimInstance -ClassName MSFT_xSPWebApplicationHappyHour -Property @{ + Hour = 2 + Minute = 0 + Duration = 1 } -ClientOnly) + UniquePermissionThreshold = 100 + RequestThrottling = $true + ChangeLogEnabled = $true + ChangeLogExpiryDays = 30 + EventHandlersEnabled = $true } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") @@ -68,23 +62,23 @@ Describe "xSPWebApplication (Throttling)" { @{ Path = "C:\inetpub\wwwroot\something" } ) Url = $testParams.Url - MaxItemsPerThrottledOperation = $testParams.ThrottlingSettings.ListViewThreshold - AllowOMCodeOverrideThrottleSettings = $testParams.ThrottlingSettings.AllowObjectModelOverride - MaxItemsPerThrottledOperationOverride = $testParams.ThrottlingSettings.AdminThreshold - MaxQueryLookupFields = $testParams.ThrottlingSettings.ListViewLookupThreshold - UnthrottledPrivilegedOperationWindowEnabled = $testParams.ThrottlingSettings.HappyHourEnabled - DailyStartUnthrottledPrivilegedOperationsHour = $testParams.ThrottlingSettings.HappyHour.Hour - DailyStartUnthrottledPrivilegedOperationsMinute = $testParams.ThrottlingSettings.HappyHour.Minute - DailyUnthrottledPrivilegedOperationsDuration = $testParams.ThrottlingSettings.HappyHour.Duration - MaxUniquePermScopesPerList = $testParams.ThrottlingSettings.UniquePermissionThreshold + MaxItemsPerThrottledOperation = $testParams.ListViewThreshold + AllowOMCodeOverrideThrottleSettings = $testParams.AllowObjectModelOverride + MaxItemsPerThrottledOperationOverride = $testParams.AdminThreshold + MaxQueryLookupFields = $testParams.ListViewLookupThreshold + UnthrottledPrivilegedOperationWindowEnabled = $testParams.HappyHourEnabled + DailyStartUnthrottledPrivilegedOperationsHour = $testParams.HappyHour.Hour + DailyStartUnthrottledPrivilegedOperationsMinute = $testParams.HappyHour.Minute + DailyUnthrottledPrivilegedOperationsDuration = $testParams.HappyHour.Duration + MaxUniquePermScopesPerList = $testParams.UniquePermissionThreshold HttpThrottleSettings = @{ - PerformThrottle = $testParams.ThrottlingSettings.RequestThrottling + PerformThrottle = $testParams.RequestThrottling } - ChangeLogExpirationEnabled = $testParams.ThrottlingSettings.ChangeLogEnabled + ChangeLogExpirationEnabled = $testParams.ChangeLogEnabled ChangeLogRetentionPeriod = @{ - Days = $testParams.ThrottlingSettings.ChangeLogExpiryDays + Days = $testParams.ChangeLogExpiryDays } - EventHandlersEnabled = $testParams.ThrottlingSettings.EventHandlersEnabled + EventHandlersEnabled = $testParams.EventHandlersEnabled })} It "returns the current data from the get method" { @@ -115,22 +109,22 @@ Describe "xSPWebApplication (Throttling)" { ) Url = $testParams.Url MaxItemsPerThrottledOperation = 1 - AllowOMCodeOverrideThrottleSettings = $testParams.ThrottlingSettings.AllowObjectModelOverride - MaxItemsPerThrottledOperationOverride = $testParams.ThrottlingSettings.AdminThreshold - MaxQueryLookupFields = $testParams.ThrottlingSettings.ListViewLookupThreshold - UnthrottledPrivilegedOperationWindowEnabled = $testParams.ThrottlingSettings.HappyHourEnabled - DailyStartUnthrottledPrivilegedOperationsHour = $testParams.ThrottlingSettings.HappyHour.Hour - DailyStartUnthrottledPrivilegedOperationsMinute = $testParams.ThrottlingSettings.HappyHour.Minute - DailyUnthrottledPrivilegedOperationsDuration = $testParams.ThrottlingSettings.HappyHour.Duration - MaxUniquePermScopesPerList = $testParams.ThrottlingSettings.UniquePermissionThreshold + AllowOMCodeOverrideThrottleSettings = $testParams.AllowObjectModelOverride + MaxItemsPerThrottledOperationOverride = $testParams.AdminThreshold + MaxQueryLookupFields = $testParams.ListViewLookupThreshold + UnthrottledPrivilegedOperationWindowEnabled = $testParams.HappyHourEnabled + DailyStartUnthrottledPrivilegedOperationsHour = $testParams.HappyHour.Hour + DailyStartUnthrottledPrivilegedOperationsMinute = $testParams.HappyHour.Minute + DailyUnthrottledPrivilegedOperationsDuration = $testParams.HappyHour.Duration + MaxUniquePermScopesPerList = $testParams.UniquePermissionThreshold HttpThrottleSettings = @{ - PerformThrottle = $testParams.ThrottlingSettings.RequestThrottling + PerformThrottle = $testParams.RequestThrottling } - ChangeLogExpirationEnabled = $testParams.ThrottlingSettings.ChangeLogEnabled + ChangeLogExpirationEnabled = $testParams.ChangeLogEnabled ChangeLogRetentionPeriod = @{ - Days = $testParams.ThrottlingSettings.ChangeLogExpiryDays + Days = $testParams.ChangeLogExpiryDays } - EventHandlersEnabled = $testParams.ThrottlingSettings.EventHandlersEnabled + EventHandlersEnabled = $testParams.EventHandlersEnabled } $webApp = $webApp | Add-Member ScriptMethod Update { $Global:xSPWebApplicationUpdateCalled = $true @@ -156,28 +150,22 @@ Describe "xSPWebApplication (Throttling)" { } $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - ThrottlingSettings = (New-CimInstance -ClassName MSFT_xSPWebApplicationThrottling -Property @{ - ListViewThreshold = 1000 - AllowObjectModelOverride = $true - AdminThreshold = 2000 - ListViewLookupThreshold = 12 - HappyHourEnabled = $true - HappyHour = (New-CimInstance -ClassName MSFT_xSPWebApplicationHappyHour -Property @{ - Hour = 5 - Minute = 0 - Duration = 1 - } -ClientOnly) - UniquePermissionThreshold = 100 - RequestThrottling = $true - ChangeLogEnabled = $true - ChangeLogExpiryDays = 30 - EventHandlersEnabled = $true + ListViewThreshold = 1000 + AllowObjectModelOverride = $true + AdminThreshold = 2000 + ListViewLookupThreshold = 12 + HappyHourEnabled = $true + HappyHour = (New-CimInstance -ClassName MSFT_xSPWebApplicationHappyHour -Property @{ + Hour = 5 + Minute = 0 + Duration = 1 } -ClientOnly) + UniquePermissionThreshold = 100 + RequestThrottling = $true + ChangeLogEnabled = $true + ChangeLogExpiryDays = 30 + EventHandlersEnabled = $true } $Global:xSPWebApplicationUpdateCalled = $false $Global:xSPWebApplicationUpdateHappyHourCalled = $false diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Workflow.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebAppWorkflowSettings.Tests.ps1 similarity index 88% rename from Tests/xSharePoint/xSharePoint.xSPWebApplication.Workflow.Tests.ps1 rename to Tests/xSharePoint/xSharePoint.xSPWebAppWorkflowSettings.Tests.ps1 index 9f346519d..78695e312 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Workflow.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebAppWorkflowSettings.Tests.ps1 @@ -9,22 +9,16 @@ Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule -$ModuleName = "MSFT_xSPWebApplication" +$ModuleName = "MSFT_xSPWebAppWorkflowSettings" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Describe "xSPWebApplication (Workflow)" { +Describe "xSPWebAppWorkflowSettings" { InModuleScope $ModuleName { $testParams = @{ - Name = "SharePoint Sites" - ApplicationPool = "SharePoint Web Apps" - ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" - AuthenticationMethod = "NTLM" - WorkflowSettings = (New-CimInstance -ClassName MSFT_xSPWebApplicationWorkflowSettings -Property @{ - ExternalWorkflowParticipantsEnabled = $true - UserDefinedWorkflowsEnabled = $true - EmailToNoPermissionWorkflowParticipantsEnable = $true - } -ClientOnly) + ExternalWorkflowParticipantsEnabled = $true + UserDefinedWorkflowsEnabled = $true + EmailToNoPermissionWorkflowParticipantsEnable = $true } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") From b5095c96c8a04f155e269643a10a0222f904a615 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 12:16:54 +1100 Subject: [PATCH 06/19] Fixed formatting --- .../MSFT_xSPWebAppBlockedFileTypes.schema.mof | 2 +- .../MSFT_xSPWebAppGeneralSettings.schema.mof | 2 +- .../MSFT_xSPWebAppThrottlingSettings.schema.mof | 2 +- .../MSFT_xSPWebAppWorkflowSettings.schema.mof | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof index 993caed58..51daffbcc 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -5,5 +5,5 @@ Class MSFT_xSPBlockedFileTypes [write] string Blocked[]; [write] string EnsureBlocked[]; [write] string EnsureAllowed[]; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof index b31f2b26d..f902a80bb 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof @@ -17,5 +17,5 @@ Class MSFT_xSPWebAppGeneralSettings [write] uint32 MaximumUploadSize; [write] boolean CustomerExperienceProgram; [write] boolean PresenceEnabled; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof index eaa3ddb15..b81d155fd 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof @@ -22,5 +22,5 @@ Class MSFT_xSPWebAppThrottlingSettings [write] boolean ChangeLogEnabled; [write] uint32 ChangeLogExpiryDays; [write] boolean EventHandlersEnabled; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof index 3cfcd9edd..d9cb8ee71 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof @@ -5,5 +5,5 @@ Class MSFT_xSPWebAppWorkflowSettings [write] boolean ExternalWorkflowParticipantsEnabled; [write] boolean UserDefinedWorkflowsEnabled; [write] boolean EmailToNoPermissionWorkflowParticipantsEnable; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; \ No newline at end of file From 860aa934e882b48845e915c34a88d1927b75cac1 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 12:47:04 +1100 Subject: [PATCH 07/19] Updated MOF documentation for new types, removed old functionality from xSPWebApplication --- .../MSFT_xSPWebAppBlockedFileTypes.schema.mof | 23 +++++- .../MSFT_xSPWebAppGeneralSettings.schema.mof | 20 ++++- ...SFT_xSPWebAppThrottlingSettings.schema.mof | 24 ++++++ .../MSFT_xSPWebAppWorkflowSettings.schema.mof | 19 ++++- .../MSFT_xSPWebApplication.psm1 | 82 ------------------- 5 files changed, 83 insertions(+), 85 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof index 51daffbcc..9772b383c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -1,4 +1,25 @@ -[ClassVersion("1.0.0"), FriendlyName("xSPBlockedFileTypes")] +/* +**Description** + +This resource is responsible for controlling the blocked file type setting on a specific web application. +It has two modes of operation, the first is to use the 'blocked' property, where you are able to define a specific list of file types that will be blocked. +In this mode when it is detected that the list does not match the local farm, it is set to match this list exactly. +The second mode is to use the 'EnsureBlocked' and 'EnsureAllowed' properties. +EnsureBlocked will check to make sure that the specified file types are on the list, and if not they will be added. +EnsureAllowed checks to make sure that a file type is not on the list, and if it is it will be removed. +Both of these properties will only make changes to the file types in their list and will leave the full list as it is otherwise, whereas the blocked property resets the list in full. + +**Example** + + xSPBlockedFileTypes PrimaryWebAppBlockedFileTypes + { + Url = "Shttp://exmaple.contoso.local" + EnsureBlocked = @("exe", "dll", "msi") + EnsureAllowed = @("pdf", "docx", "xlsx") + PsDscRunAsCredential = $InstallAccount + } +*/ +[ClassVersion("1.0.0"), FriendlyName("xSPBlockedFileTypes")] Class MSFT_xSPBlockedFileTypes { [Key] string Url; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof index f902a80bb..2ab9efff9 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof @@ -1,4 +1,22 @@ -[ClassVersion("1.0.0"), FriendlyName("xSPWebAppGeneralSettings")] +/* +**Description** + +This resource is responsible for setting web application settings that are found under the "general settings" screen in central admin. +The web application is specified through the URL property, and then any combination of settings can be applied. +Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). + +**Example** + + xSPWebAppGeneralSettings PrimaryWebAppGeneralSettings + { + Url = "Shttp://exmaple.contoso.local" + TimeZone = 76 + Alerts = $true + RSS = $false + PsDscRunAsCredential = $InstallAccount + } +*/ +[ClassVersion("1.0.0"), FriendlyName("xSPWebAppGeneralSettings")] Class MSFT_xSPWebAppGeneralSettings { [Key] string Url; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof index b81d155fd..4284eba39 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof @@ -6,7 +6,31 @@ Class MSFT_xSPWebApplicationHappyHour [write] uint32 Duration; }; +/* +**Description** +This resource is responsible for setting web application settings that are found under the "resource throttling" screen in central admin. +The web application is specified through the URL property, and then any combination of settings can be applied. +Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). +Happy hour is the setting used to control the window where threshold do not apply throughout the day. +You can specify the start time of this window as well as how many hours it will last. + +**Example** + + xSPWebAppThrottlingSettings PrimaryWebAppThrottlingSettings + { + Url = "Shttp://exmaple.contoso.local" + ListViewThreshold = 5000 + AllowObjectModelOverride = $false + HappyHourEnabled = $true + HappyHour = MSFT_xSPWebApplicationHappyHour { + Hour = 3 + Minute = 0 + Duration = 1 + } + PsDscRunAsCredential = $InstallAccount + } +*/ [ClassVersion("1.0.0"), FriendlyName("xSPWebAppThrottlingSettings")] Class MSFT_xSPWebAppThrottlingSettings { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof index d9cb8ee71..d91fdbfee 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof @@ -1,4 +1,21 @@ -[ClassVersion("1.0.0"), FriendlyName("xSPWebAppWorkflowSettings")] +/* +**Description** + +This resource is responsible for setting web application settings that are found under the "workflow settings" screen in central admin. +The web application is specified through the URL property, and then any combination of settings can be applied. +Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). + +**Example** + + xSPWebAppWorkflowSettings PrimaryWebAppWorkflowSettings + { + Url = "Shttp://exmaple.contoso.local" + ExternalWorkflowParticipantsEnabled = $false + EmailToNoPermissionWorkflowParticipantsEnable = $false + PsDscRunAsCredential = $InstallAccount + } +*/ +[ClassVersion("1.0.0"), FriendlyName("xSPWebAppWorkflowSettings")] Class MSFT_xSPWebAppWorkflowSettings { [Key] string Url; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index fd2359148..1aaffa8cc 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -30,11 +30,6 @@ function Get-TargetResource $authProvider = Get-SPAuthenticationProvider -WebApplication $wa.Url -Zone "Default" if ($authProvider.DisableKerberos -eq $true) { $localAuthMode = "NTLM" } else { $localAuthMode = "Kerberos" } - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Workflow.psm1" -Resolve) - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.BlockedFileTypes.psm1" -Resolve) - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.GeneralSettings.psm1" -Resolve) - return @{ Name = $wa.DisplayName ApplicationPool = $wa.ApplicationPool.Name @@ -48,10 +43,6 @@ function Get-TargetResource Port = (New-Object System.Uri $wa.Url).Port AuthenticationMethod = $localAuthMode InstallAccount = $params.InstallAccount - ThrottlingSettings = (Get-xSPWebApplicationThrottlingSettings -WebApplication $wa) - WorkflowSettings = (Get-xSPWebApplicationWorkflowSettings -WebApplication $wa) - BlockedFileTypes = (Get-xSPWebApplicationBlockedFileTypes -WebApplication $wa) - GeneralSettings = (Get-xSPWebApplicationGeneralSettings -WebApplication $wa) } } return $result @@ -109,48 +100,6 @@ function Set-TargetResource $wa = New-SPWebApplication @newWebAppParams } - - # Resource throttling settings - if ($params.ContainsKey("ThrottlingSettings") -eq $true) { - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) - Set-xSPWebApplicationThrottlingSettings -WebApplication $wa -Settings $params.ThrottlingSettings - } - - # Blocked file types - if ($params.ContainsKey("BlockedFileTypes") -eq $true) { - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.BlockedFileTypes.psm1" -Resolve) - Set-xSPWebApplicationBlockedFileTypes -WebApplication $wa -Settings $params.BlockedFileTypes - } - - # General Settings - if ($params.ContainsKey("GeneralSettings") -eq $true) { - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.GeneralSettings.psm1" -Resolve) - Set-xSPWebApplicationGeneralSettings -WebApplication $wa -Settings $params.GeneralSettings - } - - if( ($params.GeneralSettings -ne $null) -or - ($params.ThrottlingSettings -ne $null) -or - ($params.BlockedFileTypes -ne $null) ) { - $wa.Update() - } - - # Workflow settings - if ($params.ContainsKey("WorkflowSettings") -eq $true) { - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Workflow.psm1" -Resolve) - # Workflow uses a seperate update method, to avoid update conflicts get a fresh web app object - $wa2 = Get-SPWebApplication -Identity $params.Name - Set-xSPWebApplicationWorkflowSettings -WebApplication $wa2 -Settings $params.WorkflowSettings - } - - # Happy hour settings - if ($params.ContainsKey("ThrottlingSettings") -eq $true) { - if ((Test-xSharePointObjectHasProperty $params.ThrottlingSettings "HappyHour") -eq $true) { - Import-Module (Join-Path $ScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) - # Happy hour settins use separate update method so use a fresh web app to update these - $wa3 = Get-SPWebApplication -Identity $params.Name - Set-xSPWebApplicationHappyHourSettings -WebApplication $wa3 -Settings $params.ThrottlingSettings.HappyHour - } - } } } @@ -182,37 +131,6 @@ function Test-TargetResource $testReturn = Test-xSharePointSpecificParameters -CurrentValues $CurrentValues ` -DesiredValues $PSBoundParameters ` -ValuesToCheck @("ApplicationPool") - - if ($testReturn -eq $false) { return $false } - - # Resource throttling settings - if ($PSBoundParameters.ContainsKey("ThrottlingSettings") -eq $true) { - Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Throttling.psm1" -Resolve) - $testReturn = Test-xSPWebApplicationThrottlingSettings -CurrentSettings $CurrentValues.ThrottlingSettings -DesiredSettings $ThrottlingSettings - } - if ($testReturn -eq $false) { return $false } - - # Workflow settings - if ($PSBoundParameters.ContainsKey("WorkflowSettings") -eq $true) { - Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.Workflow.psm1" -Resolve) - $testReturn = Test-xSPWebApplicationWorkflowSettings -CurrentSettings $CurrentValues.WorkflowSettings -DesiredSettings $WorkflowSettings - } - if ($testReturn -eq $false) { return $false } - - # Blocked file types - if ($PSBoundParameters.ContainsKey("BlockedFileTypes") -eq $true) { - Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.BlockedFileTypes.psm1" -Resolve) - $testReturn = Test-xSPWebApplicationBlockedFileTypes -CurrentSettings $CurrentValues.BlockedFileTypes -DesiredSettings $BlockedFileTypes - } - if ($testReturn -eq $false) { return $false } - - # General settings - if ($PSBoundParameters.ContainsKey("GeneralSettings") -eq $true) { - Import-Module (Join-Path $PSScriptRoot "..\..\Modules\xSharePoint.WebApplication\xSPWebApplication.GeneralSettings.psm1" -Resolve) - $testReturn = Test-xSPWebApplicationGeneralSettings -CurrentSettings $CurrentValues.GeneralSettings -DesiredSettings $GeneralSettings - } - if ($testReturn -eq $false) { return $false } - return $testReturn } From 20021364ba12e6c2e966a98498e919f3eba9638e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 12:49:17 +1100 Subject: [PATCH 08/19] formatting fixes (again) --- .../MSFT_xSPWebAppBlockedFileTypes.schema.mof | 2 +- .../MSFT_xSPWebAppGeneralSettings.schema.mof | 4 ++-- .../MSFT_xSPWebAppThrottlingSettings.schema.mof | 14 +++++++------- .../MSFT_xSPWebAppWorkflowSettings.schema.mof | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof index 9772b383c..3e5f65d98 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -15,7 +15,7 @@ Both of these properties will only make changes to the file types in their list { Url = "Shttp://exmaple.contoso.local" EnsureBlocked = @("exe", "dll", "msi") - EnsureAllowed = @("pdf", "docx", "xlsx") + EnsureAllowed = @("pdf", "docx", "xlsx") PsDscRunAsCredential = $InstallAccount } */ diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof index 2ab9efff9..afaa0cfae 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof @@ -11,8 +11,8 @@ Any settings not included will be left as the default (or whatever they have bee { Url = "Shttp://exmaple.contoso.local" TimeZone = 76 - Alerts = $true - RSS = $false + Alerts = $true + RSS = $false PsDscRunAsCredential = $InstallAccount } */ diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof index 4284eba39..a4a69f50d 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof @@ -21,13 +21,13 @@ You can specify the start time of this window as well as how many hours it will { Url = "Shttp://exmaple.contoso.local" ListViewThreshold = 5000 - AllowObjectModelOverride = $false - HappyHourEnabled = $true - HappyHour = MSFT_xSPWebApplicationHappyHour { - Hour = 3 - Minute = 0 - Duration = 1 - } + AllowObjectModelOverride = $false + HappyHourEnabled = $true + HappyHour = MSFT_xSPWebApplicationHappyHour { + Hour = 3 + Minute = 0 + Duration = 1 + } PsDscRunAsCredential = $InstallAccount } */ diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof index d91fdbfee..a20ff7d52 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof @@ -11,7 +11,7 @@ Any settings not included will be left as the default (or whatever they have bee { Url = "Shttp://exmaple.contoso.local" ExternalWorkflowParticipantsEnabled = $false - EmailToNoPermissionWorkflowParticipantsEnable = $false + EmailToNoPermissionWorkflowParticipantsEnable = $false PsDscRunAsCredential = $InstallAccount } */ From c550b23b058ccb51bbf6a3f4cbf510d45b6bf2f8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 13:16:44 +1100 Subject: [PATCH 09/19] Saved project files with changes --- Modules/xSharePoint/xSharePoint.pssproj | 12 ++++++++++++ Tests/Tests.pssproj | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Modules/xSharePoint/xSharePoint.pssproj b/Modules/xSharePoint/xSharePoint.pssproj index d0d73181d..340a110cd 100644 --- a/Modules/xSharePoint/xSharePoint.pssproj +++ b/Modules/xSharePoint/xSharePoint.pssproj @@ -76,6 +76,10 @@ + + + + @@ -133,8 +137,12 @@ + + + + @@ -147,6 +155,10 @@ + + + + diff --git a/Tests/Tests.pssproj b/Tests/Tests.pssproj index 7d475469d..1ab144884 100644 --- a/Tests/Tests.pssproj +++ b/Tests/Tests.pssproj @@ -72,10 +72,10 @@ - - - - + + + + From fd61125e8b08269933b9177dd652a5228787670f Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 14:20:49 +1100 Subject: [PATCH 10/19] Fixed MOF files base object types --- .../MSFT_xSPWebAppBlockedFileTypes.schema.mof | 4 ++-- .../MSFT_xSPWebAppGeneralSettings.schema.mof | 2 +- .../MSFT_xSPWebAppThrottlingSettings.schema.mof | 2 +- .../MSFT_xSPWebAppWorkflowSettings.schema.mof | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof index 3e5f65d98..e70f46bbc 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -19,8 +19,8 @@ Both of these properties will only make changes to the file types in their list PsDscRunAsCredential = $InstallAccount } */ -[ClassVersion("1.0.0"), FriendlyName("xSPBlockedFileTypes")] -Class MSFT_xSPBlockedFileTypes +[ClassVersion("1.0.0"), FriendlyName("xSPWebAppBlockedFileTypes")] +Class MSFT_xSPBlockedFileTypes : OMI_BaseResource { [Key] string Url; [write] string Blocked[]; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof index afaa0cfae..f6e535682 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof @@ -17,7 +17,7 @@ Any settings not included will be left as the default (or whatever they have bee } */ [ClassVersion("1.0.0"), FriendlyName("xSPWebAppGeneralSettings")] -Class MSFT_xSPWebAppGeneralSettings +Class MSFT_xSPWebAppGeneralSettings : OMI_BaseResource { [Key] string Url; [write] uint32 TimeZone; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof index a4a69f50d..e7673af15 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof @@ -32,7 +32,7 @@ You can specify the start time of this window as well as how many hours it will } */ [ClassVersion("1.0.0"), FriendlyName("xSPWebAppThrottlingSettings")] -Class MSFT_xSPWebAppThrottlingSettings +Class MSFT_xSPWebAppThrottlingSettings : OMI_BaseResource { [Key] string Url; [write] uint32 ListViewThreshold; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof index a20ff7d52..4dfa86c7f 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof @@ -16,7 +16,7 @@ Any settings not included will be left as the default (or whatever they have bee } */ [ClassVersion("1.0.0"), FriendlyName("xSPWebAppWorkflowSettings")] -Class MSFT_xSPWebAppWorkflowSettings +Class MSFT_xSPWebAppWorkflowSettings : OMI_BaseResource { [Key] string Url; [write] boolean ExternalWorkflowParticipantsEnabled; From 0ee8ea17d1a008586aaa1f01960e6cf56a99f93c Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 14:58:25 +1100 Subject: [PATCH 11/19] Updated readme and build for release of v0.8 --- README.md | 15 ++++++++++++++- appveyor.yml | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7c6199a20..1c4eeeeee 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,13 @@ Please read the installation instructions that are present on both the download Below is a list of DSC resource types that are currently provided by xSharePoint: + - xSPAntivirusSettings - xBCSServiceApp - xSPCacheAccounts - - xSPClearRemoteSessions - xSPCreateFarm - xSPDiagnosticLoggingSettings - xSPDistributedCacheService + - xSPFarmAdministrators - xSPFeature - xSPInstall - xSPInstallPreReqs @@ -45,6 +46,8 @@ Below is a list of DSC resource types that are currently provided by xSharePoint - xSPManagedAccount - xSPManagedMetadataServiceApp - xSPManagedPath + - xSPOutgoingEmailSettings + - xSPPasswordChangeSettings - xSPSearchServiceApp - xSPSecureStoreServiceApp - xSPServiceAppPool @@ -54,7 +57,11 @@ Below is a list of DSC resource types that are currently provided by xSharePoint - xSPUsageApplication - xSPUserProfileServiceApp - xSPUserProfileSyncService + - xSPWebAppBlockedFileTypes + - xSPWebAppGeneralSettings - xSPWebApplication + - xSPWebAppThrottlingSettings + - xSPWebAppWorkflowSettings ## Preview status @@ -68,6 +75,12 @@ Additional detailed documentation is included on the wiki on GitHub. ## Version History +### 0.8.0.0 + * Added xSPAntivirusSettings, xSPFarmAdministrators, xSPOutgoingEmailSettings, xSPPasswordChangeSettings, xSPWebAppBlockedFileTypes, xSPWebAppGeneralSettings, xSPWebAppThrottlingSettings and xSPWebAppWorkflowSettings + * Fixed issue with xSPInstallPrereqs using wrong parameters in offline install mode + * Fixed issue with xSPInstallPrereqs where it would not validate that installer paths exist + * Fixed xSPSecureStoreServiceApp and xSPUsageApplication to use PSCredentials instead of plain text username/password for database credentials + ### 0.7.0.0 * Support for MinRole options in SharePoint 2016 diff --git a/appveyor.yml b/appveyor.yml index 689433c22..d8879089c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.7.{build}.0 +version: 0.8.{build}.0 install: - cinst -y pester @@ -27,7 +27,7 @@ after_test: Remove-Item (Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.pssproj") $manifest = Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.psd1" - (Get-Content $manifest -Raw).Replace("0.7.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest + (Get-Content $manifest -Raw).Replace("0.8.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory("$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint", "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip") Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } From 3ea3c80db3c24ac556354d1b1788224c9013732d Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 15:04:40 +1100 Subject: [PATCH 12/19] Fixed incorrect name of MOF type --- .../MSFT_xSPWebAppBlockedFileTypes.schema.mof | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof index e70f46bbc..123a88276 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -20,7 +20,7 @@ Both of these properties will only make changes to the file types in their list } */ [ClassVersion("1.0.0"), FriendlyName("xSPWebAppBlockedFileTypes")] -Class MSFT_xSPBlockedFileTypes : OMI_BaseResource +Class MSFT_xSPWebAppBlockedFileTypes : OMI_BaseResource { [Key] string Url; [write] string Blocked[]; From 3a69969ba2a5ca39a050d6c1dc2cd833bbaf7001 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 3 Dec 2015 15:05:41 +1100 Subject: [PATCH 13/19] Added note about new help to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1c4eeeeee..2b80689fc 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Additional detailed documentation is included on the wiki on GitHub. * Fixed issue with xSPInstallPrereqs using wrong parameters in offline install mode * Fixed issue with xSPInstallPrereqs where it would not validate that installer paths exist * Fixed xSPSecureStoreServiceApp and xSPUsageApplication to use PSCredentials instead of plain text username/password for database credentials + * Added built in PowerShell help (for calling "Get-Help about_[resource]", such as "Get-Help about_xSPCreateFarm") ### 0.7.0.0 From 57a34e86d00213ad29bb995881cb3241822f2c94 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Sat, 5 Dec 2015 18:19:08 +1100 Subject: [PATCH 14/19] Removed reboot after success to prevent reboot looping --- .../MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 index 088d1b7ad..9d27cd391 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 @@ -145,8 +145,7 @@ function Set-TargetResource switch ($process.ExitCode) { 0 { - Write-Verbose -Message "Prerequisite installer completed successfully. Rebooting to finalise installations" - $global:DSCMachineStatus = 1 + Write-Verbose -Message "Prerequisite installer completed successfully." } 1 { throw "Another instance of the prerequisite installer is already running" From 15e48e2643525065c20ad2cb39ce8a8350cb76e7 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Sat, 5 Dec 2015 21:50:21 +1100 Subject: [PATCH 15/19] Fixed prereq list for 2016 and updated windows feature list --- .../MSFT_xSPInstallPrereqs.psm1 | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 index 9d27cd391..46fcce03f 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 @@ -37,10 +37,10 @@ function Get-TargetResource Write-Verbose -Message "Getting installed windows features" if ($majorVersion -eq 15) { - $WindowsFeatures = Get-WindowsFeature -Name Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer + $WindowsFeatures = Get-WindowsFeature -Name Application-Server, AS-NET-Framework, AS-TCP-Port-Sharing, AS-Web-Support, AS-WAS-Support, AS-HTTP-Activation, AS-Named-Pipes, AS-TCP-Activation, Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Cert-Auth, Web-IP-Security, Web-Url-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Scripting, Web-WMI, Web-Scripting-Tools, NET-Framework-Features, NET-Framework-Core, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, NET-WCF-Pipe-Activation45, NET-WCF-TCP-Activation45, Server-Media-Foundation, Windows-Identity-Foundation, PowerShell-V2, WAS, WAS-Process-Model, WAS-NET-Environment, WAS-Config-APIs, XPS-Viewer } if ($majorVersion -eq 16) { - $WindowsFeatures = Get-WindowsFeature -Name Application-Server,AS-NET-Framework,AS-Web-Support,Web-Server,Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Static-Content,Web-Http-Redirect,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Security,Web-Filtering,Web-Basic-Auth,Web-Client-Auth,Web-Digest-Auth,Web-Cert-Auth,Web-IP-Security,Web-Url-Auth,Web-Windows-Auth,Web-App-Dev,Web-Net-Ext,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Web-Lgcy-Mgmt-Console,Web-Lgcy-Scripting,Web-WMI,Web-Scripting-Tools,NET-Framework-Features,NET-Framework-Core,NET-HTTP-Activation,NET-Non-HTTP-Activ,NET-Framework-45-ASPNET,NET-WCF-HTTP-Activation45,Windows-Identity-Foundation,PowerShell-V2,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs + $WindowsFeatures = Get-WindowsFeature -Name Application-Server, AS-NET-Framework, AS-Web-Support, Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Cert-Auth, Web-IP-Security, Web-Url-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Mgmt-Console, Web-Lgcy-Scripting, Web-WMI, Web-Scripting-Tools, NET-Framework-Features, NET-Framework-Core, NET-HTTP-Activation, NET-Non-HTTP-Activ, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, Windows-Identity-Foundation, PowerShell-V2, WAS, WAS-Process-Model, WAS-NET-Environment, WAS-Config-APIs } foreach ($feature in $WindowsFeatures) { @@ -51,26 +51,28 @@ function Get-TargetResource $installedItems = Get-CimInstance -ClassName Win32_Product #Common prereqs - $returnValue.Add("Microsoft Identity Extensions", (@(Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ -Recurse | ? {$_.GetValue("DisplayName") -eq "Microsoft Identity Extensions" }).Count -gt 0)) + $returnValue.Add("AppFabric 1.1 for Windows Server", (($installedItems | ? {$_.Name -eq "AppFabric 1.1 for Windows Server"}) -ne $null)) $returnValue.Add("Microsoft CCR and DSS Runtime 2008 R3", (($installedItems | ? {$_.Name -eq "Microsoft CCR and DSS Runtime 2008 R3"}) -ne $null)) + $returnValue.Add("Microsoft Identity Extensions", (@(Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ -Recurse | ? {$_.GetValue("DisplayName") -eq "Microsoft Identity Extensions" }).Count -gt 0)) $returnValue.Add("Microsoft Sync Framework Runtime v1.0 SP1 (x64)", (($installedItems | ? {$_.Name -eq "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"}) -ne $null)) - $returnValue.Add("AppFabric 1.1 for Windows Server", (($installedItems | ? {$_.Name -eq "AppFabric 1.1 for Windows Server"}) -ne $null)) $returnValue.Add("WCF Data Services 5.6.0 Runtime", (($installedItems | ? {$_.Name -eq "WCF Data Services 5.6.0 Runtime"}) -ne $null)) #SP2013 prereqs if ($majorVersion -eq 15) { - $returnValue.Add("WCF Data Services 5.0 (for OData v3) Primary Components", (($installedItems | ? {$_.Name -eq "WCF Data Services 5.0 (for OData v3) Primary Components"}) -ne $null)) - $returnValue.Add("Microsoft SQL Server 2008 R2 Native Client", (($installedItems | ? {$_.Name -eq "Microsoft SQL Server 2008 R2 Native Client"}) -ne $null)) $returnValue.Add("Active Directory Rights Management Services Client 2.0", (($installedItems | ? {$_.Name -eq "Active Directory Rights Management Services Client 2.0"}) -ne $null)) + $returnValue.Add("Microsoft SQL Server 2008 R2 Native Client", (($installedItems | ? {$_.Name -eq "Microsoft SQL Server 2008 R2 Native Client"}) -ne $null)) + $returnValue.Add("WCF Data Services 5.0 (for OData v3) Primary Components", (($installedItems | ? {$_.Name -eq "WCF Data Services 5.0 (for OData v3) Primary Components"}) -ne $null)) } #SP2016 prereqs if ($majorVersion -eq 16) { - $returnValue.Add("Microsoft ODBC Driver 11 for SQL Server", (($installedItems | ? {$_.Name -eq "Microsoft ODBC Driver 11 for SQL Server"}) -ne $null)) - $returnValue.Add("Microsoft Visual C++ 2013 x64 Minimum Runtime - 12.0.21005", (($installedItems | ? {$_.Name -eq "Microsoft Visual C++ 2013 x64 Minimum Runtime - 12.0.21005"}) -ne $null)) - $returnValue.Add("Microsoft Visual C++ 2013 x64 Additional Runtime - 12.0.21005", (($installedItems | ? {$_.Name -eq "Microsoft Visual C++ 2013 x64 Additional Runtime - 12.0.21005"}) -ne $null)) - $returnValue.Add("Microsoft SQL Server 2012 Native Client", (($installedItems | ? {$_.Name -ne $null -and $_.Name.Trim() -eq "Microsoft SQL Server 2012 Native Client"}) -ne $null)) $returnValue.Add("Active Directory Rights Management Services Client 2.1", (($installedItems | ? {$_.Name -eq "Active Directory Rights Management Services Client 2.1"}) -ne $null)) + $returnValue.Add("Microsoft SQL Server 2012 Native Client", (($installedItems | ? {$_.Name -ne $null -and $_.Name.Trim() -eq "Microsoft SQL Server 2012 Native Client"}) -ne $null)) + $returnValue.Add("Microsoft ODBC Driver 11 for SQL Server", (($installedItems | ? {$_.Name -eq "Microsoft ODBC Driver 11 for SQL Server"}) -ne $null)) + $returnValue.Add("Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030", (($installedItems | ? {$_.Name -eq "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030"}) -ne $null)) + $returnValue.Add("Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030", (($installedItems | ? {$_.Name -eq "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030"}) -ne $null)) + $returnValue.Add("Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.23026", (($installedItems | ? {$_.Name -eq "Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.23026"}) -ne $null)) + $returnValue.Add("Microsoft Visual C++ 2015 x64 Additional Runtime - 14.0.23026", (($installedItems | ? {$_.Name -eq "Microsoft Visual C++ 2015 x64 Additional Runtime - 14.0.23026"}) -ne $null)) } $results = $PSBoundParameters From 9882937ae774e43846c252d46044f1b5eeea2993 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Sat, 5 Dec 2015 21:55:30 +1100 Subject: [PATCH 16/19] Updated tests for prereqs --- Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index 2a63a77fc..4c1aeb030 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -117,8 +117,10 @@ Describe "xSPInstallPrereqs" { @{ Name = "AppFabric 1.1 for Windows Server"} @{ Name = "WCF Data Services 5.6.0 Runtime"} @{ Name = "Microsoft ODBC Driver 11 for SQL Server"} - @{ Name = "Microsoft Visual C++ 2013 x64 Minimum Runtime - 12.0.21005"} - @{ Name = "Microsoft Visual C++ 2013 x64 Additional Runtime - 12.0.21005"} + @{ Name = "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030"} + @{ Name = "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030"} + @{ Name = "Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.23026"} + @{ Name = "Microsoft Visual C++ 2015 x64 Additional Runtime - 14.0.23026"} @{ Name = "Microsoft SQL Server 2012 Native Client"} @{ Name = "Active Directory Rights Management Services Client 2.1"} )} From 45c523b64b0976e3c746ba6041bdd43389893248 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 7 Dec 2015 08:02:19 +1100 Subject: [PATCH 17/19] Fixed detection of objects in test if value exists method --- .../xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 8de5b004d..c858f01d0 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -250,8 +250,7 @@ function Set-xSharePointObjectPropertyIfValueExists() { [parameter(Mandatory = $true,Position=1)] [object] $ParamsValue, [parameter(Mandatory = $true,Position=1)] [string] $ParamKey ) - - if ($ParamsValue.GetType().Name -eq "Hashtable") { + if ($ParamsValue.PSobject.Methods.name -contains "ContainsKey") { if ($ParamsValue.ContainsKey($ParamKey) -eq $true) { $ObjectToSet.$PropertyToSet = $ParamsValue.$ParamKey } From f8d918edbf4d5e48e8b379ab003614a6a8895e98 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 7 Dec 2015 11:56:23 +1100 Subject: [PATCH 18/19] Fixed bug in blocked file types test logic --- .../xSPWebApplication.BlockedFileTypes.psm1 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 index 2096f1a67..3adb153eb 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.WebApplication/xSPWebApplication.BlockedFileTypes.psm1 @@ -71,18 +71,13 @@ function Test-xSPWebApplicationBlockedFileTypes { } if($DesiredSettings.ContainsKey("EnsureBlocked") -eq $true) { - $itemsToRemove = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.EnsureBlocked -ExcludeDifferent - if ($itemsToRemove -ne $null) { return $false } + $itemsToAdd = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.EnsureBlocked | Where-Object { $_.SideIndicator -eq "=>"} + if ($itemsToAdd -ne $null) { return $false } } if($DesiredSettings.ContainsKey("EnsureAllowed") -eq $true) { - $itemsToAdd = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.EnsureAllowed | Where-Object { $_.SideIndicator -eq "=>"} - if ($itemsToAdd -ne $null) { - $compareResult = Compare-Object -ReferenceObject $DesiredSettings.EnsureAllowed -DifferenceObject $itemsToAdd.InputObject - if ($compareResult -ne $null) { return $false } - } else { - return $false - } + $itemsToRemove = Compare-Object -ReferenceObject $CurrentSettings.Blocked -DifferenceObject $DesiredSettings.EnsureAllowed -ExcludeDifferent -IncludeEqual + if ($itemsToRemove -ne $null) { return $false } } return $true From 36641b569e260b56b8aeb20f250929b9ee97a772 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 7 Dec 2015 11:58:57 +1100 Subject: [PATCH 19/19] Updated build number --- Modules/xSharePoint/xSharePoint.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index ad0476b0d..ed8503211 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '0.7.0.0' +ModuleVersion = '0.8.0.0' # ID used to uniquely identify this module GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90'