diff --git a/.vscode/launch.json b/.vscode/launch.json index 69dead474..991306295 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,7 +1,6 @@ { "version": "0.3.0", "configurations": [ - { "type": "PowerShell", "request": "launch", @@ -24,23 +23,38 @@ "cwd": "${file}", "createTemporaryIntegratedConsole": true }, + { + "type": "PowerShell", + "request": "launch", + "name": "Run current unit test (SP2019)", + "script": "${file}", + "args": [ + "${workspaceRoot}/Tests/Unit/Stubs/SharePoint/16.0.10337.12109/Microsoft.SharePoint.PowerShell.psm1" + ], + "cwd": "${file}", + "createTemporaryIntegratedConsole": true + }, { "name": "Debug current file", "type": "PowerShell", "request": "launch", - "program": "${file}" + "script": "${file}", + "cwd": "${file}", + "createTemporaryIntegratedConsole": true }, { "name": "Run core DSC resource tests only", "type": "PowerShell", "request": "launch", - "program": "${workspaceRoot}/.vscode/RunGlobalTests.ps1" + "script": "${workspaceRoot}/.vscode/RunGlobalTests.ps1", + "createTemporaryIntegratedConsole": true }, { "name": "Run all tests", "type": "PowerShell", "request": "launch", - "program": "${workspaceRoot}/.vscode/RunPesterTests.ps1" + "script": "${workspaceRoot}/.vscode/RunPesterTests.ps1", + "createTemporaryIntegratedConsole": true } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f32f1a66..e50532ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,81 @@ # Change log for SharePointDsc +## v3.0 + +* Changes to SharePointDsc + * Added support for SharePoint 2019 + * Added CredSSP requirement to the Readme files + * Added VSCode Support for running SharePoint 2019 unit tests + * Removed the deprecated resources SPCreateFarm and SPJoinFarm (replaced + in v2.0 by SPFarm) +* SPBlobCacheSettings + * Updated the Service Instance retrieval to be language independent +* SPConfigWizard + * Fixed check for Ensure=Absent in the Set method +* SPInstallPrereqs + * Added support for detecting updated installation of Microsoft Visual C++ + 2015/2017 Redistributable (x64) for SharePoint 2016 and SharePoint 2019. +* SPSearchContentSource + * Added support for Business Content Source Type +* SPSearchMetadataCategory + * New resource added +* SPSearchServiceApp + * Updated resource to make sure the presence of the service app proxy is + checked and created if it does not exist +* SPSecurityTokenServiceConfig + * The resource only tested for the Ensure parameter. Added more parameters +* SPServiceAppSecurity + * Added support for specifying array of access levels. + * Changed implementation to use Grant-SPObjectSecurity with Replace switch + instead of using a combination of Revoke-SPObjectSecurity and + Grant-SPObjectSecurity + * Added all supported access levels as available values. + * Removed unknown access levels: Change Permissions, Write, and Read +* SPUserProfileProperty + * Removed obsolete parameters (MappingConnectionName, MappingPropertyName, + MappingDirection) and introduced new parameter PropertyMappings +* SPUserProfileServiceApp + * Updated the check for successful creation of the service app to throw an + error if this is not done correctly + +The following changes will break v2.x and earlier configurations that use these +resources: + +* Implemented IsSingleInstance parameter to force that the resource can only + be used once in a configuration for the following resources: + * SPAntivirusSettings + * SPConfigWizard + * SPDiagnosticLoggingSettings + * SPFarm + * SPFarmAdministrators + * SPInfoPathFormsServiceConfig + * SPInstall + * SPInstallPrereqs + * SPIrmSettings + * SPMinRoleCompliance + * SPPasswordChangeSettings + * SPProjectServerLicense + * SPSecurityTokenServiceConfig + * SPShellAdmin +* Standardized Url/WebApplication parameter to default WebAppUrl parameter + for the following resources: + * SPDesignerSettings + * SPFarmSolution + * SPSelfServiceSiteCreation + * SPWebAppBlockedFileTypes + * SPWebAppClientCallableSettings + * SPWebAppGeneralSettings + * SPWebApplication + * SPWebApplicationAppDomain + * SPWebAppSiteUseAndDeletion + * SPWebAppThrottlingSettings + * SPWebAppWorkflowSettings +* Introduced new mandatory parameters + * SPSearchResultSource: Added option to create Result Sources at different scopes. + * SPServiceAppSecurity: Changed parameter AccessLevel to AccessLevels in + MSFT_SPServiceAppSecurityEntry to support array of access levels. + * SPUserProfileProperty: New parameter PropertyMappings + ## 2.6 * SPFarm diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServiceApp/readme.md index a870cdfa7..a8d399ad8 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating Access Services Application instances within the local SharePoint farm. The resource will provision and configure the diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServices2010/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServices2010/readme.md new file mode 100644 index 000000000..a4004d08b --- /dev/null +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAccessServices2010/readme.md @@ -0,0 +1,11 @@ +# Description + +**Type:** Distributed +**Requires CredSSP:** No + +This resource is responsible for creating Access Services 2010 Application +instances within the local SharePoint farm. The resource will provision and +configure the Access Services 2010 Service Application. + +The default value for the Ensure parameter is Present. When not specifying this +parameter, the service application is provisioned. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAlternateUrl/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAlternateUrl/readme.md index 115f7e838..a4dec4160 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAlternateUrl/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAlternateUrl/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to define an alternate access mapping URL for a specified web application. These can be assigned to specific zones for each web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.psm1 index 96ff06b73..9ba10d6fb 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.psm1 @@ -4,32 +4,37 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] - [System.Boolean] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] + [System.Boolean] $ScanOnDownload, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScanOnUpload, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AllowDownloadInfected, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AttemptToClean, - [Parameter()] - [System.UInt16] + [Parameter()] + [System.UInt16] $TimeoutDuration, - [Parameter()] - [System.UInt16] + [Parameter()] + [System.UInt16] $NumberOfThreads, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -39,16 +44,17 @@ function Get-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - - try + + try { $spFarm = Get-SPFarm - } - catch + } + catch { Write-Verbose -Message ("No local SharePoint farm was detected. Antivirus " + ` "settings will not be applied") return @{ + IsSingleInstance = "Yes" # Set the antivirus settings AllowDownloadInfected = $false ScanOnDownload = $false @@ -62,8 +68,9 @@ function Get-TargetResource # Get a reference to the Administration WebService $admService = Get-SPDSCContentService - + return @{ + IsSingleInstance = "Yes" # Set the antivirus settings AllowDownloadInfected = $admService.AntivirusSettings.AllowDownload ScanOnDownload = $admService.AntivirusSettings.DownloadScanEnabled @@ -82,32 +89,37 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] - [System.Boolean] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] + [System.Boolean] $ScanOnDownload, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScanOnUpload, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AllowDownloadInfected, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AttemptToClean, - [Parameter()] - [System.UInt16] + [Parameter()] + [System.UInt16] $TimeoutDuration, - [Parameter()] - [System.UInt16] + [Parameter()] + [System.UInt16] $NumberOfThreads, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -118,42 +130,42 @@ function Set-TargetResource -ScriptBlock { $params = $args[0] - try + try { $spFarm = Get-SPFarm - } - catch + } + catch { throw "No local SharePoint farm was detected. Antivirus settings will not be applied" return } - + Write-Verbose -Message "Start update" $admService = Get-SPDSCContentService # Set the antivirus settings - if ($params.ContainsKey("AllowDownloadInfected")) + if ($params.ContainsKey("AllowDownloadInfected")) { Write-Verbose -Message "Setting Allow Download" $admService.AntivirusSettings.AllowDownload = $params.AllowDownloadInfected } - if ($params.ContainsKey("ScanOnDownload")) + if ($params.ContainsKey("ScanOnDownload")) { - $admService.AntivirusSettings.DownloadScanEnabled = $params.ScanOnDownload + $admService.AntivirusSettings.DownloadScanEnabled = $params.ScanOnDownload } - if ($params.ContainsKey("ScanOnUpload")) + if ($params.ContainsKey("ScanOnUpload")) { - $admService.AntivirusSettings.UploadScanEnabled = $params.ScanOnUpload + $admService.AntivirusSettings.UploadScanEnabled = $params.ScanOnUpload } - if ($params.ContainsKey("AttemptToClean")) + if ($params.ContainsKey("AttemptToClean")) { - $admService.AntivirusSettings.CleaningEnabled = $params.AttemptToClean + $admService.AntivirusSettings.CleaningEnabled = $params.AttemptToClean } - if ($params.ContainsKey("NumberOfThreads")) + if ($params.ContainsKey("NumberOfThreads")) { - $admService.AntivirusSettings.NumberOfThreads = $params.NumberOfThreads + $admService.AntivirusSettings.NumberOfThreads = $params.NumberOfThreads } - if ($params.ContainsKey("TimeoutDuration")) + if ($params.ContainsKey("TimeoutDuration")) { $timespan = New-TimeSpan -Seconds $params.TimeoutDuration $admService.AntivirusSettings.Timeout = $timespan @@ -168,37 +180,42 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] - [System.Boolean] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] + [System.Boolean] $ScanOnDownload, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScanOnUpload, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AllowDownloadInfected, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AttemptToClean, - [Parameter()] - [System.UInt16] + [Parameter()] + [System.UInt16] $TimeoutDuration, - [Parameter()] - [System.UInt16] + [Parameter()] + [System.UInt16] $NumberOfThreads, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Testing antivirus configuration settings" - + return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) ` -DesiredValues $PSBoundParameters } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.schema.mof index 46e3b4aac..3498c16f8 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPAntivirusSettings")] class MSFT_SPAntivirusSettings : OMI_BaseResource { - [Key, Description("Should documents be scanned before being downloaded")] Boolean ScanOnDownload; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Should documents be scanned before being downloaded")] Boolean ScanOnDownload; [Write, Description("Should documents be scanned on upload")] Boolean ScanOnUpload; [Write, Description("Should documents that are infected be allowed to be downloaded")] Boolean AllowDownloadInfected; [Write, Description("Should infected documents be handed to the AV engine to attempt cleaning")] Boolean AttemptToClean; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/readme.md index 2c590131d..c17e5f295 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to set the global antivirus settings for the local farm. These settings will be used to control the behavior of an external anti-virus diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAppCatalog/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAppCatalog/readme.md index 1c85d9a80..a4ff3a22c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAppCatalog/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAppCatalog/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** Yes This resource will ensure that a specific site collection is marked as the app catalog for the web application that the site is in. The catalog site needs to diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAppDomain/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAppDomain/readme.md index 6e2732eb1..68651e506 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAppDomain/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAppDomain/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will set the value for the app domain settings at the farm level. You can set the domain name and the prefix that is to be used for app URLs. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAppManagementServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAppManagementServiceApp/readme.md index 4e6f83faa..e08a59c6d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAppManagementServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAppManagementServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to provision and manage an instance of the App Management Services Service Application. It will identify an instance of the app diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPAppStoreSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPAppStoreSettings/readme.md index 79f6faa4f..4f46e05db 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPAppStoreSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPAppStoreSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will configure the ability to purchase apps for both SharePoint and Office apps. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPBCSServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPBCSServiceApp/readme.md index 6fa6ee30a..c53e18e09 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPBCSServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPBCSServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to provision and manage an instance of the Business Connectivity Services Service Application. It will identify an instance diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/MSFT_SPBlobCacheSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/MSFT_SPBlobCacheSettings.psm1 index 7017da5c0..4fe2c9feb 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/MSFT_SPBlobCacheSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/MSFT_SPBlobCacheSettings.psm1 @@ -48,7 +48,8 @@ function Get-TargetResource $webappsi = Get-SPServiceInstance -Server $env:COMPUTERNAME ` -ErrorAction SilentlyContinue ` | Where-Object -FilterScript { - $_.TypeName -eq "Microsoft SharePoint Foundation Web Application" + $_.GetType().Name -eq "SPWebServiceInstance" -and ` + $_.Name -eq "" } if ($null -eq $webappsi) @@ -237,10 +238,11 @@ function Set-TargetResource $changes = $args[1] $webappsi = Get-SPServiceInstance -Server $env:COMPUTERNAME ` - -ErrorAction SilentlyContinue ` + -ErrorAction SilentlyContinue ` | Where-Object -FilterScript { - $_.TypeName -eq "Microsoft SharePoint Foundation Web Application" - } + $_.GetType().Name -eq "SPWebServiceInstance" -and ` + $_.Name -eq "" + } if ($null -eq $webappsi) { diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/Readme.md index 844406ba6..91772747a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Specific +**Requires CredSSP:** No This resource is used to configure the Blob Cache settings for a web application. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPCacheAccounts/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPCacheAccounts/Readme.md index d538b5d08..0687e8b82 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPCacheAccounts/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPCacheAccounts/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to set the "super user" and "super reader" cache accounts for the specified web application object (as described in the TechNet article diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.psm1 index c9fab7da6..b03bad602 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.psm1 @@ -5,19 +5,24 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, - + $Ensure = "Present", + [Parameter()] [ValidateSet("mon","tue","wed","thu","fri","sat","sun")] [System.String[]] $DatabaseUpgradeDays, - + [Parameter()] [System.String] $DatabaseUpgradeTime, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -44,15 +49,17 @@ function Get-TargetResource if (($languagePackInstalled -eq 1) -or ($setupType -eq "B2B_UPGRADE")) { return @{ - Ensure = "Absent" + IsSingleInstance = "Yes" + Ensure = "Absent" DatabaseUpgradeDays = $DatabaseUpgradeDays DatabaseUpgradeTime = $DatabaseUpgradeTime } - } + } else { return @{ - Ensure = "Present" + IsSingleInstance = "Yes" + Ensure = "Present" DatabaseUpgradeDays = $DatabaseUpgradeDays DatabaseUpgradeTime = $DatabaseUpgradeTime } @@ -65,19 +72,24 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, - + $Ensure = "Present", + [Parameter()] [ValidateSet("mon","tue","wed","thu","fri","sat","sun")] [System.String[]] $DatabaseUpgradeDays, - + [Parameter()] [System.String] $DatabaseUpgradeTime, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -157,7 +169,7 @@ function Set-TargetResource "ran at any time. Starting wizard.") } - if ($Ensure -eq $false) + if ($Ensure -eq "Absent") { Write-Verbose -Message ("Ensure is set to Absent, so running the Configuration " + ` "Wizard is not required") @@ -182,7 +194,7 @@ function Set-TargetResource -ScriptBlock { $psconfigExe = $args[0] $psconfig = Start-Process -FilePath $psconfigExe ` - -ArgumentList "-cmd upgrade -inplace b2b -wait -force" ` + -ArgumentList "-cmd upgrade -inplace b2b -wait -force -cmd installcheck -noinstallcheck" ` -Wait ` -PassThru @@ -197,7 +209,7 @@ function Set-TargetResource } Default { throw ("SharePoint Post Setup Configuration Wizard failed, " + ` - "exit code was $($setup.ExitCode). Error codes can be found at " + ` + "exit code was $result. Error codes can be found at " + ` "https://aka.ms/installerrorcodes") } } @@ -211,19 +223,24 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, - + $Ensure = "Present", + [Parameter()] [ValidateSet("mon","tue","wed","thu","fri","sat","sun")] [System.String[]] $DatabaseUpgradeDays, - + [Parameter()] [System.String] $DatabaseUpgradeTime, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -231,6 +248,8 @@ function Test-TargetResource Write-Verbose -Message "Testing status of Configuration Wizard" + $PSBoundParameters.Ensure = $Ensure + if ($Ensure -eq "Absent") { Write-Verbose -Message ("Ensure is set to Absent, so running the Configuration Wizard " + ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.schema.mof index c93913ce5..4b9ea8c21 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/MSFT_SPConfigWizard.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPConfigWizard")] class MSFT_SPConfigWizard : OMI_BaseResource { - [Key, Description("Present to install SharePoint. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Present to run the Configuration Wizard. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("Specify on which dates running the Configuration Wizard is allowed"), ValueMap{"mon","tue","wed","thu","fri","sat","sun"}, Values{"mon","tue","wed","thu","fri","sat","sun"}] String DatabaseUpgradeDays[]; [Write, Description("Specify in which time frame running the Configuration Wizard is allowed")] String DatabaseUpgradeTime; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/readme.md index 5c45d53cd..bf75dcb1d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPConfigWizard/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Utility +**Requires CredSSP:** No This resource is used to perform the upgrade step of installing SharePoint updates, like Cumulative Updates, Service Packs and Language Packs. The diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPContentDatabase/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPContentDatabase/Readme.md index ecd15c96e..bfc9dff61 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPContentDatabase/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPContentDatabase/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to add and remove Content Databases to web applications and configure these databases. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/MSFT_SPCreateFarm.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/MSFT_SPCreateFarm.psm1 deleted file mode 100644 index e6e594184..000000000 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/MSFT_SPCreateFarm.psm1 +++ /dev/null @@ -1,181 +0,0 @@ -function Get-TargetResource -{ - [CmdletBinding()] - [OutputType([System.Collections.Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [Parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [Parameter()] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Passphrase, - - [Parameter(Mandatory = $true)] - [System.String] - $AdminContentDatabaseName, - - [Parameter()] - [System.UInt32] - $CentralAdministrationPort, - - [Parameter()] - [System.String] - [ValidateSet("NTLM","Kerberos")] - $CentralAdministrationAuth, - - [Parameter()] - [System.String] - [ValidateSet("Application", - "ApplicationWithSearch", - "Custom", - "DistributedCache", - "Search", - "SingleServer", - "SingleServerFarm", - "WebFrontEnd", - "WebFrontEndWithDistributedCache")] - $ServerRole - ) - - Write-Verbose -Message "Getting local SP Farm settings" - - throw ("SPCreateFarm: This resource has been removed. Please update your configuration " + ` - "to use SPFarm instead. See http://aka.ms/SPDsc-SPFarm for details.") -} - -function Set-TargetResource -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [Parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [Parameter()] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Passphrase, - - [Parameter(Mandatory = $true)] - [System.String] - $AdminContentDatabaseName, - - [Parameter()] - [System.UInt32] - $CentralAdministrationPort, - - [Parameter()] - [System.String] - [ValidateSet("NTLM","Kerberos")] - $CentralAdministrationAuth, - - [Parameter()] - [System.String] - [ValidateSet("Application", - "ApplicationWithSearch", - "Custom", - "DistributedCache", - "Search", - "SingleServer", - "SingleServerFarm", - "WebFrontEnd", - "WebFrontEndWithDistributedCache")] - $ServerRole - ) - - Write-Verbose -Message ("WARNING! SPCreateFarm is deprecated and will be removed in " + ` - "SharePointDsc v2.0. Swap to use the new SPFarm resource as " + ` - "an alternative. See http://aka.ms/SPDsc-SPFarm for details.") - - Write-Verbose -Message "Setting local SP Farm settings" - - throw ("SPCreateFarm: This resource has been removed. Please update your configuration " + ` - "to use SPFarm instead. See http://aka.ms/SPDsc-SPFarm for details.") -} - -function Test-TargetResource -{ - [CmdletBinding()] - [OutputType([System.Boolean])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [Parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [Parameter()] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Passphrase, - - [Parameter(Mandatory = $true)] - [System.String] - $AdminContentDatabaseName, - - [Parameter()] - [System.UInt32] - $CentralAdministrationPort, - - [Parameter()] - [System.String] - [ValidateSet("NTLM","Kerberos")] - $CentralAdministrationAuth, - - [Parameter()] - [System.String] - [ValidateSet("Application", - "ApplicationWithSearch", - "Custom", - "DistributedCache", - "Search", - "SingleServer", - "SingleServerFarm", - "WebFrontEnd", - "WebFrontEndWithDistributedCache")] - $ServerRole - ) - - Write-Verbose -Message "Testing local SP Farm settings" - - throw ("SPCreateFarm: This resource has been removed. Please update your configuration " + ` - "to use SPFarm instead. See http://aka.ms/SPDsc-SPFarm for details.") -} - -Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/MSFT_SPCreateFarm.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/MSFT_SPCreateFarm.schema.mof deleted file mode 100644 index 40339482a..000000000 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/MSFT_SPCreateFarm.schema.mof +++ /dev/null @@ -1,13 +0,0 @@ -[ClassVersion("1.0.0.0"), FriendlyName("SPCreateFarm")] -class MSFT_SPCreateFarm : OMI_BaseResource -{ - [Key, Description("Name of the configuration database")] String FarmConfigDatabaseName; - [Key, Description("Server that will host the configuration and admin content databases")] String DatabaseServer; - [Required, Description("The account to use as the main farm account"), EmbeddedInstance("MSFT_Credential")] String FarmAccount; - [Required, Description("The passphrase to use to allow servers to join this farm"), EmbeddedInstance("MSFT_Credential")] String Passphrase; - [Required, Description("The name of the admin content database")] String AdminContentDatabaseName; - [Write, Description("What port will Central Admin be provisioned to - default is 9999")] uint32 CentralAdministrationPort; - [Write, Description("The authentication provider of the CentralAdministration web application"), ValueMap{"NTLM","Kerberos"}, Values{"NTLM","Kerberos"}] String CentralAdministrationAuth; - [Write, Description("SharePoint 2016 only - the MinRole role to enroll this server as"), ValueMap{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}, Values{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}] string ServerRole; - [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; -}; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/Readme.md deleted file mode 100644 index a7fd4456b..000000000 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPCreateFarm/Readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# Description - -WARNING: This resource has been removed. Please use SPFarm instead. -See http://aka.ms/SPDsc-SPFarm for details. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDatabaseAAG/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPDatabaseAAG/Readme.md index 45dc99089..50b4a12f1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDatabaseAAG/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDatabaseAAG/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will allow specifying which SQL Server AlwaysOn Availability group a resource should be in. This resource does not configure the diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.psm1 index 19f29f736..1b8993b11 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.psm1 @@ -6,7 +6,7 @@ function Get-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter(Mandatory = $true)] [ValidateSet("WebApplication","SiteCollection")] @@ -68,7 +68,7 @@ function Get-TargetResource # Check if web application exists $webapp = Get-SPWebApplication | Where-Object -FilterScript { - ($_.Url).StartsWith($params.Url, "CurrentCultureIgnoreCase") + ($_.Url).StartsWith($params.WebAppUrl, "CurrentCultureIgnoreCase") } if ($null -eq $webapp) { @@ -79,11 +79,11 @@ function Get-TargetResource else { # Get SPD settings for the web application - $spdSettings = Get-SPDesignerSettings $params.Url + $spdSettings = Get-SPDesignerSettings $params.WebAppUrl return @{ # Set the SPD settings - Url = $params.Url + WebAppUrl = $params.WebAppUrl SettingsScope = $params.SettingsScope AllowSharePointDesigner = $spdSettings.AllowDesigner AllowDetachPagesFromDefinition = $spdSettings.AllowRevertFromTemplate @@ -120,7 +120,7 @@ function Get-TargetResource } # Check if site collections exists - $site = Get-SPSite -Identity $params.Url -ErrorAction SilentlyContinue + $site = Get-SPSite -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $site) { Write-Verbose -Message ("Site collection not found. SharePoint " + ` @@ -131,7 +131,7 @@ function Get-TargetResource { return @{ # Set the SPD settings - Url = $params.Url + WebAppUrl = $params.WebAppUrl SettingsScope = $params.SettingsScope AllowSharePointDesigner = $site.AllowDesigner AllowDetachPagesFromDefinition = $site.AllowRevertFromTemplate @@ -166,7 +166,7 @@ function Set-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter(Mandatory = $true)] [ValidateSet("WebApplication","SiteCollection")] @@ -231,7 +231,7 @@ function Set-TargetResource # Check if web application exists $webapp = Get-SPWebApplication | Where-Object -FilterScript { - ($_.Url).StartsWith($params.Url, "CurrentCultureIgnoreCase") + ($_.Url).StartsWith($params.WebAppUrl, "CurrentCultureIgnoreCase") } if ($null -eq $webapp) { @@ -299,7 +299,7 @@ function Set-TargetResource Write-Verbose -Message "Start update SPD site collection settings" # Check if site collection exists - $site = Get-SPSite -Identity $params.Url -ErrorAction SilentlyContinue + $site = Get-SPSite -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $site) { throw ("Site collection not found. SharePoint Designer settings " + ` @@ -362,7 +362,7 @@ function Test-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter(Mandatory = $true)] [ValidateSet("WebApplication","SiteCollection")] diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.schema.mof index 1174ff18a..766282c01 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/MSFT_SPDesignerSettings.schema.mof @@ -1,8 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPDesignerSettings")] class MSFT_SPDesignerSettings : OMI_BaseResource { - [Key, Description("The URL of the web application or site collection to configure")] string Url; - [Required, Description("Define the scope of the configuration - either WebApplication or SiteCollection"), ValueMap{"WebApplication","SiteCollection"}, Values{"WebApplication","SiteCollection"}] string SettingsScope; + [Key, Description("The URL of the web application or site collection to configure")] string WebAppUrl; + [Required, Description("Define the scope of the configuration - either WebApplication or SiteCollection"), ValueMap{"WebApplication","SiteCollection"}, Values{"WebApplication","SiteCollection"}] string SettingsScope; [Write, Description("Allow the use of SharePoint Designer")] Boolean AllowSharePointDesigner; [Write, Description("Allow pages to be un-ghosted by SharePoint Designer")] Boolean AllowDetachPagesFromDefinition; [Write, Description("Allow masterpages to be changed by SharePoint Designer")] Boolean AllowCustomiseMasterPage; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/Readme.md index cdc08df96..c75b80844 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDesignerSettings/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to set the SharePoint Designer settings for the local farm or site collections. These settings will be used to control if users are diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.psm1 index 766b260c9..5253d7c2a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.psm1 @@ -4,80 +4,85 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter(Mandatory = $true)] + [System.String] $LogPath, - [Parameter(Mandatory = $true)] - [System.UInt32] + [Parameter(Mandatory = $true)] + [System.UInt32] $LogSpaceInGB, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AppAnalyticsAutomaticUploadEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $CustomerExperienceImprovementProgramEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $DaysToKeepLogs, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $DownloadErrorReportingUpdatesEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ErrorReportingAutomaticUploadEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ErrorReportingEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $EventLogFloodProtectionEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionNotifyInterval, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionQuietPeriod, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionThreshold, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionTriggerPeriod, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $LogCutInterval, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $LogMaxDiskSpaceUsageEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $ScriptErrorReportingDelay, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScriptErrorReportingEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScriptErrorReportingRequireAuth, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -87,14 +92,15 @@ function Get-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $dc = Get-SPDiagnosticConfig -ErrorAction SilentlyContinue if ($null -eq $dc) { - return $null + return $null } - + return @{ + IsSingleInstance = "Yes" AppAnalyticsAutomaticUploadEnabled = $dc.AppAnalyticsAutomaticUploadEnabled CustomerExperienceImprovementProgramEnabled = ` $dc.CustomerExperienceImprovementProgramEnabled @@ -126,80 +132,85 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter(Mandatory = $true)] + [System.String] $LogPath, - [Parameter(Mandatory = $true)] - [System.UInt32] + [Parameter(Mandatory = $true)] + [System.UInt32] $LogSpaceInGB, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AppAnalyticsAutomaticUploadEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $CustomerExperienceImprovementProgramEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $DaysToKeepLogs, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $DownloadErrorReportingUpdatesEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ErrorReportingAutomaticUploadEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ErrorReportingEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $EventLogFloodProtectionEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionNotifyInterval, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionQuietPeriod, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionThreshold, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionTriggerPeriod, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $LogCutInterval, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $LogMaxDiskSpaceUsageEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $ScriptErrorReportingDelay, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScriptErrorReportingEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScriptErrorReportingRequireAuth, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -209,11 +220,16 @@ function Set-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + + if ($params.ContainsKey("IsSingleInstance")) + { + $params.Remove("IsSingleInstance") | Out-Null + } + if ($params.ContainsKey("InstallAccount")) { - $params.Remove("InstallAccount") | Out-Null - } + $params.Remove("InstallAccount") | Out-Null + } $params = $params | Rename-SPDSCParamValue -oldName "LogPath" ` -newName "LogLocation" ` | Rename-SPDSCParamValue -oldName "LogSpaceInGB" ` @@ -229,80 +245,85 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter(Mandatory = $true)] + [System.String] $LogPath, - [Parameter(Mandatory = $true)] - [System.UInt32] + [Parameter(Mandatory = $true)] + [System.UInt32] $LogSpaceInGB, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AppAnalyticsAutomaticUploadEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $CustomerExperienceImprovementProgramEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $DaysToKeepLogs, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $DownloadErrorReportingUpdatesEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ErrorReportingAutomaticUploadEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ErrorReportingEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $EventLogFloodProtectionEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionNotifyInterval, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionQuietPeriod, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionThreshold, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $EventLogFloodProtectionTriggerPeriod, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $LogCutInterval, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $LogMaxDiskSpaceUsageEnabled, - [Parameter()] - [System.UInt32] + [Parameter()] + [System.UInt32] $ScriptErrorReportingDelay, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScriptErrorReportingEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ScriptErrorReportingRequireAuth, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -312,7 +333,7 @@ function Test-TargetResource if ($null -eq $CurrentValues) { - return $false + return $false } return Test-SPDscParameterState -CurrentValues $CurrentValues ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.schema.mof index e2bd45862..5686b2d3b 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/MSFT_SPDiagnosticLoggingSettings.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPDiagnosticLoggingSettings")] class MSFT_SPDiagnosticLoggingSettings : OMI_BaseResource { - [Key, Description("The physical path on each server to store ULS logs")] string LogPath; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Required, Description("The physical path on each server to store ULS logs")] string LogPath; [Required, Description("The space in GB that should be used to store ULS logs")] uint32 LogSpaceInGB; [Write, Description("Should app analytics automatically be uploaded")] boolean AppAnalyticsAutomaticUploadEnabled; [Write, Description("Should the customer experience program be enabled in this farm")] boolean CustomerExperienceImprovementProgramEnabled; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/Readme.md index 51abc1eb9..0f22f9240 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticLoggingSettings/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuring settings to do with the diagnostic (ULS) logging on servers in the farm. These settings are applied to the diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticsProvider/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticsProvider/readme.md index e20764f95..3bc2cbd30 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticsProvider/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDiagnosticsProvider/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuring the Diagnostics Provider within the local SharePoint farm. Using Ensure equals to Absent is not supported. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheClientSettings/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheClientSettings/Readme.md index 28b1a3812..8bc6e7931 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheClientSettings/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheClientSettings/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuring the distributed cache client settings. It only accepts Ensure='Present' as a key. The resource can diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheService/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheService/Readme.md index 4632417d4..4825441ea 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheService/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheService/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Specific +**Requires CredSSP:** No This resource is responsible for provisioning the distributed cache to the service it runs on. This is required in your farm on at least one server (as diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/MSFT_SPExcelServiceApp.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/MSFT_SPExcelServiceApp.psm1 index eb4162141..264f15f7e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/MSFT_SPExcelServiceApp.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/MSFT_SPExcelServiceApp.psm1 @@ -123,7 +123,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -ne 15) { throw [Exception] ("Only SharePoint 2013 is supported to deploy Excel Services " + ` - "service applications via DSC, as SharePoint 2016 deprecated " + ` + "service applications via DSC, as SharePoint 2016 and SharePoint 2019 deprecated " + ` "this service. See " + ` "https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx " + ` "for more info.") @@ -314,7 +314,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -ne 15) { throw [Exception] ("Only SharePoint 2013 is supported to deploy Excel Services " + ` - "service applications via DSC, as SharePoint 2016 deprecated " + ` + "service applications via DSC, as SharePoint 2016 and SharePoint 2019 are deprecated " + ` "this service. See " + ` "https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx " + ` "for more info.") @@ -572,7 +572,7 @@ function Test-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -ne 15) { throw [Exception] ("Only SharePoint 2013 is supported to deploy Excel Services " + ` - "service applications via DSC, as SharePoint 2016 deprecated " + ` + "service applications via DSC, as SharePoint 2016 and SharePoint 2019 are deprecated " + ` "this service. See " + ` "https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx " + ` "for more info.") diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/Readme.md index bef4f2da8..e74e432a1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPExcelServiceApp/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating Excel Services Application instances within the local SharePoint farm. The resource will provision and configure the diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.psm1 index 5339284cc..8aa11a3bb 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.psm1 @@ -5,9 +5,14 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, + $Ensure = "Present", [Parameter(Mandatory = $true)] [System.String] @@ -84,18 +89,25 @@ function Get-TargetResource Write-Verbose -Message "Detected installation of SharePoint 2013" } 16 { - Write-Verbose -Message "Detected installation of SharePoint 2016" + if($installedVersion.ProductBuildPart.ToString().Length -eq 4) + { + Write-Verbose -Message "Detected installation of SharePoint 2016" + } + else + { + Write-Verbose -Message "Detected installation of SharePoint 2019" + } } default { throw ("Detected an unsupported major version of SharePoint. SharePointDsc only " + ` - "supports SharePoint 2013 or 2016.") + "supports SharePoint 2013, 2016 or 2019.") } } if (($PSBoundParameters.ContainsKey("ServerRole") -eq $true) ` -and $installedVersion.FileMajorPart -ne 16) { - throw [Exception] "Server role is only supported in SharePoint 2016." + throw [Exception] "Server role is only supported in SharePoint 2016 and 2019." } if (($PSBoundParameters.ContainsKey("ServerRole") -eq $true) ` @@ -164,7 +176,7 @@ function Get-TargetResource $centralAdminProvisioned = $false $ca = Get-SPServiceInstance -Server $env:ComputerName ` | Where-Object -Filterscript { - $_.Name -eq "WSS_Administration" -and $_.Status -eq "Online" + $_.TypeName -eq "Central Administration" -and $_.Status -eq "Online" } if ($null -ne $ca) { @@ -181,6 +193,7 @@ function Get-TargetResource } $returnValue = @{ + IsSingleInstance = "Yes" FarmConfigDatabaseName = $spFarm.Name DatabaseServer = $configDb.NormalizedDataSource FarmAccount = $farmAccount # Need to return this as a credential to match the type expected @@ -224,6 +237,7 @@ function Get-TargetResource "incomplete, however the 'Ensure' property should be " + ` "considered correct") return @{ + IsSingleInstance = "Yes" FarmConfigDatabaseName = $null DatabaseServer = $null FarmAccount = $null @@ -246,6 +260,7 @@ function Get-TargetResource { # This node has never been connected to a farm, return the null return object return @{ + IsSingleInstance = "Yes" FarmConfigDatabaseName = $null DatabaseServer = $null FarmAccount = $null @@ -268,9 +283,14 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, + $Ensure = "Present", [Parameter(Mandatory = $true)] [System.String] @@ -358,7 +378,7 @@ function Set-TargetResource { $serviceInstance = Get-SPServiceInstance -Server $env:COMPUTERNAME ` | Where-Object -FilterScript { - $_.Name -eq "WSS_Administration" + $_.TypeName -eq "Central Administration" } if ($null -eq $serviceInstance) { @@ -366,7 +386,7 @@ function Set-TargetResource $fqdn = "$($env:COMPUTERNAME).$domain" $serviceInstance = Get-SPServiceInstance -Server $fqdn ` | Where-Object -FilterScript { - $_.Name -eq "WSS_Administration" + $_.TypeName -eq "Central Administration" } } if ($null -eq $serviceInstance) @@ -380,7 +400,7 @@ function Set-TargetResource # Unprovision central administration $serviceInstance = Get-SPServiceInstance -Server $env:COMPUTERNAME ` | Where-Object -FilterScript { - $_.Name -eq "WSS_Administration" + $_.TypeName -eq "Central Administration" } if ($null -eq $serviceInstance) { @@ -388,7 +408,7 @@ function Set-TargetResource $fqdn = "$($env:COMPUTERNAME).$domain" $serviceInstance = Get-SPServiceInstance -Server $fqdn ` | Where-Object -FilterScript { - $_.Name -eq "WSS_Administration" + $_.TypeName -eq "Central Administration" } } if ($null -eq $serviceInstance) @@ -421,6 +441,14 @@ function Set-TargetResource $modulePath = "..\..\Modules\SharePointDsc.Farm\SPFarm.psm1" Import-Module -Name (Join-Path -Path $scriptRoot -ChildPath $modulePath -Resolve) + + $sqlInstanceStatus = Get-SPDSCSQLInstanceStatus -SQLServer $params.DatabaseServer ` + + if ($sqlInstanceStatus.MaxDOPCorrect -ne $true) + { + throw "The MaxDOP setting is incorrect. Please correct before continuing." + } + $dbStatus = Get-SPDSCConfigDBStatus -SQLServer $params.DatabaseServer ` -Database $params.FarmConfigDatabaseName @@ -447,7 +475,8 @@ function Set-TargetResource SkipRegisterAsDistributedCacheHost = $true } - switch((Get-SPDSCInstalledProductVersion).FileMajorPart) + $installedVersion = Get-SPDSCInstalledProductVersion + switch($installedVersion.FileMajorPart) { 15 { Write-Verbose -Message "Detected Version: SharePoint 2013" @@ -455,22 +484,39 @@ function Set-TargetResource 16 { if ($params.ContainsKey("ServerRole") -eq $true) { - Write-Verbose -Message ("Detected Version: SharePoint 2016 - " + ` - "configuring server as $($params.ServerRole)") + if($installedVersion.ProductBuildPart.ToString().Length -eq 4) + { + Write-Verbose -Message ("Detected Version: SharePoint 2016 - " + ` + "configuring server as $($params.ServerRole)") + } + else + { + Write-Verbose -Message ("Detected Version: SharePoint 2019 - " + ` + "configuring server as $($params.ServerRole)") + } $executeArgs.Add("LocalServerRole", $params.ServerRole) } else { - Write-Verbose -Message ("Detected Version: SharePoint 2016 - no server " + ` - "role provided, configuring server without a " + ` - "specific role") + if($installedVersion.ProductBuildPart.ToString().Length -eq 4) + { + Write-Verbose -Message ("Detected Version: SharePoint 2016 - no server " + ` + "role provided, configuring server without a " + ` + "specific role") + } + else + { + Write-Verbose -Message ("Detected Version: SharePoint 2019 - no server " + ` + "role provided, configuring server without a " + ` + "specific role") + } $executeArgs.Add("ServerRoleOptional", $true) } } Default { throw [Exception] ("An unknown version of SharePoint (Major version $_) " + ` - "was detected. Only versions 15 (SharePoint 2013) or " + ` - "16 (SharePoint 2016) are supported.") + "was detected. Only versions 15 (SharePoint 2013) and" + ` + "16 (SharePoint 2016 or SharePoint 2019) are supported.") } } @@ -600,7 +646,7 @@ function Set-TargetResource { $serviceInstance = Get-SPServiceInstance -Server $env:COMPUTERNAME ` | Where-Object -FilterScript { - $_.Name -eq "WSS_Administration" + $_.TypeName -eq "Central Administration" } if ($null -eq $serviceInstance) { @@ -608,7 +654,7 @@ function Set-TargetResource $fqdn = "$($env:COMPUTERNAME).$domain" $serviceInstance = Get-SPServiceInstance -Server $fqdn ` | Where-Object -FilterScript { - $_.Name -eq "WSS_Administration" + $_.TypeName -eq "Central Administration" } } if ($null -eq $serviceInstance) @@ -647,9 +693,14 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, + $Ensure = "Present", [Parameter(Mandatory = $true)] [System.String] @@ -704,6 +755,8 @@ function Test-TargetResource Write-Verbose -Message "Testing local SP Farm settings" + $PSBoundParameters.Ensure = $Ensure + $CurrentValues = Get-TargetResource @PSBoundParameters return Test-SPDscParameterState -CurrentValues $CurrentValues ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.schema.mof index 337fe993b..576fac73a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/MSFT_SPFarm.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPFarm")] class MSFT_SPFarm : OMI_BaseResource { - [Key, Description("Present to create/join the farm. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Present to create/join the farm. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Required, Description("Name of the configuration database")] String FarmConfigDatabaseName; [Required, Description("Server that will host the configuration and admin content databases")] String DatabaseServer; [Required, Description("The account to use as the main farm account"), EmbeddedInstance("MSFT_Credential")] String FarmAccount; @@ -10,6 +11,6 @@ class MSFT_SPFarm : OMI_BaseResource [Required, Description("Should the central admin site run on this specific server?")] Boolean RunCentralAdmin; [Write, Description("What port will Central Admin be provisioned to - default is 9999")] uint32 CentralAdministrationPort; [Write, Description("The authentication provider of the CentralAdministration web application"), ValueMap{"NTLM","Kerberos"}, Values{"NTLM","Kerberos"}] String CentralAdministrationAuth; - [Write, Description("SharePoint 2016 only - the MinRole role to enroll this server as"), ValueMap{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}, Values{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}] string ServerRole; + [Write, Description("SharePoint 2016 & 2019 only - the MinRole role to enroll this server as"), ValueMap{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}, Values{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}] string ServerRole; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/Readme.md index 6058dae3e..608d14c85 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarm/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Specific +**Requires CredSSP:** No This resource is used to create a new SharePoint farm and allow servers to join that farm. It will detect the presence of the configuration database diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.psm1 index bb0a22201..1a6adf7d1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.psm1 @@ -5,8 +5,9 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] - $Name, + [ValidateSet('Yes')] + [String] + $IsSingleInstance, [Parameter()] [System.String[]] @@ -58,7 +59,7 @@ function Get-TargetResource $farmAdminGroup = $caWeb.AssociatedOwnerGroup $farmAdministratorsGroup = $caWeb.SiteGroups.GetByName($farmAdminGroup) return @{ - Name = $params.Name + IsSingleInstance = "Yes" Members = $farmAdministratorsGroup.users.UserLogin MembersToInclude = $params.MembersToInclude MembersToExclude = $params.MembersToExclude @@ -75,8 +76,9 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] - $Name, + [ValidateSet('Yes')] + [String] + $IsSingleInstance, [Parameter()] [System.String[]] @@ -235,8 +237,9 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] - $Name, + [ValidateSet('Yes')] + [String] + $IsSingleInstance, [Parameter()] [System.String[]] diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.schema.mof index 6b0650f8a..7d3c742d0 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/MSFT_SPFarmAdministrators.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPFarmAdministrators")] class MSFT_SPFarmAdministrators : OMI_BaseResource { - [Key, Description("A generic name for this resource, its value is not important")] String Name; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [Write, Description("A list of members to set the group to. Those not in this list will be removed")] String Members[]; [Write, Description("A list of members to add. Members not in this list will be left in the group")] String MembersToInclude[]; [Write, Description("A list of members to remove. Members not in this list will be left in the group")] String MembersToExclude[]; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/Readme.md index eb2669550..cc74994f1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmAdministrators/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Common +**Requires CredSSP:** No This resource is used to manage the membership of the farm administrators group. There are a number of approaches to how this can be implemented. The diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmPropertyBag/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmPropertyBag/readme.md index c715d8fe9..1e495a0dd 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmPropertyBag/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmPropertyBag/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to work with SharePoint Property Bags at the farm level. The account that runs this resource must be a farm administrator. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.psm1 index a18850224..ced418660 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.psm1 @@ -4,36 +4,36 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [System.String] $Name, - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [System.String] $LiteralPath, - [Parameter()] - [System.String[]] - $WebApplications = @(), + [Parameter()] + [System.String[]] + $WebAppUrls = @(), - [Parameter()] + [Parameter()] [ValidateSet("Present","Absent")] [System.String] $Ensure = "Present", - + [Parameter()] [System.String] $Version = "1.0.0.0", - [Parameter()] + [Parameter()] [System.Boolean] $Deployed = $true, - [Parameter()] + [Parameter()] [ValidateSet("14","15","All")] [System.String] $SolutionLevel, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -50,17 +50,17 @@ function Get-TargetResource -ErrorAction SilentlyContinue ` -Verbose:$false - if ($null -ne $solution) + if ($null -ne $solution) { - $currentState = "Present" + $currentState = "Present" $deployed = $solution.Deployed $version = $Solution.Properties["Version"] $deployedWebApplications = @($solution.DeployedWebApplications ` | Select-Object -ExpandProperty Url) - } - else + } + else { - $currentState = "Absent" + $currentState = "Absent" $deployed = $false $version = "0.0.0.0" $deployedWebApplications = @() @@ -72,7 +72,7 @@ function Get-TargetResource Deployed = $deployed Ensure = $currentState Version = $version - WebApplications = $deployedWebApplications + WebAppUrls = $deployedWebApplications SolutionLevel = $params.SolutionLevel } } @@ -84,36 +84,36 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [System.String] $Name, - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [System.String] $LiteralPath, - [Parameter()] - [System.String[]] - $WebApplications = @(), + [Parameter()] + [System.String[]] + $WebAppUrls = @(), - [Parameter()] + [Parameter()] [ValidateSet("Present","Absent")] [System.String] $Ensure = "Present", - + [Parameter()] [System.String] $Version = "1.0.0.0", - [Parameter()] + [Parameter()] [System.Boolean] $Deployed = $true, - [Parameter()] + [Parameter()] [ValidateSet("14","15","All")] [System.String] $SolutionLevel, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -127,7 +127,7 @@ function Set-TargetResource $PSBoundParameters.Version = $Version $PSBoundParameters.Deployed = $Deployed - if ($Ensure -eq "Present") + if ($Ensure -eq "Present") { if ($CurrentValues.Ensure -eq "Absent") { @@ -137,14 +137,14 @@ function Set-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $runParams = @{} $runParams.Add("LiteralPath", $params.LiteralPath) $runParams.Add("Verbose", $false) $solution = Add-SPSolution @runParams - $solution.Properties["Version"] = $params.Version + $solution.Properties["Version"] = $params.Version $solution.Update() return $solution @@ -152,10 +152,10 @@ function Set-TargetResource $CurrentValues.Version = $result.Properties["Version"] } - + if ($CurrentValues.Version -ne $Version) { - # If the solution is not deployed and the versions do not match we have to + # If the solution is not deployed and the versions do not match we have to # remove the current solution and add the new one if (-not $CurrentValues.Deployed) { @@ -166,10 +166,10 @@ function Set-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $runParams = @{} $runParams.Add("Identity", $params.Name) - $runParams.Add("Confirm", $false) + $runParams.Add("Confirm", $false) $runParams.Add("Verbose", $false) Remove-SPSolution $runParams @@ -179,7 +179,7 @@ function Set-TargetResource $solution = Add-SPSolution @runParams - $solution.Properties["Version"] = $params.Version + $solution.Properties["Version"] = $params.Version $solution.Update() return $solution @@ -196,21 +196,21 @@ function Set-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $solution = Get-SPSolution -Identity $params.Name -Verbose:$false $runParams = @{} $runParams.Add("Identity", $params.Name) $runParams.Add("LiteralPath", $params.LiteralPath) $runParams.Add("GACDeployment", $solution.ContainsGlobalAssembly) - $runParams.Add("Confirm", $false) - $runParams.Add("Local", $false) + $runParams.Add("Confirm", $false) + $runParams.Add("Local", $false) $runParams.Add("Verbose", $false) Update-SPSolution @runParams $solution = Get-SPSolution -Identity $params.Name -Verbose:$false - $solution.Properties["Version"] = $params.Version + $solution.Properties["Version"] = $params.Version $solution.Update() # Install new features... @@ -223,29 +223,29 @@ function Set-TargetResource else { #If ensure is absent we should also retract the solution first - $Deployed = $false + $Deployed = $false } - if ($Deployed -ne $CurrentValues.Deployed) + if ($Deployed -ne $CurrentValues.Deployed) { Write-Verbose -Message ("The deploy state of $Name is " + ` - "'$($CurrentValues.Deployed)' but should be '$Deployed'.") - if ($CurrentValues.Deployed) + "'$($CurrentValues.Deployed)' but should be '$Deployed'.") + if ($CurrentValues.Deployed) { - # Retract Solution globally + # Retract Solution globally $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $runParams = @{} $runParams.Add("Identity", $params.Name) $runParams.Add("Confirm", $false) $runParams.Add("Verbose", $false) - if ($solution.ContainsWebApplicationResource) + if ($solution.ContainsWebApplicationResource) { - if ($null -eq $webApps -or $webApps.Length -eq 0) + if ($null -eq $webApps -or $webApps.Length -eq 0) { $runParams.Add("AllWebApplications", $true) @@ -261,20 +261,20 @@ function Set-TargetResource } } } - else + else { Uninstall-SPSolution @runParams } } - } - else + } + else { - # Deploy solution + # Deploy solution $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $solution = Get-SPSolution -Identity $params.Name -Verbose:$false $runParams = @{ @@ -283,18 +283,18 @@ function Set-TargetResource Local = $false Verbose = $false } - if ($params.ContainsKey("SolutionLevel") -eq $true) + if ($params.ContainsKey("SolutionLevel") -eq $true) { $runParams.Add("CompatibilityLevel", $params.SolutionLevel) } - if (!$solution.ContainsWebApplicationResource) + if (!$solution.ContainsWebApplicationResource) { Install-SPSolution @runParams } else { - if ($null -eq $webApps -or $webApps.Length -eq 0) + if ($null -eq $webApps -or $webApps.Length -eq 0) { $runParams.Add("AllWebApplications", $true) @@ -304,7 +304,7 @@ function Set-TargetResource { foreach ($webApp in $webApps) { - $runParams["WebApplication"] = $webApp + $runParams["WebApplication"] = $webApp Install-SPSolution @runParams } @@ -312,7 +312,7 @@ function Set-TargetResource } } } - } + } Wait-SPDSCSolutionJob -SolutionName $Name -InstallAccount $InstallAccount @@ -322,7 +322,7 @@ function Set-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $runParams = @{ Identity = $params.Name Confirm = $false @@ -341,36 +341,36 @@ function Test-TargetResource [OutputType([Boolean])] param ( - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [System.String] $Name, - [Parameter(Mandatory = $true)] - [System.String] + [Parameter(Mandatory = $true)] + [System.String] $LiteralPath, - [Parameter()] - [System.String[]] - $WebApplications = @(), + [Parameter()] + [System.String[]] + $WebAppUrls = @(), - [Parameter()] + [Parameter()] [ValidateSet("Present","Absent")] [System.String] $Ensure = "Present", - + [Parameter()] [System.String] $Version = "1.0.0.0", - [Parameter()] + [Parameter()] [System.Boolean] $Deployed = $true, - [Parameter()] + [Parameter()] [ValidateSet("14","15","All")] [System.String] $SolutionLevel, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -383,11 +383,11 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $valuesToCheck = @("Ensure", "Version", "Deployed") - if ($WebApplications.Count -gt 0) + if ($WebAppUrls.Count -gt 0) { - $valuesToCheck += "WebApplications" + $valuesToCheck += "WebAppUrls" } - + return Test-SPDscParameterState -CurrentValues $CurrentValues ` -DesiredValues $PSBoundParameters ` -ValuesToCheck $valuesToCheck @@ -398,12 +398,12 @@ function Wait-SPDSCSolutionJob [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] [string] $SolutionName, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -415,7 +415,7 @@ function Wait-SPDSCSolutionJob $params = $args[0] $gc = Start-SPAssignment -Verbose:$false - + $solution = Get-SPSolution -Identity $params.Name -Verbose:$false -AssignmentCollection $gc if ($solution.JobExists -eq $true) @@ -428,9 +428,9 @@ function Wait-SPDSCSolutionJob Write-Verbose -Message ("$([DateTime]::Now.ToShortTimeString()) - Waiting for a " + ` "job for solution '$($params.Name)' to complete") - $loopCount++ + $loopCount++ Start-Sleep -Seconds 5 - + } Write-Verbose -Message "Result: $($solution.LastOperationResult)" diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.schema.mof index 4c06cf3a5..866f6a411 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/MSFT_SPFarmSolution.schema.mof @@ -3,7 +3,7 @@ class MSFT_SPFarmSolution : OMI_BaseResource { [Key, Description("The filename of the WSP package")] string Name; [Required, Description("The full path to the WSP file")] string LiteralPath; - [Write, Description("A list of the web applications to deploy this to")] string WebApplications[]; + [Write, Description("A list of the web applications to deploy this to")] string WebAppUrls[]; [Write, Description("Present if the WSP should be deployed, or Absent if it should be removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("The version of the package that is being modified")] string Version; [Write, Description("Should the solution be deployed to the farm, or just installed to the farm")] Boolean Deployed; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/Readme.md index 65ffe33a7..0cc89345f 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFarmSolution/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to make sure that a specific farm solution is either present or absent in a farm. The solution can be deployed to one or more web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPFeature/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPFeature/Readme.md index 716eef156..18a7bf4d7 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPFeature/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPFeature/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to make sure that a specific feature is either enabled or disabled at a given URL/scope. The Ensure property will dictate if the diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPHealthAnalyzerRuleState/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPHealthAnalyzerRuleState/Readme.md index 36742b1de..5af5cad93 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPHealthAnalyzerRuleState/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPHealthAnalyzerRuleState/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure Health Analyzer rules for the local farm. The resource is able to enable/disable and configure the specified rule. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.psm1 index 11739a70d..56a01397d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.psm1 @@ -5,6 +5,11 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] $Ensure, @@ -75,6 +80,7 @@ function Get-TargetResource $config = Get-SPInfoPathFormsService $nullReturn = @{ + IsSingleInstance = "Yes" AllowUserFormBrowserEnabling = $params.AllowUserFormBrowserEnabling AllowUserFormBrowserRendering = $params.AllowUserFormBrowserRendering MaxDataConnectionTimeout = $params.MaxDataConnectionTimeout @@ -97,6 +103,7 @@ function Get-TargetResource } return @{ + IsSingleInstance = "Yes" AllowUserFormBrowserEnabling = $config.AllowUserFormBrowserEnabling AllowUserFormBrowserRendering = $config.AllowUserFormBrowserRendering MaxDataConnectionTimeout = $config.MaxDataConnectionTimeout @@ -123,6 +130,11 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] $Ensure, @@ -274,6 +286,11 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] $Ensure, diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.schema.mof index 9f17d34e7..f372fe867 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/MSFT_SPInfoPathFormsServiceConfig.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPInfoPathFormsServiceConfig")] class MSFT_SPInfoPathFormsServiceConfig : OMI_BaseResource { - [Key, Description("Present ensures the settings are applied"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Present ensures the settings are applied"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("True sets the InfoPath Forms Service to allow users to browse forms")] Boolean AllowUserFormBrowserEnabling; [Write, Description("True sets the InfoPath Forms Service to render forms in the browser")] Boolean AllowUserFormBrowserRendering; [Write, Description("Sets the maximum connection timeout in milliseconds")] Uint32 MaxDataConnectionTimeout; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/readme.md index 496785e62..6c23a690d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInfoPathFormsServiceConfig/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuring the InfoPath Forms service within the local SharePoint farm. Using Ensure equals to Absent is not supported. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.psm1 index 223bbe76a..9330721d1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.psm1 @@ -4,6 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $BinaryDir, @@ -37,12 +42,13 @@ function Get-TargetResource $installedItems = $installedItemsX86 + $installedItemsX64 $installedItems = $installedItems | Select-Object -Property DisplayName -Unique $spInstall = $installedItems | Where-Object -FilterScript { - $_ -match "Microsoft SharePoint Server (2013|2016)" + $_ -match "Microsoft SharePoint Server (2013|2016|2019)" } if ($spInstall) { return @{ + IsSingleInstance = "Yes" BinaryDir = $BinaryDir ProductKey = $ProductKey InstallPath = $InstallPath @@ -53,6 +59,7 @@ function Get-TargetResource else { return @{ + IsSingleInstance = "Yes" BinaryDir = $BinaryDir ProductKey = $ProductKey InstallPath = $InstallPath @@ -70,6 +77,11 @@ function Set-TargetResource [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidGlobalVars", "")] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $BinaryDir, @@ -231,6 +243,11 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $BinaryDir, diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.schema.mof index abecf48cc..b5031a5b8 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/MSFT_SPInstall.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPInstall")] class MSFT_SPInstall : OMI_BaseResource { - [Key, Description("The directory that contains all of the SharePoint binaries")] String BinaryDir; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Required, Description("The directory that contains all of the SharePoint binaries")] String BinaryDir; [Required, Description("The product key to use during the installation")] String ProductKey; [Write, Description("The install directory to use in the installation, leave blank to use the setup defaults")] String InstallPath; [Write, Description("The data directory to use in the installation, leave blank to use the setup defaults")] String DataPath; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/Readme.md index 6eadc058a..1f85f9645 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstall/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Common +**Requires CredSSP:** No This resource is used to install the SharePoint binaries. The BinaryDir parameter should point to the path that setup.exe is located (not to setup.exe diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/MSFT_SPInstallLanguagePack.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/MSFT_SPInstallLanguagePack.psm1 index f94a0c86b..11569d431 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/MSFT_SPInstallLanguagePack.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/MSFT_SPInstallLanguagePack.psm1 @@ -296,13 +296,21 @@ function Set-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/Readme.md index fc28cb5a7..585df5026 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallLanguagePack/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to install the SharePoint Language Pack binaries. The BinaryDir parameter should point to the path that setup.exe is located (not to @@ -9,6 +10,6 @@ setup.exe itself). The BinaryInstallDays and BinaryInstallTime parameters specify a window in which the update can be installed. -With SharePoint 2016, the Language Packs are offered as an EXE package. You have -to extract this package before installing, using the following command: +Starting with SharePoint 2016, the Language Packs are offered as an EXE package. +You have to extract this package before installing, using the following command: .\serverlanguagepack.exe /extract:[Extract Folder] diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.psm1 index 4cc19b817..20f2594e2 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.psm1 @@ -50,6 +50,33 @@ $Script:SP2016Win12r2Features = @("Application-Server", "AS-NET-Framework", "PowerShell-V2", "WAS", "WAS-Process-Model", "WAS-NET-Environment", "WAS-Config-APIs") +$Script:SP2019Win16Features = @("Web-Server", "Web-WebServer", + "Web-Common-Http", "Web-Default-Doc", "Web-Dir-Browsing", + "Web-Http-Errors", "Web-Static-Content", "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-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", + "NET-Framework-Features", "NET-HTTP-Activation", "NET-Non-HTTP-Activ", + "NET-Framework-45-ASPNET", "NET-WCF-Pipe-Activation45", + "Windows-Identity-Foundation", "WAS", "WAS-Process-Model", + "WAS-NET-Environment", "WAS-Config-APIs", "XPS-Viewer") + +$Script:SP2019Win19Features = @("Web-Server", "Web-WebServer", + "Web-Common-Http", "Web-Default-Doc", "Web-Dir-Browsing", + "Web-Http-Errors", "Web-Static-Content", "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-Digest-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", + "NET-Framework-Features", "NET-HTTP-Activation", "NET-Non-HTTP-Activ", + "NET-Framework-45-ASPNET", "NET-WCF-Pipe-Activation45", + "Windows-Identity-Foundation", "WAS", "WAS-Process-Model", + "WAS-NET-Environment", "WAS-Config-APIs", "XPS-Viewer") function Get-TargetResource { @@ -57,6 +84,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $InstallerPath, @@ -121,6 +153,10 @@ function Get-TargetResource [System.String] $MSVCRT14, + [Parameter()] + [System.String] + $MSVCRT141, + [Parameter()] [System.String] $KB3092423, @@ -133,6 +169,10 @@ function Get-TargetResource [System.String] $DotNetFx, + [Parameter()] + [System.String] + $DotNet472, + [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -142,13 +182,21 @@ function Get-TargetResource Write-Verbose -Message "Getting installation status of SharePoint prerequisites" $majorVersion = (Get-SPDSCAssemblyVersion -PathToAssembly $InstallerPath) + $buildVersion = (Get-SPDSCBuildVersion -PathToAssembly $InstallerPath) if ($majorVersion -eq 15) { Write-Verbose -Message "Version: SharePoint 2013" } if ($majorVersion -eq 16) { - Write-Verbose -Message "Version: SharePoint 2016" + if($buildVersion -lt 5000) + { + Write-Verbose -Message "Version: SharePoint 2016" + } + elseif($buildVersion -ge 5000) + { + Write-Verbose -Message "Version: SharePoint 2019" + } } Write-Verbose -Message "Getting installed windows features" @@ -158,21 +206,42 @@ function Get-TargetResource { $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2013Features } - if ($majorVersion -eq 16) + elseif ($majorVersion -eq 16) { - if ($osVersion.Major -eq 10) - { - # Server 2016 - $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win16Features - } - elseif ($osVersion.Major -eq 6 -and $osVersion.Minor -eq 3) + if($buildVersion -lt 5000) { - # Server 2012 R2 - $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win12r2Features + if ($osVersion.Major -eq 10) + { + # Server 2016 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win16Features + } + elseif ($osVersion.Major -eq 6 -and $osVersion.Minor -eq 3) + { + # Server 2012 R2 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win12r2Features + } + else + { + throw "SharePoint 2016 only supports Windows Server 2016 or 2012 R2" + } } - else + # SharePoint 2019 + elseif($buildVersion -ge 5000) { - throw "SharePoint 2016 only supports Windows Server 2016 or 2012 R2" + if ($osVersion.Major -eq 11) + { + # Server 2019 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2019Win19Features + } + elseif ($osVersion.Major -eq 10) + { + # Server 2016 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2019Win16Features + } + else + { + throw "SharePoint 2019 only supports Windows Server 2016 or Windows Server 2019" + } } } @@ -189,12 +258,12 @@ function Get-TargetResource Write-Verbose -Message "Checking windows packages from the registry" $x86Path = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" - $installedItemsX86 = Get-ItemProperty -Path $x86Path | Select-Object -Property DisplayName + $installedItemsX86 = Get-ItemProperty -Path $x86Path | Select-Object -Property DisplayName, BundleUpgradeCode, DisplayVersion $x64Path = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" - $installedItemsX64 = Get-ItemProperty -Path $x64Path | Select-Object -Property DisplayName + $installedItemsX64 = Get-ItemProperty -Path $x64Path | Select-Object -Property DisplayName, BundleUpgradeCode, DisplayVersion - $installedItems = $installedItemsX86 + $installedItemsX64 | Select-Object -Property DisplayName -Unique + $installedItems = $installedItemsX86 + $installedItemsX64 | Select-Object -Property DisplayName, BundleUpgradeCode, DisplayVersion -Unique # Common prereqs $prereqsToTest = @( @@ -247,51 +316,74 @@ function Get-TargetResource ) } - #SP2016 prereqs + #SP2016/SP2019 prereqs if ($majorVersion -eq 16) { - $prereqsToTest += @( - [PSObject]@{ - Name = "Active Directory Rights Management Services Client 2.1" - SearchType = "Equals" - SearchValue = "Active Directory Rights Management Services Client 2.1" - }, - [PSObject]@{ - Name = "Microsoft SQL Server 2012 Native Client" - SearchType = "Equals" - SearchValue = "Microsoft SQL Server 2012 Native Client" - }, - [PSObject]@{ - Name = "Microsoft ODBC Driver 11 for SQL Server" - SearchType = "Equals" - SearchValue = "Microsoft ODBC Driver 11 for SQL Server" - }, - [PSObject]@{ - Name = "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0" - SearchType = "Like" - SearchValue = "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.*" - }, - [PSObject]@{ - Name = "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0" - SearchType = "Like" - SearchValue = "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.*" - }, - [PSObject]@{ - Name = "Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0" - SearchType = "Like" - SearchValue = "Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.*" - }, - [PSObject]@{ - Name = "Microsoft Visual C++ 2015 x64 Additional Runtime - 14.0" - SearchType = "Like" - SearchValue = "Microsoft Visual C++ 2015 x64 Additional Runtime - 14.0.*" - } - ) + if($buildVersion -lt 5000) + { + #SP2016 prereqs + $prereqsToTest += @( + [PSObject]@{ + Name = "Active Directory Rights Management Services Client 2.1" + SearchType = "Equals" + SearchValue = "Active Directory Rights Management Services Client 2.1" + }, + [PSObject]@{ + Name = "Microsoft SQL Server 2012 Native Client" + SearchType = "Equals" + SearchValue = "Microsoft SQL Server 2012 Native Client" + }, + [PSObject]@{ + Name = "Microsoft ODBC Driver 11 for SQL Server" + SearchType = "Equals" + SearchValue = "Microsoft ODBC Driver 11 for SQL Server" + }, + [PSObject]@{ + Name = "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0" + SearchType = "Like" + SearchValue = "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.*" + }, + [PSObject]@{ + Name = "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0" + SearchType = "Like" + SearchValue = "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.*" + }, + [PSObject]@{ + Name = "Microsoft Visual C++ 2015 Redistributable (x64)" + SearchType = "BundleUpgradeCode" + SearchValue = "{C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B}" + MinimumRequiredVersion = "14.0.23026.0" + } + ) + } + elseif($buildVersion -ge 5000) + { + #SP2019 prereqs + $prereqsToTest += @( + [PSObject]@{ + Name = "Active Directory Rights Management Services Client 2.1" + SearchType = "Equals" + SearchValue = "Active Directory Rights Management Services Client 2.1" + }, + [PSObject]@{ + Name = "Microsoft SQL Server 2012 Native Client" + SearchType = "Equals" + SearchValue = "Microsoft SQL Server 2012 Native Client" + }, + [PSObject]@{ + Name = "Microsoft Visual C++ 2017 Redistributable (x64)" + SearchType = "BundleUpgradeCode" + SearchValue = "{C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B}" + MinimumRequiredVersion = "14.13.26020.0" + } + ) + } } $prereqsInstalled = Test-SPDscPrereqInstallStatus -InstalledItems $installedItems ` -PrereqsToCheck $prereqsToTest $results = @{ + IsSingleInstance = "Yes" InstallerPath = $InstallerPath OnlineMode = $OnlineMode SXSpath = $SXSpath @@ -308,9 +400,11 @@ function Get-TargetResource WCFDataServices56 = $WCFDataServices56 MSVCRT11 = $MSVCRT11 MSVCRT14 = $MSVCRT14 + MSVCRT141 = $MSVCRT141 KB3092423 = $KB3092423 ODBC = $ODBC DotNetFx = $DotNetFx + DotNet472 = $DotNet472 } if ($prereqsInstalled -eq $true -and $windowsFeaturesInstalled -eq $true) @@ -332,6 +426,11 @@ function Set-TargetResource [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidGlobalVars", "")] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $InstallerPath, @@ -396,6 +495,10 @@ function Set-TargetResource [System.String] $MSVCRT14, + [Parameter()] + [System.String] + $MSVCRT141, + [Parameter()] [System.String] $KB3092423, @@ -408,6 +511,10 @@ function Set-TargetResource [System.String] $DotNetFx, + [Parameter()] + [System.String] + $DotNet472, + [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -425,6 +532,7 @@ function Set-TargetResource Write-Verbose -Message "Detecting SharePoint version from binaries" $majorVersion = Get-SPDSCAssemblyVersion -PathToAssembly $InstallerPath + $buildVersion = (Get-SPDSCBuildVersion -PathToAssembly $InstallerPath) $osVersion = Get-SPDscOSVersion if ($majorVersion -eq 15) @@ -473,25 +581,49 @@ function Set-TargetResource "MSIPCClient","WCFDataServices","KB2671763","WCFDataServices56") $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2013Features } - - if ($majorVersion -eq 16) + elseif ($majorVersion -eq 16) { - Write-Verbose -Message "Version: SharePoint 2016" - $requiredParams = @("SQLNCli","Sync","AppFabric","IDFX11","MSIPCClient","KB3092423", - "WCFDataServices56","DotNetFx","MSVCRT11","MSVCRT14","ODBC") - if ($osVersion.Major -eq 10) - { - # Server 2016 - $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win16Features - } - elseif ($osVersion.Major -eq 6 -and $osVersion.Minor -eq 3) + if($buildVersion -lt 5000) { - # Server 2012 R2 - $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win12r2Features + Write-Verbose -Message "Version: SharePoint 2016" + $requiredParams = @("SQLNCli","Sync","AppFabric","IDFX11","MSIPCClient","KB3092423", + "WCFDataServices56","DotNetFx","MSVCRT11","MSVCRT14","ODBC") + if ($osVersion.Major -eq 10) + { + # Server 2016 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win16Features + } + elseif ($osVersion.Major -eq 6 -and $osVersion.Minor -eq 3) + { + # Server 2012 R2 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2016Win12r2Features + } + else + { + throw "SharePoint 2016 only supports Windows Server 2016 or 2012 R2" + } } - else + # SharePoint 2019 + elseif($buildVersion -ge 5000) { - throw "SharePoint 2016 only supports Windows Server 2016 or 2012 R2" + Write-Verbose -Message "Version: SharePoint 2019" + $requiredParams = @("SQLNCli","Sync","AppFabric","IDFX11","MSIPCClient","KB3092423", + "WCFDataServices56","DotNet472","MSVCRT141") + + if ($osVersion.Major -eq 11) + { + # Server 2019 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2019Win19Features + } + elseif ($osVersion.Major -eq 10) + { + # Server 2016 + $WindowsFeatures = Get-WindowsFeature -Name $Script:SP2019Win16Features + } + else + { + throw "SharePoint 2019 only supports Windows Server 2016 or Windows Server 2019" + } } } @@ -610,6 +742,11 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $InstallerPath, @@ -674,6 +811,10 @@ function Test-TargetResource [System.String] $MSVCRT14, + [Parameter()] + [System.String] + $MSVCRT141, + [Parameter()] [System.String] $KB3092423, @@ -686,6 +827,10 @@ function Test-TargetResource [System.String] $DotNetFx, + [Parameter()] + [System.String] + $DotNet472, + [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -765,10 +910,43 @@ function Test-SPDscPrereqInstallStatus "on this system") } } + "BundleUpgradeCode" + { + $installedItem = $InstalledItems | Where-Object -FilterScript { + $null -ne $_.BundleUpgradeCode -and (($_.BundleUpgradeCode.Trim() | Compare-Object $itemToCheck.SearchValue) -eq $null) + } + if ($null -eq $installedItem) + { + $itemsInstalled = $false + Write-Verbose -Message ("Prerequisite $($itemToCheck.Name) was not found " + ` + "on this system") + } + else + { + $isRequiredVersionInstalled = $true; + + [int[]]$minimumRequiredVersion = $itemToCheck.MinimumRequiredVersion.Split('.') + [int[]]$installedVersion = $installedItem.DisplayVersion.Split('.') + for ([int]$index = 0; $index -lt $minimumRequiredVersion.Length -and $index -lt $installedVersion.Length; $index++) + { + if($minimumRequiredVersion[$index] -gt $installedVersion[$index]) + { + $isRequiredVersionInstalled = $false; + } + } + if ($installedVersion.Length -eq 0 -or -not $isRequiredVersionInstalled) + { + $itemsInstalled = $false + Write-Verbose -Message ("Prerequisite $($itemToCheck.Name) was found but had " + ` + "unexpected version. Expected minimum version $($itemToCheck.MinimumVersion) " + ` + "but found version $($installedItem.DisplayVersion).") + } + } + } Default { throw ("Unable to search for a prereq with mode '$($itemToCheck.SearchType)'. " + ` - "please use either 'Equals', 'Like' or 'Match'") + "please use either 'Equals', 'Like' or 'Match', or 'BundleUpgradeCode'") } } } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.schema.mof index 8718e7b26..06cc528ab 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/MSFT_SPInstallPrereqs.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPInstallPrereqs")] class MSFT_SPInstallPrereqs : OMI_BaseResource { - [Key, Description("The full path to prerequisiteinstaller.exe")] String InstallerPath; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Required, Description("The full path to prerequisiteinstaller.exe")] String InstallerPath; [Required, Description("Should the installer download prerequisites from the internet or not")] Boolean OnlineMode; [Write, Description("The path to the Windows Server Operating System SXS source files, for use in closed environments without access to Windows Update")] String SXSpath; [Write, Description("The path to the installer for this prerequisite (SP2013 and SP2016)")] String SQLNCli; @@ -20,5 +21,7 @@ class MSFT_SPInstallPrereqs : OMI_BaseResource [Write, Description("The path to the installer for this prerequisite (SP2016 only)")] String KB3092423; [Write, Description("The path to the installer for this prerequisite (SP2016 only)")] String ODBC; [Write, Description("The path to the installer for this prerequisite (SP2016 only)")] String DotNetFx; + [Write, Description("The path to the installer for this prerequisite (SP2019 only)")] String DotNet472; + [Write, Description("The path to the installer for this prerequisite (SP2019 only)")] String MSVCRT141; [Write, Description("Present to install the prerequisites. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/Readme.md index 87e188ac3..3b712b1d7 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPInstallPrereqs/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Common +**Requires CredSSP:** No This resource is responsible for ensuring the installation of all SharePoint prerequisites. It makes use of the PrerequisiteInstaller.exe file that is part @@ -45,3 +46,5 @@ https://technet.microsoft.com/library/a88d3f72-7ac3-4f08-b302-c4ca0a796268%28v=o SharePoint 2016: https://technet.microsoft.com/en-us/library/cc262485(v=office.16).aspx#section5 + +SharePoint 2019: diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.psm1 index 19c695270..63bc66dfa 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.psm1 @@ -4,65 +4,72 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] - [System.String] - [ValidateSet("Present","Absent")] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] + [System.String] + [ValidateSet("Present","Absent")] $Ensure, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $UseADRMS, - [Parameter()] - [System.String] + [Parameter()] + [System.String] $RMSserver, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - + Write-Verbose "Getting SharePoint IRM Settings" - + $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - - try + + try { $spFarm = Get-SPFarm - } - catch + } + catch { Write-Verbose -Message ("No local SharePoint farm was detected. IRM settings " + ` "will not be applied") return @{ - Ensure = "Absent" + IsSingleInstance = "Yes" + Ensure = "Absent" UseADRMS = $UseADRMS - RMSserver = $RMSserver + RMSserver = $RMSserver } } # Get a reference to the Administration WebService $admService = Get-SPDSCContentService - + if ($admService.IrmSettings.IrmRMSEnabled) { - $Ensure = "Present" + $Ensure = "Present" } else { $Ensure = "Absent" } - + return @{ - Ensure = $Ensure + IsSingleInstance = "Yes" + Ensure = $Ensure UseADRMS = $admService.IrmSettings.IrmRMSUseAD RMSserver = $admService.IrmSettings.IrmRMSCertServer } - } - return $Result + } + return $Result } function Set-TargetResource @@ -70,66 +77,71 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] - [System.String] - [ValidateSet("Present","Absent")] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] + [System.String] + [ValidateSet("Present","Absent")] $Ensure, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $UseADRMS, - [Parameter()] - [System.String] + [Parameter()] + [System.String] $RMSserver, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - + Write-Verbose "Setting SharePoint IRM Settings" - + Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - try + try { $spFarm = Get-SPFarm - } - catch + } + catch { throw "No local SharePoint farm was detected. IRM settings will not be applied" return } - + $admService = Get-SPDSCContentService - - if ($params.UseADRMS -and ($null -ne $params.RMSserver)) + + if ($params.UseADRMS -and ($null -ne $params.RMSserver)) { throw "Cannot specify both an RMSserver and set UseADRMS to True" } - - if ($params.UseADRMS -ne $true) + + if ($params.UseADRMS -ne $true) { - $params.UseADRMS = $false + $params.UseADRMS = $false } - + if ($params.Ensure -eq "Present") { $admService.IrmSettings.IrmRMSEnabled = $true $admService.IrmSettings.IrmRMSUseAD = $params.UseADRMS - $admService.IrmSettings.IrmRMSCertServer = $params.RMSserver - } - else + $admService.IrmSettings.IrmRMSCertServer = $params.RMSserver + } + else { $admService.IrmSettings.IrmRMSEnabled = $false - $admService.IrmSettings.IrmRMSUseAD = $false + $admService.IrmSettings.IrmRMSUseAD = $false $admService.IrmSettings.IrmRMSCertServer = $null } - $admService.Update() + $admService.Update() } } @@ -139,36 +151,41 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] - [System.String] - [ValidateSet("Present","Absent")] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] + [System.String] + [ValidateSet("Present","Absent")] $Ensure, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $UseADRMS, - [Parameter()] - [System.String] + [Parameter()] + [System.String] $RMSserver, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - + Write-Verbose "Testing SharePoint IRM settings" - + $CurrentValues = Get-TargetResource @PSBoundParameters - if ($null -eq $CurrentValues) + if ($null -eq $CurrentValues) { - return $false + return $false } - if ($UseADRMS -ne $true) + if ($UseADRMS -ne $true) { - $PSBoundParameters.UseADRMS = $false + $PSBoundParameters.UseADRMS = $false } return Test-SPDscParameterState -CurrentValues $CurrentValues ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.schema.mof index 658713eb2..09fe3d328 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/MSFT_SPIrmSettings.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPIrmSettings")] class MSFT_SPIrmSettings : OMI_BaseResource { - [Key, Description("Enable or Disable IRM on this farm"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Enable or Disable IRM on this farm"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, Description("Use the RMS server published in this farm's Active Directory")] Boolean UseADRMS; [Write, Description("Use the specified RMS server, must provide in URL format")] String RMSserver; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/Readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/Readme.md index 2e2ae6f2b..cd75a9a8e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/Readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPIrmSettings/Readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to manipulate the IRM settings in SharePoint, integrating it with AD RMS diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/MSFT_SPJoinFarm.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/MSFT_SPJoinFarm.psm1 deleted file mode 100644 index 1efe86925..000000000 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/MSFT_SPJoinFarm.psm1 +++ /dev/null @@ -1,128 +0,0 @@ -function Get-TargetResource -{ - [CmdletBinding()] - [OutputType([System.Collections.Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [Parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Passphrase, - - [Parameter()] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [Parameter()] - [System.String] - [ValidateSet("Application", - "ApplicationWithSearch", - "Custom", - "DistributedCache", - "Search", - "SingleServer", - "SingleServerFarm", - "WebFrontEnd", - "WebFrontEndWithDistributedCache")] - $ServerRole - ) - - Write-Verbose -Message "Getting local farm presence" - - throw ("SPCreateFarm: This resource has been removed. Please update your configuration " + ` - "to use SPFarm instead. See http://aka.ms/SPDsc-SPFarm for details.") -} - -function Set-TargetResource -{ - # Supressing the global variable use to allow passing DSC the reboot message - [CmdletBinding()] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidGlobalVars", "")] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [Parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Passphrase, - - [Parameter()] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [Parameter()] - [System.String] - [ValidateSet("Application", - "ApplicationWithSearch", - "Custom", - "DistributedCache", - "Search", - "SingleServer", - "SingleServerFarm", - "WebFrontEnd", - "WebFrontEndWithDistributedCache")] - $ServerRole - ) - - Write-Verbose -Message "Setting local farm" - - throw ("SPCreateFarm: This resource has been removed. Please update your configuration " + ` - "to use SPFarm instead. See http://aka.ms/SPDsc-SPFarm for details.") -} - -function Test-TargetResource -{ - [CmdletBinding()] - [OutputType([System.Boolean])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [Parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Passphrase, - - [Parameter()] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [Parameter()] - [System.String] - [ValidateSet("Application", - "ApplicationWithSearch", - "Custom", - "DistributedCache", - "Search", - "SingleServer", - "SingleServerFarm", - "WebFrontEnd", - "WebFrontEndWithDistributedCache")] - $ServerRole - ) - - Write-Verbose -Message "Testing for local farm presence" - - throw ("SPCreateFarm: This resource has been removed. Please update your configuration " + ` - "to use SPFarm instead. See http://aka.ms/SPDsc-SPFarm for details.") -} - -Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/MSFT_SPJoinFarm.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/MSFT_SPJoinFarm.schema.mof deleted file mode 100644 index 502031482..000000000 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/MSFT_SPJoinFarm.schema.mof +++ /dev/null @@ -1,9 +0,0 @@ -[ClassVersion("1.0.0.0"), FriendlyName("SPJoinFarm")] -class MSFT_SPJoinFarm : OMI_BaseResource -{ - [Key, Description("The name of the config database to connect to")] string FarmConfigDatabaseName; - [Key, Description("The server that hosts the config database")] string DatabaseServer; - [Required, Description("The passphrase that should be used to join the farm") , EmbeddedInstance("MSFT_Credential")] string Passphrase; - [Write, Description("SharePoint 2016 only - the MinRole role to enroll this server as"), ValueMap{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}, Values{"Application","ApplicationWithSearch","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","WebFrontEnd","WebFrontEndWithDistributedCache"}] string ServerRole; - [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; -}; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/readme.md deleted file mode 100644 index a7fd4456b..000000000 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPJoinFarm/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# Description - -WARNING: This resource has been removed. Please use SPFarm instead. -See http://aka.ms/SPDsc-SPFarm for details. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPLogLevel/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPLogLevel/readme.md index c1a8d5c2d..fb6670d92 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPLogLevel/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPLogLevel/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to change the minimum severity of events captured in the trace logs (ULS logs) and the Windows event logs. Settings can be changed diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPMachineTranslationServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPMachineTranslationServiceApp/readme.md index 9aa39c06b..a138b7904 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPMachineTranslationServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPMachineTranslationServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to provision and manage an instance of the Machine Translation Service Application. It will identify an instance of the MT diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedAccount/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedAccount/readme.md index 30b3d9cc2..8d3ce3979 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedAccount/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedAccount/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will ensure a managed account is provisioned in to the SharePoint farm. The Account object specific the credential to store (including username diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 index 5d6a0db23..e2599318f 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/MSFT_SPManagedMetaDataServiceApp.psm1 @@ -153,7 +153,7 @@ function Get-TargetResource default { throw ("Detected an unsupported major version of SharePoint. " + ` - "SharePointDsc only supports SharePoint 2013 or 2016.") + "SharePointDsc only supports SharePoint 2013, 2016 or 2019.") } } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/readme.md index 2dc8bc8b6..3ad63306b 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No Creates a managed metadata service application. The application pool property specifies which application pool it should use, and will reset the application diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceAppDefault/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceAppDefault/readme.md index 15de4750b..4114bfe89 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceAppDefault/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedMetadataServiceAppDefault/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No Using several managed metadata service instances in a farm requires some configuration, which service application proxy should be used as default diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedPath/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedPath/readme.md index fa8c37b6d..d3b137d9e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPManagedPath/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPManagedPath/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating managed paths associated with a specific web application. The WebAppUrl parameter is used to specify the web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.psm1 index c97b2b394..498449585 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.psm1 @@ -4,6 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [ValidateSet("Compliant","NonCompliant")] [System.String] @@ -19,7 +24,7 @@ function Get-TargetResource $installedVersion = Get-SPDSCInstalledProductVersion if ($installedVersion.FileMajorPart -ne 16) { - throw [Exception] "MinRole is only supported in SharePoint 2016." + throw [Exception] "MinRole is only supported in SharePoint 2016 and 2019." } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -32,15 +37,17 @@ function Get-TargetResource if ($null -eq $nonCompliantServices) { return @{ - State = "Compliant" - InstallAccount = $params.InstallAccount + IsSingleInstance = "Yes" + State = "Compliant" + InstallAccount = $params.InstallAccount } } else { return @{ - State = "NonCompliant" - InstallAccount = $params.InstallAccount + IsSingleInstance = "Yes" + State = "NonCompliant" + InstallAccount = $params.InstallAccount } } } @@ -60,6 +67,11 @@ function Set-TargetResource [CmdletBinding()] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [ValidateSet("Compliant","NonCompliant")] [System.String] @@ -75,7 +87,7 @@ function Set-TargetResource $installedVersion = Get-SPDSCInstalledProductVersion if ($installedVersion.FileMajorPart -ne 16) { - throw [Exception] "MinRole is only supported in SharePoint 2016." + throw [Exception] "MinRole is only supported in SharePoint 2016 and 2019." } if ($State -eq "NonCompliant") @@ -119,6 +131,11 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [ValidateSet("Compliant","NonCompliant")] [System.String] diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.schema.mof index 29c6f577c..9c0a4c06f 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/MSFT_SPMinRoleCompliance.schema.mof @@ -1,6 +1,7 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPMinRoleCompliance")] class MSFT_SPMinRoleCompliance : OMI_BaseResource { - [Key, Description("Should the state be set to compliant"), ValueMap{"Compliant", "NonCompliant"}, Values{"Compliant", "NonCompliant"}] string State; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Required, Description("Should the state be set to compliant"), ValueMap{"Compliant", "NonCompliant"}, Values{"Compliant", "NonCompliant"}] string State; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/readme.md index 7eac25dd8..999f2dc45 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPMinRoleCompliance/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Utility +**Requires CredSSP:** No This resource will help manage compliance of MinRole based servers. Each time the resource runs it will investigate which service instances should be running diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPOfficeOnlineServerBinding/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPOfficeOnlineServerBinding/readme.md index 8509e0cdf..70b2067f7 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPOfficeOnlineServerBinding/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPOfficeOnlineServerBinding/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will create a binding to an Office Online Server (formerly known as Office Web Apps). The DnsName property can be a single server name, or a diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.psm1 index 06a571399..adaea7295 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.psm1 @@ -43,13 +43,13 @@ function Get-TargetResource if (($PSBoundParameters.ContainsKey("UseTLS") -eq $true) ` -and $installedVersion.FileMajorPart -ne 16) { - throw [Exception] "UseTLS is only supported in SharePoint 2016." + throw [Exception] "UseTLS is only supported in SharePoint 2016 and SharePoint 2019." } if (($PSBoundParameters.ContainsKey("SMTPPort") -eq $true) ` -and $installedVersion.FileMajorPart -ne 16) { - throw [Exception] "SMTPPort is only supported in SharePoint 2016." + throw [Exception] "SMTPPort is only supported in SharePoint 2016 and SharePoint 2019." } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -128,13 +128,13 @@ function Set-TargetResource if (($PSBoundParameters.ContainsKey("UseTLS") -eq $true) ` -and $installedVersion.FileMajorPart -lt 16) { - throw [Exception] "UseTLS is only supported in SharePoint 2016." + throw [Exception] "UseTLS is only supported in SharePoint 2016 and SharePoint 2019." } if (($PSBoundParameters.ContainsKey("SMTPPort") -eq $true) ` -and $installedVersion.FileMajorPart -lt 16) { - throw [Exception] "SMTPPort is only supported in SharePoint 2016." + throw [Exception] "SMTPPort is only supported in SharePoint 2016 and SharePoint 2019." } $null = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -188,7 +188,7 @@ function Set-TargetResource } default { throw ("Detected an unsupported major version of SharePoint. SharePointDsc only " + ` - "supports SharePoint 2013 or 2016.") + "supports SharePoint 2013, 2016 or 2019.") } } } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.schema.mof index 8f3c9376f..25fb7527c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/MSFT_SPOutgoingEmailSettings.schema.mof @@ -6,8 +6,8 @@ class MSFT_SPOutgoingEmailSettings : OMI_BaseResource [Required, Description("The from address to put on messages")] string FromAddress; [Required, Description("The email address that replies should be directed to")] string ReplyToAddress; [Required, Description("The character set to use on messages")] string CharacterSet; - [Write, Description("Use TLS when connecting to the SMTP server (SharePoint 2016 only)")] boolean UseTLS; - [Write, Description("The port which is used to connect to the SMTP server (SharePoint 2016 only)")] uint32 SMTPPort; + [Write, Description("Use TLS when connecting to the SMTP server (SharePoint 2016 and 2019 only)")] boolean UseTLS; + [Write, Description("The port which is used to connect to the SMTP server (SharePoint 2016 and 2019 only)")] uint32 SMTPPort; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/readme.md index 31a3f1ccc..37f35ad6f 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPOutgoingEmailSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to set the outgoing email settings for either a single web application, or the whole farm. To configure the resource for a specific diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.psm1 index 80b1d16f7..55c447ddf 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.psm1 @@ -4,7 +4,12 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter(Mandatory = $true)] [System.String] $MailAddress, @@ -17,12 +22,12 @@ function Get-TargetResource [ValidateRange(0,36000)] [System.UInt32] $PasswordChangeWaitTimeSeconds, - - [Parameter()] + + [Parameter()] [ValidateRange(0,99)] [System.UInt32] $NumberOfRetries, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -34,17 +39,18 @@ function Get-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - + $farm = Get-SPFarm - if ($null -eq $farm ) + if ($null -eq $farm ) { - return $null + return $null } return @{ + IsSingleInstance = "Yes" MailAddress = $farm.PasswordChangeEmailAddress PasswordChangeWaitTimeSeconds= $farm.PasswordChangeGuardTime NumberOfRetries= $farm.PasswordChangeMaximumTries - DaysBeforeExpiry = $farm.DaysBeforePasswordExpirationToSendEmail + DaysBeforeExpiry = $farm.DaysBeforePasswordExpirationToSendEmail } } return $result @@ -55,7 +61,12 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter(Mandatory = $true)] [System.String] $MailAddress, @@ -68,12 +79,12 @@ function Set-TargetResource [ValidateRange(0,36000)] [System.UInt32] $PasswordChangeWaitTimeSeconds, - - [Parameter()] + + [Parameter()] [ValidateRange(0,99)] [System.UInt32] $NumberOfRetries, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -85,23 +96,23 @@ function Set-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - $farm = Get-SPFarm -ErrorAction Continue + $farm = Get-SPFarm -ErrorAction Continue - if ($null -eq $farm ) + if ($null -eq $farm ) { - return $null + return $null } - + $farm.PasswordChangeEmailAddress = $params.MailAddress - if ($null -ne $params.PasswordChangeWaitTimeSeconds) + if ($null -ne $params.PasswordChangeWaitTimeSeconds) { $farm.PasswordChangeGuardTime = $params.PasswordChangeWaitTimeSeconds } - if ($null -ne $params.NumberOfRetries) + if ($null -ne $params.NumberOfRetries) { $farm.PasswordChangeMaximumTries = $params.NumberOfRetries } - if ($null -ne $params.DaysBeforeExpiry) + if ($null -ne $params.DaysBeforeExpiry) { $farm.DaysBeforePasswordExpirationToSendEmail = $params.DaysBeforeExpiry } @@ -115,7 +126,12 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter(Mandatory = $true)] [System.String] $MailAddress, @@ -128,12 +144,12 @@ function Test-TargetResource [ValidateRange(0,36000)] [System.UInt32] $PasswordChangeWaitTimeSeconds, - - [Parameter()] + + [Parameter()] [ValidateRange(0,99)] [System.UInt32] $NumberOfRetries, - + [Parameter()] [System.Management.Automation.PSCredential] $InstallAccount @@ -147,13 +163,13 @@ function Test-TargetResource { return $false } - + return Test-SPDscParameterState -CurrentValues $CurrentValues ` -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("MailAddress", + -ValuesToCheck @("MailAddress", "DaysBeforeExpiry", "PasswordChangeWaitTimeSeconds", - "NumberOfRetries") + "NumberOfRetries") } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.schema.mof index fad54d4f7..384ab3414 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/MSFT_SPPasswordChangeSettings.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPPasswordChangeSettings")] class MSFT_SPPasswordChangeSettings : OMI_BaseResource { - [key, Description("The email address to send notifications of password changes to")] string MailAddress; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Required, Description("The email address to send notifications of password changes to")] string MailAddress; [Write, Description("The number of days before password expiry to send send emails")] Uint32 DaysBeforeExpiry; [Write, Description("The duration that a password reset will wait for before it times out")] Uint32 PasswordChangeWaitTimeSeconds; [Write, Description("How many retries if the password change fails")] Uint32 NumberOfRetries; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/readme.md index 2aa70c084..3bbe7d79a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPPasswordChangeSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to control settings that relate to the automatic changing of passwords for managed accounts (where they opt-in to be managed by diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPPerformancePointServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPPerformancePointServiceApp/readme.md index c82e7773c..fce56f431 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPPerformancePointServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPPerformancePointServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating Performance Point Service Application instances within the local SharePoint farm. The resource will provision and diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPPowerPointAutomationServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPPowerPointAutomationServiceApp/readme.md new file mode 100644 index 000000000..5aa2accb4 --- /dev/null +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPPowerPointAutomationServiceApp/readme.md @@ -0,0 +1,11 @@ +# Description + +**Type:** Distributed +**Requires CredSSP:** No + +This resource is responsible for creating PowerPoint Automation Service +Application instances within the local SharePoint farm. The resource will +provision and configure the PowerPoint Automation Service Application. + +The default value for the Ensure parameter is Present. When not specifying this +parameter, the service application is provisioned. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/MSFT_SPProductUpdate.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/MSFT_SPProductUpdate.psm1 index a3eb513ee..9b7da8150 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/MSFT_SPProductUpdate.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/MSFT_SPProductUpdate.psm1 @@ -326,7 +326,8 @@ function Set-TargetResource } # To prevent an endless loop: Check if an upgrade is required. - if ((Get-SPDSCInstalledProductVersion).FileMajorPart -eq 15) + $installedVersion = Get-SPDSCInstalledProductVersion + if ($spVersion.FileMajorPart -eq 15) { $wssRegKey ="hklm:SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS" } @@ -356,7 +357,7 @@ function Set-TargetResource $osearchStopped = $false $hostControllerStopped = $false - if ((Get-SPDSCInstalledProductVersion).FileMajorPart -eq 15) + if ($installedVersion.FileMajorPart -eq 15) { $searchServiceName = "OSearch15" } @@ -401,7 +402,11 @@ function Set-TargetResource Write-Verbose -Message "Stopping other services" - Set-Service -Name "IISADMIN" -StartupType Disabled + if($InstalledVersion.FileMajorPart -eq 15 -or $installedVersion.ProductBuildPart.ToString().Length -eq 4) + { + Write-Verbose -Message "SharePoint 2013 or 2016 used, reconfiguring IISAdmin service to Disabled startup." + Set-Service -Name "IISADMIN" -StartupType Disabled + } Set-Service -Name "SPTimerV4" -StartupType Disabled $iisreset = Start-Process -FilePath "iisreset.exe" ` @@ -453,7 +458,12 @@ function Set-TargetResource { Write-Verbose -Message "Restart stopped services" Set-Service -Name "SPTimerV4" -StartupType Automatic - Set-Service -Name "IISADMIN" -StartupType Automatic + + if($InstalledVersion.FileMajorPart -eq 15 -or $installedVersion.ProductBuildPart.ToString().Length -eq 4) + { + Write-Verbose -Message "SharePoint 2013 or 2016 used, reconfiguring IISAdmin service to Automatic startup." + Set-Service -Name "IISADMIN" -StartupType Automatic + } $timerSvc = Get-Service -Name "SPTimerV4" $timerSvc.Start() diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/readme.md index 24c133a51..6aef2cdfb 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProductUpdate/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Common +**Requires CredSSP:** No This resource is used to perform the update step of installing SharePoint updates, like Cumulative Updates and Service Packs. The SetupFile parameter diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/MSFT_SPProjectServerADResourcePoolSync.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/MSFT_SPProjectServerADResourcePoolSync.psm1 index 0fa2d94a7..802385942 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/MSFT_SPProjectServerADResourcePoolSync.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/MSFT_SPProjectServerADResourcePoolSync.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -133,7 +133,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } if ($Ensure -eq "Present") diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/readme.md index a79782aa6..c3b85fa9d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerADResourcePoolSync/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to control the settings of the Active Directory resource pool sync for Project Server, for a specific PWA instance. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/MSFT_SPProjectServerAdditionalSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/MSFT_SPProjectServerAdditionalSettings.psm1 index 837088f06..e4515740e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/MSFT_SPProjectServerAdditionalSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/MSFT_SPProjectServerAdditionalSettings.psm1 @@ -30,7 +30,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -101,7 +101,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } Invoke-SPDSCCommand -Credential $InstallAccount ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/readme.md index 1e9e84a24..5f0fb9bab 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerAdditionalSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to manage the "additional settings" for a PWA instance (based on what is in the 'additional settings' page of the web interface). diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/MSFT_SPProjectServerGlobalPermissions.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/MSFT_SPProjectServerGlobalPermissions.psm1 index 64d18f5db..e58020795 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/MSFT_SPProjectServerGlobalPermissions.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/MSFT_SPProjectServerGlobalPermissions.psm1 @@ -35,7 +35,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/readme.md index e1ca0a8ac..a1bab3324 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGlobalPermissions/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource allows you to enforce global permissions in a PWA site for a specific project server group or an individual resource. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/MSFT_SPProjectServerGroup.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/MSFT_SPProjectServerGroup.psm1 index 0cbd47993..5c5f13c20 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/MSFT_SPProjectServerGroup.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/MSFT_SPProjectServerGroup.psm1 @@ -47,7 +47,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } if ($PSBoundParameters.ContainsKey("ADGroup") -eq $true -and ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/readme.md index 37c077dfa..4a4dc75c1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerGroup/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure a group within Project Server. This is only available for use when the site is configured to use Project Server permissions diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.psm1 index 165ef1cdd..a9377d242 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.psm1 @@ -5,9 +5,14 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, + $Ensure = "Present", [Parameter()] [System.String] @@ -23,7 +28,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -35,7 +40,19 @@ function Get-TargetResource { $currentLicense = Get-ProjectServerLicense - if ($currentLicense[0] -match "Project Server [0-9]{4} : (?[a-zA-Z]+)") + # Check if result is an array. If so, the result is multi-lined. + # We only need the first line. + if ($currentLicense -is [Array]) + { + $currentLicense = $currentLicense[0] + } + + # SP2016 value is "Project Server 2016 : Active" (space after 2016) + # SP2019 value is "Project Server 2019: Active" (no space after 2019) + # SP2019 Preview value is "Project Server 2019 Preview: Active" + $regex = "Project Server [0-9]{4}\s*\w*: (?[a-zA-Z]+)" + + if ($currentLicense -match $regex) { if ($Matches.Status -eq "Active") { @@ -47,6 +64,7 @@ function Get-TargetResource } return @{ + IsSingleInstance = "Yes" Ensure = $status ProductKey = $params.ProductKey InstallAccount = $params.InstallAccount @@ -56,6 +74,7 @@ function Get-TargetResource { Write-Verbose -Message "Unable to determine the license status for Project Server" return @{ + IsSingleInstance = "Yes" Ensure = "Absent" ProductKey = $params.ProductKey InstallAccount = $params.InstallAccount @@ -66,6 +85,7 @@ function Get-TargetResource { Write-Verbose -Message "Unable to determine the license status for Project Server" return @{ + IsSingleInstance = "Yes" Ensure = "Absent" ProductKey = $params.ProductKey InstallAccount = $params.InstallAccount @@ -82,9 +102,14 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, + $Ensure = "Present", [Parameter()] [System.String] @@ -100,12 +125,12 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } if ($Ensure -eq "Present" -and $PSBoundParameters.ContainsKey("ProductKey") -eq $false) { - throw [Exception] "ProductKey is requried when Ensure equals 'Present'" + throw [Exception] "ProductKey is required when Ensure equals 'Present'" } $currentValues = Get-TargetResource @PSBoundParameters @@ -143,9 +168,14 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + + [Parameter()] [ValidateSet("Present","Absent")] [System.String] - $Ensure, + $Ensure = "Present", [Parameter()] [System.String] @@ -158,6 +188,8 @@ function Test-TargetResource Write-Verbose -Message "Testing Project Server License status" + $PSBoundParameters.Ensure = $Ensure + $currentValues = Get-TargetResource @PSBoundParameters return Test-SPDscParameterState -CurrentValues $CurrentValues ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.schema.mof index e9da7ffa6..eb2660b09 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/MSFT_SPProjectServerLicense.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPProjectServerLicense")] class MSFT_SPProjectServerLicense : OMI_BaseResource { - [Key, Description("Should a Project Server license be enabled or disabled"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Write, Description("Should a Project Server license be enabled or disabled"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("What is the product key for Project Server")] string ProductKey; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/readme.md index b413b9494..442317adc 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerLicense/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to enable a Project Server license in to a SharePoint -2016 farm. +2016 or 2019 farm. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/MSFT_SPProjectServerPermissionMode.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/MSFT_SPProjectServerPermissionMode.psm1 index 9a98373a4..8deb550df 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/MSFT_SPProjectServerPermissionMode.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/MSFT_SPProjectServerPermissionMode.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -73,7 +73,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } Invoke-SPDSCCommand -Credential $InstallAccount ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/readme.md index c9939c57b..3dddb378a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerPermissionMode/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource allows you to set the permissions mode (either SharePoint or ProjectServer) for a specific project server site. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/MSFT_SPProjectServerServiceApp.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/MSFT_SPProjectServerServiceApp.psm1 index 97130b58a..82c2d4ea3 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/MSFT_SPProjectServerServiceApp.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/MSFT_SPProjectServerServiceApp.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -118,7 +118,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Get-TargetResource @PSBoundParameters diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/readme.md index 5b1784eb0..5ed42f1e2 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/readme.md @@ -1,9 +1,10 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for provisioning and managing the Project Server -service application in SharePoint Server 2016. +service application in SharePoint Server 2016 or 2019. To create a Project Server site the following DSC resources can be used to create the site and enable the feature. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/MSFT_SPProjectServerTimeSheetSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/MSFT_SPProjectServerTimeSheetSettings.psm1 index c7a77ae40..61923d1a5 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/MSFT_SPProjectServerTimeSheetSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/MSFT_SPProjectServerTimeSheetSettings.psm1 @@ -98,7 +98,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -341,7 +341,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } Invoke-SPDSCCommand -Credential $InstallAccount ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/readme.md index ca26f8c18..7937c9a56 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerTimeSheetSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No Allows you to configure the default timesheet settings for a specific PWA instance. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/MSFT_SPProjectServerUserSyncSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/MSFT_SPProjectServerUserSyncSettings.psm1 index 9daeff8c0..9a96cb041 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/MSFT_SPProjectServerUserSyncSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/MSFT_SPProjectServerUserSyncSettings.psm1 @@ -30,7 +30,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/readme.md index 15a73bb6a..72d4b618d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerUserSyncSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuration of the user sync settings between projects and project sites. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/MSFT_SPProjectServerWssSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/MSFT_SPProjectServerWssSettings.psm1 index 9cb1b8713..4e31ed163 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/MSFT_SPProjectServerWssSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/MSFT_SPProjectServerWssSettings.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -lt 16) { throw [Exception] ("Support for Project Server in SharePointDsc is only valid for " + ` - "SharePoint 2016.") + "SharePoint 2016 and 2019.") } $result = Invoke-SPDSCCommand -Credential $InstallAccount ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/readme.md index f04d6749e..fe6546141 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPProjectServerWssSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to control settings that relate to the SharePoint sites that are linked to projects in Project Server. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPPublishServiceApplication/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPPublishServiceApplication/readme.md index 462dbfc17..55a213114 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPPublishServiceApplication/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPPublishServiceApplication/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to specify if a specific service application should be published (Ensure = "Present") or not published (Ensure = "Absent") on the @@ -8,7 +9,7 @@ current server. The name is the display name of the service application as shown in the Central Admin website. You can publish the following service applications in a SharePoint Server -2013/2016 farm: +2013/2016/2019 farm: * Business Data Connectivity * Machine Translation diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPQuotaTemplate/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPQuotaTemplate/readme.md index 99e56b6fa..99e30643c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPQuotaTemplate/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPQuotaTemplate/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure quota templates in the farm. These settings will be used to make sure a certain quota template exists or not. When it diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPRemoteFarmTrust/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPRemoteFarmTrust/readme.md index 110dcf5c6..54c1b7d7c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPRemoteFarmTrust/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPRemoteFarmTrust/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to trust a remote SharePoint farm. This is used when federating search results between two different SharePoint farms. The diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchAuthoritativePage/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchAuthoritativePage/readme.md index dd6fa7e35..1d1e3b2f5 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchAuthoritativePage/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchAuthoritativePage/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for managing the search authoritative pages in the search service application. You can create new pages, change existing pages and diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.psm1 index 79786ce43..aed463463 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.psm1 @@ -13,15 +13,15 @@ function Get-TargetResource $ServiceAppName, [Parameter(Mandatory = $true)] - [ValidateSet("SharePoint","Website","FileShare")] + [ValidateSet("SharePoint","Website","FileShare","Business")] [System.String] $ContentSourceType, - [Parameter(Mandatory = $true)] + [Parameter()] [System.String[]] $Addresses, - [Parameter(Mandatory = $true)] + [Parameter()] [ValidateSet("CrawlEverything","CrawlFirstOnly","Custom")] [System.String] $CrawlSetting, @@ -51,6 +51,10 @@ function Get-TargetResource [System.UInt32] $LimitServerHops, + [Parameter()] + [System.String[]] + $LOBSystemSet, + [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -177,9 +181,34 @@ function Get-TargetResource Priority = $source.CrawlPriority } } + "Business" { + $result = @{ + Name = $params.Name + ServiceAppName = $params.ServiceAppName + Ensure = "Present" + ContentSourceType = "Business" + CrawlSetting = $crawlSetting + IncrementalSchedule = $incrementalSchedule + FullSchedule = $fullSchedule + Priority = $source.CrawlPriority + } + + if($null -ne $params.LOBSystemSet) + { + $bdcSegments = $source.StartAddresses[0].Segments + if($bdcSegments.Length -ge 5) + { + [Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null + $LOBSystemName = [System.Web.HttpUtility]::UrlDecode($bdcSegments[4].Replace("/", "")) + $LOBSystemInstanceName = [System.Web.HttpUtility]::UrlDecode($bdcSegments[5].Split('&')[0]) + $LOBSystemSet = @($LOBSystemName, $LOBSystemInstanceName) + $result.Add("LOBSystemSet", $LOBSystemSet) + } + } + } Default { throw ("SharePointDsc does not currently support '$($source.Type)' content " + ` - "sources. Please use only 'SharePoint', 'FileShare' or 'Website'.") + "sources. Please use only 'SharePoint', 'FileShare', 'Website' or 'Business'.") } } return $result @@ -201,15 +230,15 @@ function Set-TargetResource $ServiceAppName, [Parameter(Mandatory = $true)] - [ValidateSet("SharePoint","Website","FileShare")] + [ValidateSet("SharePoint","Website","FileShare","Business")] [System.String] $ContentSourceType, - [Parameter(Mandatory = $true)] + [Parameter()] [System.String[]] $Addresses, - [Parameter(Mandatory = $true)] + [Parameter()] [ValidateSet("CrawlEverything","CrawlFirstOnly","Custom")] [System.String] $CrawlSetting, @@ -239,6 +268,10 @@ function Set-TargetResource [System.UInt32] $LimitServerHops, + [Parameter()] + [System.String[]] + $LOBSystemSet, + [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -274,7 +307,7 @@ function Set-TargetResource } if ($CrawlSetting -eq "Custom") { - throw ("Parameter 'CrawlSetting' can only be set to custom for website content " + ` + throw ("Parameter CrawlSetting can only be set to custom for website content " + ` "sources") } } @@ -299,7 +332,21 @@ function Set-TargetResource } if ($CrawlSetting -eq "Custom") { - throw "Parameter 'CrawlSetting' can only be set to custom for website content sources" + throw "Parameter CrawlSetting can only be set to custom for website content sources" + } + } + "Business" { + if ($PSBoundParameters.ContainsKey("ContinuousCrawl") -eq $true) + { + throw "Parameter ContinuousCrawl is not valid for Business content sources" + } + if ($PSBoundParameters.ContainsKey("LimitPageDepth") -eq $true) + { + throw "Parameter LimitPageDepth is not valid for Business content sources" + } + if ($PSBoundParameters.ContainsKey("LimitServerHops") -eq $true) + { + throw "Parameter LimitServerHops is not valid for Business content sources" } } } @@ -357,7 +404,29 @@ function Set-TargetResource "FileShare" { $newType = "File" } + "Business" { + $newType = "Business" + } } + if($params.ContentSourceType -ne "Business") + { + $source = New-SPEnterpriseSearchCrawlContentSource ` + -SearchApplication $params.ServiceAppName ` + -Type $newType ` + -Name $params.Name ` + -StartAddresses $startAddresses + } + else + { + $proxyGroup = Get-SPServiceApplicationProxyGroup -Default + $source = New-SPEnterpriseSearchCrawlContentSource ` + -SearchApplication $params.ServiceAppName ` + -Type $newType ` + -Name $params.Name ` + -BDCApplicationProxyGroup $proxyGroup ` + -LOBSystemSet $params.LOBSystemSet + } + $source = New-SPEnterpriseSearchCrawlContentSource ` -SearchApplication $params.ServiceAppName ` -Type $newType ` @@ -632,15 +701,15 @@ function Test-TargetResource $ServiceAppName, [Parameter(Mandatory = $true)] - [ValidateSet("SharePoint","Website","FileShare")] + [ValidateSet("SharePoint","Website","FileShare","Business")] [System.String] $ContentSourceType, - [Parameter(Mandatory = $true)] + [Parameter()] [System.String[]] $Addresses, - [Parameter(Mandatory = $true)] + [Parameter()] [ValidateSet("CrawlEverything","CrawlFirstOnly","Custom")] [System.String] $CrawlSetting, @@ -670,6 +739,10 @@ function Test-TargetResource [System.UInt32] $LimitServerHops, + [Parameter()] + [System.String[]] + $LOBSystemSet, + [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -707,7 +780,7 @@ function Test-TargetResource } if ($CrawlSetting -eq "Custom") { - throw ("Parameter 'CrawlSetting' can only be set to custom for website content " + ` + throw ("Parameter CrawlSetting can only be set to custom for website content " + ` "sources") } } @@ -732,7 +805,21 @@ function Test-TargetResource } if ($CrawlSetting -eq "Custom") { - throw "Parameter 'CrawlSetting' can only be set to custom for website content sources" + throw "Parameter CrawlSetting can only be set to custom for website content sources" + } + } + "Business" { + if ($PSBoundParameters.ContainsKey("ContinuousCrawl") -eq $true) + { + throw "Parameter ContinuousCrawl is not valid for Business content sources" + } + if ($PSBoundParameters.ContainsKey("LimitPageDepth") -eq $true) + { + throw "Parameter LimitPageDepth is not valid for Business content sources" + } + if ($PSBoundParameters.ContainsKey("LimitServerHops") -eq $true) + { + throw "Parameter LimitServerHops is not valid for Business content sources" } } } @@ -797,6 +884,7 @@ function Test-TargetResource "Priority", "LimitPageDepth", "LimitServerHops", + "LOBSystemSet", "Ensure") } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.schema.mof index 03b8db0dc..5cbb7d2c0 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/MSFT_SPSearchContentSource.schema.mof @@ -16,15 +16,16 @@ class MSFT_SPSearchContentSource : OMI_BaseResource { [Key, Description("The name of the content source")] String Name; [Key, Description("The name of the search service app that this content source exists within")] String ServiceAppName; - [Required, Description("The type of content source - currently only SharePoint, Website and File Shares are supported"), ValueMap{"SharePoint","Website","FileShare"}, Values{"SharePoint","Website","FileShare"}] String ContentSourceType; - [Required, Description("A list of the addresses this content source includes")] String Addresses[]; - [Required, Description("Should the crawler index everything, just the first site or page, or a custom depth (applies to websites only)"), ValueMap{"CrawlEverything","CrawlFirstOnly","Custom"}, Values{"CrawlEverything","CrawlFirstOnly","Custom"}] String CrawlSetting; + [Required, Description("The type of content source - currently only SharePoint, Website, File Shares and Business are supported"), ValueMap{"SharePoint","Website","FileShare","Business"}, Values{"SharePoint","Website","FileShare","Business"}] String ContentSourceType; + [Write, Description("A list of the addresses this content source includes")] String Addresses[]; + [Write, Description("Should the crawler index everything, just the first site or page, or a custom depth (applies to websites only)"), ValueMap{"CrawlEverything","CrawlFirstOnly","Custom"}, Values{"CrawlEverything","CrawlFirstOnly","Custom"}] String CrawlSetting; [Write, Description("Should this content source use continuous crawl (SharePoint sites only)")] Boolean ContinuousCrawl; [Write, Description("What is the incremental schedule for this content source"), EmbeddedInstance("MSFT_SPSearchCrawlSchedule")] String IncrementalSchedule; [Write, Description("What is the full schedule for this content source"), EmbeddedInstance("MSFT_SPSearchCrawlSchedule")] String FullSchedule; [Write, Description("What is the priority on this content source"), ValueMap{"Normal","High"}, Values{"Normal","High"}] String Priority; [Write, Description("How many pages deep should the crawler go (-1 = unlimited, website sources only)")] Uint32 LimitPageDepth; [Write, Description("How many server hops should the crawler make (-1 = unlimtied, website sources only)")] Uint32 LimitServerHops; + [Write, Description("Line of Business System and System Instance names")] String LOBSystemSet[]; [Write, Description("Present if the source should exist, absent if it should not"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("Specify true if DSC is allowed to delete and recreate a content source to apply the correct settings, otherwise false will just report errors if a change can not be applied.")] Boolean Force; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/readme.md index 30d452cf3..27f0dcb72 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchContentSource/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will deploy and configure a content source in a specified search service application. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlMapping/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlMapping/readme.md index 7e7dab770..d7071967a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlMapping/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlMapping/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for managing the search crawl mapping in the search service application. You can create new mappings, change existing mappings diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlRule/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlRule/readme.md index 18f97cfd3..c0db5e6b1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlRule/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlRule/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for managing the search crawl rules in the search service application. You can create new rules, change existing rules and remove diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlerImpactRule/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlerImpactRule/readme.md index 4e971d332..910a66bb5 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlerImpactRule/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchCrawlerImpactRule/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for managing the search crawl impact rules in the search service application. You can create new rules, change existing rules and diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchFileType/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchFileType/readme.md index 53de58caf..a33bb26f9 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchFileType/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchFileType/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for managing the search file types in the search service application. You can create new file types, change existing types and diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/readme.md index 7d3c738e6..939ed0359 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating search indexes. It works by creating the index topology components and updating the topology from the server that diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchManagedProperty/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchManagedProperty/readme.md index 717ed282d..916da740a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchManagedProperty/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchManagedProperty/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will deploy and configure a managed property in a specified search service application. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/MSFT_SPSearchMetadataCategory.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/MSFT_SPSearchMetadataCategory.psm1 new file mode 100644 index 000000000..c0b56d7ff --- /dev/null +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/MSFT_SPSearchMetadataCategory.psm1 @@ -0,0 +1,213 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter(Mandatory = $true)] + [System.String] + $ServiceAppName, + + [Parameter()] + [System.Boolean] + $AutoCreateNewManagedProperties, + + [Parameter()] + [System.Boolean] + $DiscoverNewProperties, + + [Parameter()] + [System.Boolean] + $MapToContents, + + [Parameter()] + [ValidateSet("Present","Absent")] + [System.String] + $Ensure = "Present", + + [Parameter()] + [System.Management.Automation.PSCredential] + $InstallAccount + ) + + Write-Verbose -Message "Getting Metadata Category Setting for '$Name'" + + $result = Invoke-SPDSCCommand -Credential $InstallAccount ` + -Arguments @($PSBoundParameters) ` + -ScriptBlock { + $params = $args[0] + + $ssa = Get-SPEnterpriseSearchServiceApplication -Identity $params.ServiceAppName + if ($null -eq $ssa) + { + throw("The specified Search Service Application $($params.ServiceAppName) is ` + invalid. Please make sure you specify the name of an existing service application.") + } + $category = Get-SPEnterpriseSearchMetadataCategory -SearchApplication $ssa | ` + Where-Object{$_.Name -eq $params.Name} + if ($null -eq $category) + { + return @{ + Name = $params.Name + ServiceAppName = $params.ServiceAppName + AutoCreateNewManagedProperties = $null + DiscoverNewProperties = $null + MapToContents = $null + Ensure = "Absent" + } + } + else + { + $results = @{ + Name = $params.Name + ServiceAppName = $params.ServiceAppName + AutoCreateNewManagedProperties = $category.AutoCreateNewManagedProperties + DiscoverNewProperties = $category.DiscoverNewProperties + MapToContents = $category.MapToContents + Ensure = "Present" + } + return $results + } + } + return $result +} + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter(Mandatory = $true)] + [System.String] + $ServiceAppName, + + [Parameter()] + [System.Boolean] + $AutoCreateNewManagedProperties, + + [Parameter()] + [System.Boolean] + $DiscoverNewProperties, + + [Parameter()] + [System.Boolean] + $MapToContents, + + [Parameter()] + [ValidateSet("Present","Absent")] + [System.String] + $Ensure = "Present", + + [Parameter()] + [System.Management.Automation.PSCredential] + $InstallAccount + ) + + Write-Verbose -Message "Setting Metadata Category Setting for '$Name'" + + # Validate that the specified crawled properties are all valid and existing + Invoke-SPDSCCommand -Credential $InstallAccount ` + -Arguments @($PSBoundParameters) ` + -ScriptBlock { + $params = $args[0] + + $ssa = Get-SPEnterpriseSearchServiceApplication -Identity $params.ServiceAppName + if ($null -eq $ssa) + { + throw("The specified Search Service Application $($params.ServiceAppName) is ` + invalid. Please make sure you specify the name of an existing service application.") + } + + # Set the specified properties on the Managed Property + $category = Get-SPEnterpriseSearchMetadataCategory -Identity $params.Name ` + -SearchApplication $params.ServiceAppName + + # The category exists and it shouldn't, delete it; + if ($params.Ensure -eq "Absent" -and $null -ne $category) + { + # If the category we are trying to remove is not empty, throw an error + if ($category.CrawledPropertyCount -gt 0) + { + throw "Cannot delete Metadata Category $($param.Name) because it contains " + ` + "Crawled Properties. Please remove all associated Crawled Properties " + ` + "before attempting to delete this category." + } + Remove-SPEnterpriseSearchMetadataCategory -Identity $params.Name ` + -SearchApplication $params.ServiceAppName ` + -Confirm:$false + } + + # The category doesn't exist, but should + if ($params.Ensure -eq "Present" -and $null -eq $category) + { + $category = New-SPEnterpriseSearchMetadataCategory -Name $params.Name ` + -SearchApplication $params.ServiceAppName + } + Set-SPEnterpriseSearchMetadataCategory -Identity $params.Name ` + -SearchApplication $params.ServiceAppName ` + -AutoCreateNewManagedProperties $params.AutoCreateNewManagedProperties ` + -DiscoverNewProperties $params.DiscoverNewProperties ` + -MapToContents $params.MapToContents + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter(Mandatory = $true)] + [System.String] + $ServiceAppName, + + [Parameter()] + [System.Boolean] + $AutoCreateNewManagedProperties, + + [Parameter()] + [System.Boolean] + $DiscoverNewProperties, + + [Parameter()] + [System.Boolean] + $MapToContents, + + [Parameter()] + [ValidateSet("Present","Absent")] + [System.String] + $Ensure = "Present", + + [Parameter()] + [System.Management.Automation.PSCredential] + $InstallAccount + ) + + Write-Verbose -Message "Testing Metadata Category Setting for '$Name'" + + $PSBoundParameters.Ensure = $Ensure + $CurrentValues = Get-TargetResource @PSBoundParameters + + return Test-SPDscParameterState -CurrentValues $CurrentValues ` + -DesiredValues $PSBoundParameters ` + -ValuesToCheck @("Name", + "PropertyType", + "Ensure", + "AutoCreateNewManagedProperties", + "DiscoverNewProperties", + "MapToContents") +} + +Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/MSFT_SPSearchMetadataCategory.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/MSFT_SPSearchMetadataCategory.schema.mof new file mode 100644 index 000000000..f41adced1 --- /dev/null +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/MSFT_SPSearchMetadataCategory.schema.mof @@ -0,0 +1,11 @@ +[ClassVersion("1.0.0.0"), FriendlyName("SPSearchMetadataCategory")] +class MSFT_SPSearchMetadataCategory : OMI_BaseResource +{ + [Key, Description("The name of the Metadata Category")] String Name; + [Key, Description("The name of the search service app that this Metadata Category exists within")] String ServiceAppName; + [Write, Description("Specifies that when a new crawled property in this category is found, a corresponding managed property is created and mapped to this new crawled property")] Boolean AutoCreateNewManagedProperties; + [Write, Description("Specifies that if there are unknown properties in this category, these new properties are discovered during a crawl.")] Boolean DiscoverNewProperties; + [Write, Description("Specifies that all crawled properties of type string are mapped to corresponding managed properties of this category.")] Boolean MapToContents; + [Write, Description("Present if the result source should exist, absent if it should not"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; +}; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/readme.md new file mode 100644 index 000000000..f1c63622f --- /dev/null +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchMetadataCategory/readme.md @@ -0,0 +1,10 @@ +# Description + +**Type:** Distributed +**Requires CredSSP:** No + +This resource will deploy and configure a Metadata Category in a specified search +service application. + +The default value for the Ensure parameter is Present. When not specifying this +parameter, the Metadata Category is created. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.psm1 index fd662eb96..dd05b3f56 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.psm1 @@ -8,6 +8,17 @@ function Get-TargetResource [System.String] $Name, + [Parameter(Mandatory = $true)] + [ValidateSet("SSA", + "SPSite", + "SPWeb")] + [System.String] + $ScopeName, + + [Parameter(Mandatory = $true)] + [System.String] + $ScopeUrl, + [Parameter(Mandatory = $true)] [System.String] $SearchServiceAppName, @@ -30,10 +41,6 @@ function Get-TargetResource [System.String] $ConnectionUrl, - [Parameter()] - [System.String] - $ScopeUrl, - [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -54,6 +61,7 @@ function Get-TargetResource $nullReturn = @{ Name = $params.Name + ScopeName = $params.ScopeName SearchServiceAppName = $params.SearchServiceAppName Query = $null ProviderType = $null @@ -63,43 +71,22 @@ function Get-TargetResource InstallAccount = $params.InstallAccount } $serviceApp = Get-SPEnterpriseSearchServiceApplication -Identity $params.SearchServiceAppName - $searchSiteUrl = $serviceApp.SearchCenterUrl -replace "/pages" - $searchSite = Get-SPWeb -Identity $searchSiteUrl -ErrorAction SilentlyContinue - - if ($null -eq $searchSite) - { - Write-Verbose -Message ("Search centre site collection does not exist at " + ` - "$searchSiteUrl. Unable to create search context " + ` - "to determine result source details.") - return $nullReturn - } - - $adminNamespace = "Microsoft.Office.Server.Search.Administration" - $queryNamespace = "Microsoft.Office.Server.Search.Administration.Query" - $objectLevel = [Microsoft.Office.Server.Search.Administration.SearchObjectLevel] - $fedManager = $null - if ($null -eq $params.ScopeUrl) + $fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($serviceApp) + $searchOwner = $null + if ("ssa" -eq $params.ScopeName.ToLower()) { - $fedManager = New-Object -TypeName "$queryNamespace.FederationManager" ` - -ArgumentList $serviceApp - $searchOwner = New-Object -TypeName "$adminNamespace.SearchObjectOwner" ` - -ArgumentList @( - $objectLevel::Ssa, - $searchSite - ) - - $source = $fedManager.GetSourceByName($params.Name, $searchOwner) + $searchOwner = Get-SPEnterpriseSearchOwner -Level SSA } else { - $fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($serviceApp) - $searchOwner = Get-SPEnterpriseSearchOwner -Level SPWeb -SPWeb $params.ScopeUrl - $filter = New-Object Microsoft.Office.Server.Search.Administration.SearchObjectFilter($searchOwner) - $filter.IncludeHigherLevel = $false - $source = $fedManager.ListSources($filter,$true) | Where-Object -FilterScript { - $_.Name -eq $params.Name - } + $searchOwner = Get-SPEnterpriseSearchOwner -Level $params.ScopeName -SPWeb $params.ScopeUrl + } + $filter = New-Object Microsoft.Office.Server.Search.Administration.SearchObjectFilter($searchOwner) + $filter.IncludeHigherLevel = $true + + $source = $fedManager.ListSources($filter,$true) | Where-Object -FilterScript { + $_.Name -eq $params.Name } if ($null -ne $source) @@ -110,9 +97,10 @@ function Get-TargetResource } return @{ Name = $params.Name + ScopeName = $params.ScopeName SearchServiceAppName = $params.SearchServiceAppName Query = $source.QueryTransform.QueryTemplate - ProviderType = $provider.Name + ProviderType = $provider.DisplayName ConnectionUrl = $source.ConnectionUrlTemplate ScopeUrl = $params.ScopeUrl Ensure = "Present" @@ -136,6 +124,17 @@ function Set-TargetResource [System.String] $Name, + [Parameter(Mandatory = $true)] + [ValidateSet("SSA", + "SPSite", + "SPWeb")] + [System.String] + $ScopeName, + + [Parameter(Mandatory = $true)] + [System.String] + $ScopeUrl, + [Parameter(Mandatory = $true)] [System.String] $SearchServiceAppName, @@ -158,10 +157,6 @@ function Set-TargetResource [System.String] $ConnectionUrl, - [Parameter()] - [System.String] - $ScopeUrl, - [Parameter()] [ValidateSet("Present","Absent")] [System.String] @@ -188,46 +183,25 @@ function Set-TargetResource $serviceApp = Get-SPEnterpriseSearchServiceApplication ` -Identity $params.SearchServiceAppName - $searchSiteUrl = $serviceApp.SearchCenterUrl -replace "/pages" - $searchSite = Get-SPWeb -Identity $searchSiteUrl -ErrorAction SilentlyContinue - - if ($null -eq $searchSite) - { - throw ("Search centre site collection does not exist at " + ` - "$searchSiteUrl. Unable to create search context " + ` - "to set result source.") - return - } - $fedManager = $null - if ($null -eq $params.ScopeUrl) + $fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($serviceApp) + $searchOwner = $null + if ("ssa" -eq $params.ScopeName.ToLower()) { - $adminNamespace = "Microsoft.Office.Server.Search.Administration" - $queryNamespace = "Microsoft.Office.Server.Search.Administration.Query" - $objectLevel = [Microsoft.Office.Server.Search.Administration.SearchObjectLevel] - $fedManager = New-Object -TypeName "$queryNamespace.FederationManager" ` - -ArgumentList $serviceApp - $searchOwner = New-Object -TypeName "$adminNamespace.SearchObjectOwner" ` - -ArgumentList @( - $objectLevel::Ssa, - $searchSite - ) - - $transformType = "Microsoft.Office.Server.Search.Query.Rules.QueryTransformProperties" - $queryProperties = New-Object -TypeName $transformType - $resultSource = $fedManager.CreateSource($searchOwner) + $searchOwner = Get-SPEnterpriseSearchOwner -Level SSA } else { - $fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($serviceApp) - $searchOwner = Get-SPEnterpriseSearchOwner -Level SPWeb -SPWeb $params.ScopeUrl - $transformType = "Microsoft.Office.Server.Search.Query.Rules.QueryTransformProperties" - $queryProperties = New-Object -TypeName $transformType - $resultSource = $fedManager.CreateSource($searchOwner) + $searchOwner = Get-SPEnterpriseSearchOwner -Level $params.ScopeName -SPWeb $params.ScopeUrl } + + $transformType = "Microsoft.Office.Server.Search.Query.Rules.QueryTransformProperties" + $queryProperties = New-Object -TypeName $transformType + $resultSource = $fedManager.CreateSource($searchOwner) + $resultSource.Name = $params.Name $providers = $fedManager.ListProviders() $provider = $providers.Values | Where-Object -FilterScript { - $_.Name -eq $params.ProviderType + $_.DisplayName -eq $params.ProviderType } $resultSource.ProviderId = $provider.Id $resultSource.CreateQueryTransform($queryProperties, $params.Query) @@ -249,19 +223,15 @@ function Set-TargetResource $serviceApp = Get-SPEnterpriseSearchServiceApplication ` -Identity $params.SearchServiceAppName - $searchSiteUrl = $serviceApp.SearchCenterUrl -replace "/pages" - $searchSite = Get-SPWeb -Identity $searchSiteUrl - - $adminNamespace = "Microsoft.Office.Server.Search.Administration" - $queryNamespace = "Microsoft.Office.Server.Search.Administration.Query" - $objectLevel = [Microsoft.Office.Server.Search.Administration.SearchObjectLevel] - $fedManager = New-Object -TypeName "$queryNamespace.FederationManager" ` - -ArgumentList $serviceApp - $searchOwner = New-Object -TypeName "$adminNamespace.SearchObjectOwner" ` - -ArgumentList @( - $objectLevel::Ssa, - $searchSite - ) + $fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($serviceApp) + $searchOwner = $null + if ("ssa" -eq $params.ScopeName.ToLower()) + { + $searchOwner = Get-SPEnterpriseSearchOwner -Level SSA + } + else { + $searchOwner = Get-SPEnterpriseSearchOwner -Level $params.ScopeName -SPWeb $params.ScopeUrl + } $source = $fedManager.GetSourceByName($params.Name, $searchOwner) if ($null -ne $source) @@ -282,6 +252,17 @@ function Test-TargetResource [System.String] $Name, + [Parameter(Mandatory = $true)] + [ValidateSet("SSA", + "SPSite", + "SPWeb")] + [System.String] + $ScopeName, + + [Parameter(Mandatory = $true)] + [System.String] + $ScopeUrl, + [Parameter(Mandatory = $true)] [System.String] $SearchServiceAppName, @@ -304,10 +285,6 @@ function Test-TargetResource [System.String] $ConnectionUrl, - [Parameter()] - [System.String] - $ScopeUrl, - [Parameter()] [ValidateSet("Present","Absent")] [System.String] diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.schema.mof index 206b3f8cc..8407cba5b 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/MSFT_SPSearchResultSource.schema.mof @@ -2,11 +2,12 @@ class MSFT_SPSearchResultSource : OMI_BaseResource { [Key, Description("The name of the result source")] String Name; + [Key, Description("The scope at which the Result Source will be created. Options are SSA, SPSite or SPWeb"), ValueMap{"SSA","SPSite","SPWeb"}, Values{"SSA","SPSite","SPWeb"}] String ScopeName; + [Key, Description("The URI of the site where to create the result source. Leave empty to have it created globally")] String ScopeUrl; [Required, Description("The name of the search service application to associate this result source with")] String SearchServiceAppName; [Required, Description("The query to pass to the provider source")] String Query; [Required, Description("The provider type to use for the result source"), ValueMap{"Exchange Search Provider","Local People Provider","Local SharePoint Provider","OpenSearch Provider","Remote People Provider","Remote SharePoint Provider"}, Values{"Exchange Search Provider","Local People Provider","Local SharePoint Provider","OpenSearch Provider","Remote People Provider","Remote SharePoint Provider"}] String ProviderType; [Write, Description("The URI to connect to the remote location")] String ConnectionUrl; - [Write, Description("The URI of the site where to create the result source. Leave empty to have it created globally")] String ScopeUrl; [Write, Description("Present if the result source should exist, absent if it should not"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/readme.md index fbff9dd27..3c82606dc 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchResultSource/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure search result sources in the SharePoint search service application. Result sources can be configured to be of the @@ -15,3 +16,6 @@ following provider types: The default value for the Ensure parameter is Present. When not specifying this parameter, the result source is created. + +To define a result source as global, use the value 'SSA' as the ScopeName +value. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/MSFT_SPSearchServiceApp.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/MSFT_SPSearchServiceApp.psm1 index 5cc2961c9..ac4f5f547 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/MSFT_SPSearchServiceApp.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/MSFT_SPSearchServiceApp.psm1 @@ -124,7 +124,7 @@ function Get-TargetResource } if ($null -ne $serviceAppProxy) { - $proxyName = $serviceAppProxy.Name + $pName = $serviceAppProxy.Name } } @@ -134,7 +134,7 @@ function Get-TargetResource $returnVal = @{ Name = $serviceApp.DisplayName - ProxyName = $proxyName + ProxyName = $pName ApplicationPool = $serviceApp.ApplicationPool.Name DatabaseName = $serviceApp.SearchAdminDatabase.Name DatabaseServer = $serviceApp.SearchAdminDatabase.NormalizedDataSource @@ -247,7 +247,7 @@ function Set-TargetResource } else { - throw ("Please install SharePoint 2016 or SharePoint 2013 with August " + ` + throw ("Please install SharePoint 2019, 2016 or SharePoint 2013 with August " + ` "2015 CU or higher before attempting to create a cloud enabled " + ` "search service application") } @@ -311,6 +311,32 @@ function Set-TargetResource Where-Object -FilterScript { $_.GetType().FullName -eq "Microsoft.Office.Server.Search.Administration.SearchServiceApplication" } + + if ($null -eq $params.ProxyName) + { + $pName = "$($params.Name) Proxy" + } + else + { + $pName = $params.ProxyName + } + + if ($result.ProxyName -ne $pName) + { + if ($null -eq $result.ProxyName) + { + New-SPEnterpriseSearchServiceApplicationProxy -Name $pName -SearchApplication $serviceApp + } + else + { + $serviceAppProxy = Get-SPServiceApplicationProxy | Where-Object -FilterScript { + $_.Name -eq $result.ProxyName + } + $serviceAppProxy.Name = $pName + $serviceAppProxy.Update() + } + } + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool $setParams = @{ ApplicationPool = $appPool @@ -457,7 +483,8 @@ function Test-TargetResource -DesiredValues $PSBoundParameters ` -ValuesToCheck @("Ensure", "ApplicationPool", - "SearchCenterUrl") + "SearchCenterUrl", + "ProxyName") } else { diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/readme.md index 866e5e932..74cc92457 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for provisioning the search service application. The current version lets you specify the database name and server, as well as diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchTopology/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchTopology/readme.md index 848b51e36..fac535700 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSearchTopology/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSearchTopology/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for provisioning a search topology in to the current farm. It allows the configuration to dictate the search topology roles diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSecureStoreServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSecureStoreServiceApp/readme.md index 038b7c1cf..47b6e2ab8 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSecureStoreServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSecureStoreServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for provisioning and configuring the secure store service application. The parameters passed in (except those related to database diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.psm1 index 206a7511e..fe87fddc3 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.psm1 @@ -4,6 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $Name, @@ -43,6 +48,7 @@ function Get-TargetResource $config = Get-SPSecurityTokenServiceConfig $nullReturn = @{ + IsSingleInstance = "Yes" Name = $params.Name NameIdentifier = $params.NameIdentifier UseSessionCookies = $params.UseSessionCookies @@ -57,6 +63,7 @@ function Get-TargetResource } return @{ + IsSingleInstance = "Yes" Name = $config.Name NameIdentifier = $config.NameIdentifier UseSessionCookies = $config.UseSessionCookies @@ -74,6 +81,11 @@ function Set-TargetResource [CmdletBinding()] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $Name, @@ -149,6 +161,11 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( + [Parameter(Mandatory = $true)] + [ValidateSet('Yes')] + [String] + $IsSingleInstance, + [Parameter(Mandatory = $true)] [System.String] $Name, @@ -187,7 +204,11 @@ function Test-TargetResource return Test-SPDscParameterState -CurrentValues $CurrentValues ` -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("Ensure") + -ValuesToCheck @("Ensure", + "NameIdentifier", + "UseSessionCookies", + "AllowOAuthOverHttp", + "AllowMetadataOverHttp") } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.schema.mof index 11d8bb789..0135aec3f 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/MSFT_SPSecurityTokenServiceConfig.schema.mof @@ -1,7 +1,8 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPSecurityTokenServiceConfig")] class MSFT_SPSecurityTokenServiceConfig : OMI_BaseResource { - [Key, Description("The name of the security token service")] string Name; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; + [Required, Description("The name of the security token service")] string Name; [Write, Description("The identifier for the security token service")] string NameIdentifier; [Write, Description("True set the security token service to use cookies")] Boolean UseSessionCookies; [Write, Description("True set the security token service to allow OAuth over HTTP")] Boolean AllowOAuthOverHttp; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/readme.md index b99197f1f..7ddf7d442 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSecurityTokenServiceConfig/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuring the Security Token Service within the local SharePoint farm. Using Ensure equals to Absent is not supported. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.psm1 index 281db0e62..8dafc42e2 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.psm1 @@ -6,7 +6,7 @@ function Get-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter(Mandatory = $true)] [System.Boolean] @@ -50,20 +50,20 @@ function Get-TargetResource $InstallAccount ) - Write-Verbose -Message "Getting self service site creation settings for Web Application '$Url'" + Write-Verbose -Message "Getting self service site creation settings for Web Application '$WebAppUrl'" $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - $webApplication = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $webApplication = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $webApplication) { - Write-Verbose "Web application $($params.Url) was not found" + Write-Verbose "Web application $($params.WebAppUrl) was not found" return @{ - Url = $null + WebAppUrl = $null Enabled = $null OnlineEnabled = $null QuotaTemplate = $null @@ -87,7 +87,7 @@ function Get-TargetResource } return @{ - Url = $params.Url + WebAppUrl = $params.WebAppUrl Enabled = $webApplication.SelfServiceSiteCreationEnabled OnlineEnabled = $webApplication.SelfServiceSiteCreationOnlineEnabled QuotaTemplate = $webApplication.SelfServiceCreationQuotaTemplate @@ -109,7 +109,7 @@ function Set-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter(Mandatory = $true)] [System.Boolean] @@ -153,14 +153,14 @@ function Set-TargetResource $InstallAccount ) - Write-Verbose -Message "Setting self service site creation settings for Web Application '$Url'" + Write-Verbose -Message "Setting self service site creation settings for Web Application '$WebAppUrl'" Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - $webApplication = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $webApplication = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $webApplication) { @@ -278,7 +278,7 @@ function Test-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter(Mandatory = $true)] [System.Boolean] @@ -322,7 +322,7 @@ function Test-TargetResource $InstallAccount ) - Write-Verbose -Message "Testing self service site creation settings for Web Application '$Url'" + Write-Verbose -Message "Testing self service site creation settings for Web Application '$WebAppUrl'" if ($Enabled -eq $false) { @@ -345,7 +345,7 @@ function Test-TargetResource { return Test-SPDscParameterState -CurrentValues $currentValues ` -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("Url", ` + -ValuesToCheck @("WebAppUrl", ` "Enabled", ` "OnlineEnabled", ` "ShowStartASiteMenuItem", ` @@ -359,7 +359,7 @@ function Test-TargetResource { return Test-SPDscParameterState -CurrentValues $currentValues ` -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("Url", ` + -ValuesToCheck @("WebAppUrl", ` "Enabled", ` "ShowStartASiteMenuItem") } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.schema.mof index 8daadd839..c9e34b16c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/MSFT_SPSelfServiceSiteCreation.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPSelfServiceSiteCreation")] class MSFT_SPSelfServiceSiteCreation : OMI_BaseResource { - [Key, Description("The url of the web application")] string Url; + [Key, Description("The url of the web application")] string WebAppUrl; [Required, Description("Specifies if users are allowed to create site collections or not")] boolean Enabled; [Write, Description("Specifies if site collections are created in SharePoint Online in a hybrid configuration. Hybrid configuration needs to be caried out seperately using the Hybrid Picker")] boolean OnlineEnabled; [Write, Description("The quota template to apply to new site collections. Specify null to not apply any qouta template")] string QuotaTemplate; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/readme.md index 6f33416da..b7a926496 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSelfServiceSiteCreation/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure self-service site creation on a web application. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppPool/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppPool/readme.md index 42338bbb5..8d8da756e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppPool/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppPool/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used for provisioning an application pool that can be used for service applications. The account used for the service account must already be diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppProxyGroup/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppProxyGroup/readme.md index 7e9cffd79..45cb78dd5 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppProxyGroup/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppProxyGroup/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to manage SharePoint Service Application Proxy Groups. The "Ensure" parameter controls whether or not the Proxy Group should exist. A diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.psm1 index 0e4d25ec8..937555184 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.psm1 @@ -90,12 +90,19 @@ function Get-TargetResource } } - $accessLevel = $securityEntry.AllowedRights.ToString() - $accessLevel = $accessLevel.Replace("FullControl", "Full Control") - $accessLevel = $accessLevel.Replace("ChangePermissions", "Change Permissions") + $accessLevels = @() + + foreach ($namedAccessRight in $security.NamedAccessRights) + { + if($namedAccessRight.Rights.IsSubsetOf($securityEntry.AllowedObjectRights)) + { + $accessLevels += $namedAccessRight.Name + } + } + $members += @{ Username = $user - AccessLevel = $accessLevel + AccessLevels = $accessLevels } } @@ -208,21 +215,19 @@ function Set-TargetResource if ($CurrentValues.Members.Username -contains $desiredMember.Username) { - if (($CurrentValues.Members | Where-Object -FilterScript { + if ($null -ne (Compare-Object -ReferenceObject ($CurrentValues.Members | Where-Object -FilterScript { $_.Username -eq $desiredMember.Username - } | Select-Object -First 1).AccessLevel -ne $desiredMember.AccessLevel) + } | Select-Object -First 1).AccessLevels -DifferenceObject $desiredMember.AccessLevels)) { - Revoke-SPObjectSecurity -Identity $security ` - -Principal $claim - Grant-SPObjectSecurity -Identity $security ` -Principal $claim ` - -Rights $desiredMember.AccessLevel + -Rights $desiredMember.AccessLevels ` + -Replace } } else { - Grant-SPObjectSecurity -Identity $security -Principal $claim -Rights $desiredMember.AccessLevel + Grant-SPObjectSecurity -Identity $security -Principal $claim -Rights $desiredMember.AccessLevels } } @@ -280,23 +285,21 @@ function Set-TargetResource if ($CurrentValues.Members.Username -contains $desiredMember.Username) { - if (($CurrentValues.Members | Where-Object -FilterScript { + if ($null -ne (Compare-Object -ReferenceObject ($CurrentValues.Members | Where-Object -FilterScript { $_.Username -eq $desiredMember.Username - } | Select-Object -First 1).AccessLevel -ne $desiredMember.AccessLevel) + } | Select-Object -First 1).AccessLevels -DifferenceObject $desiredMember.AccessLevels)) { - Revoke-SPObjectSecurity -Identity $security ` - -Principal $claim - Grant-SPObjectSecurity -Identity $security ` -Principal $claim ` - -Rights $desiredMember.AccessLevel + -Rights $desiredMember.AccessLevels ` + -Replace } } else { Grant-SPObjectSecurity -Identity $security ` -Principal $claim ` - -Rights $desiredMember.AccessLevel + -Rights $desiredMember.AccessLevels } } } @@ -385,97 +388,150 @@ function Test-TargetResource return $false } - if ($null -ne $Members) - { - Write-Verbose -Message "Processing Members parameter" + $result = Invoke-SPDSCCommand -Credential $InstallAccount ` + -Arguments @($PSBoundParameters, $CurrentValues) ` + -ScriptBlock { + $params = $args[0] + $CurrentValues = $args[1] + + $serviceApp = Get-SPServiceApplication -Name $params.ServiceAppName + switch ($params.SecurityType) + { + "Administrators" { + $security = $serviceApp | Get-SPServiceApplicationSecurity -Admin + } + "SharingPermissions" { + $security = $serviceApp | Get-SPServiceApplicationSecurity + } + } - if ($CurrentValues.Members.Count -eq 0) + if ($null -ne $params.Members) { - if ($Members.Count -gt 0) + Write-Verbose -Message "Processing Members parameter" + + if ($CurrentValues.Members.Count -eq 0) + { + if ($params.Members.Count -gt 0) + { + Write-Verbose -Message "Security list does not match" + return $false + } + else + { + Write-Verbose -Message "Configured and specified security lists are both empty" + return $true + } + } + elseif($params.Members.Count -eq 0) { Write-Verbose -Message "Security list does not match" return $false } - else + + $differences = Compare-Object -ReferenceObject $CurrentValues.Members.Username ` + -DifferenceObject $params.Members.Username + + if ($null -eq $differences) { - Write-Verbose -Message "Configured and specified security lists are both empty" + Write-Verbose -Message "Security list matches - checking that permissions match on each object" + foreach($currentMember in $CurrentValues.Members) + { + $expandedAccessLevels = ExpandAccessLevel -Security $security -AccessLevels ($params.Members | Where-Object -FilterScript { + $_.Username -eq $currentMember.Username + } | Select-Object -First 1).AccessLevels + if ($null -ne (Compare-Object -DifferenceObject $currentMember.AccessLevels -ReferenceObject $expandedAccessLevels)) + { + Write-Verbose -Message "$($currentMember.Username) has incorrect permission level. Test failed." + return $false + } + } return $true } + else + { + Write-Verbose -Message "Security list does not match" + return $false + } } - elseif($Members.Count -eq 0) - { - Write-Verbose -Message "Security list does not match" - return $false - } - - $differences = Compare-Object -ReferenceObject $CurrentValues.Members.Username ` - -DifferenceObject $Members.Username - if ($null -eq $differences) + $result = $true + if ($params.MembersToInclude) { - Write-Verbose -Message "Security list matches - checking that permissions match on each object" - foreach($currentMember in $CurrentValues.Members) + Write-Verbose -Message "Processing MembersToInclude parameter" + foreach ($member in $params.MembersToInclude) { - if ($currentMember.AccessLevel -ne ($Members | Where-Object -FilterScript { - $_.Username -eq $currentMember.Username - } | Select-Object -First 1).AccessLevel) + if (-not($CurrentValues.Members.Username -contains $member.Username)) { - Write-Verbose -Message "$($currentMember.Username) has incorrect permission level. Test failed." - return $false + Write-Verbose -Message "$($member.Username) does not have access. Set result to false" + $result = $false + } + else + { + Write-Verbose -Message "$($member.Username) already has access. Checking permission..." + $expandedAccessLevels = ExpandAccessLevel -Security $security -AccessLevels $member.AccessLevels + + if ($null -ne (Compare-Object -DifferenceObject $expandedAccessLevels -ReferenceObject ($CurrentValues.Members | Where-Object -FilterScript { + $_.Username -eq $member.Username + } | Select-Object -First 1).AccessLevels)) + { + Write-Verbose -Message "$($member.Username) has incorrect permission level. Test failed." + return $false + } } } - return $true - } - else - { - Write-Verbose -Message "Security list does not match" - return $false } - } - $result = $true - if ($MembersToInclude) - { - Write-Verbose -Message "Processing MembersToInclude parameter" - foreach ($member in $MembersToInclude) + if ($params.MembersToExclude) { - if (-not($CurrentValues.Members.Username -contains $member.Username)) - { - Write-Verbose -Message "$($member.Username) does not have access. Set result to false" - $result = $false - } - else + Write-Verbose -Message "Processing MembersToExclude parameter" + foreach ($member in $params.MembersToExclude) { - Write-Verbose -Message "$($member.Username) already has access. Checking permission..." - if ($member.AccessLevel -ne ($CurrentValues.Members | Where-Object -FilterScript { - $_.Username -eq $member.Username - } | Select-Object -First 1).AccessLevel) + if ($CurrentValues.Members.Username -contains $member) { - Write-Verbose -Message "$($member.Username) has incorrect permission level. Test failed." - return $false + Write-Verbose -Message "$member already has access. Set result to false" + $result = $false + } + else + { + Write-Verbose -Message "$member does not have access. Skipping" } } } + + return $result } - if ($MembersToExclude) + return $result +} + +function ExpandAccessLevel +{ + [OutputType([System.String[]])] + param( + [Parameter()] + $Security, + + [Parameter()] + [System.String[]] + $AccessLevels +) + $expandedAccessLevels = $AccessLevels + + foreach ($namedAccessRight in $Security.NamedAccessRights) { - Write-Verbose -Message "Processing MembersToExclude parameter" - foreach ($member in $MembersToExclude) + if($AccessLevels -contains $namedAccessRight.Name) { - if ($CurrentValues.Members.Username -contains $member) - { - Write-Verbose -Message "$member already has access. Set result to false" - $result = $false - } - else + foreach ($namedAccessRight2 in $Security.NamedAccessRights) { - Write-Verbose -Message "$member does not have access. Skipping" + if($expandedAccessLevels -notcontains $namedAccessRight2.Name -and + $namedAccessRight2.Rights.IsSubsetOf($namedAccessRight.Rights)) + { + $expandedAccessLevels += $namedAccessRight2.Name + } } } } - - return $result + return $expandedAccessLevels } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.schema.mof index f68a8073c..ec9beb3bc 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/MSFT_SPServiceAppSecurity.schema.mof @@ -2,7 +2,7 @@ class MSFT_SPServiceAppSecurityEntry { [Key, Description("The username for the entry")] String Username; - [Required, Description("The access level for the entry"), ValueMap{"Change Permissions","Full Control", "Write", "Read"}, Values{"Change Permissions","Full Control", "Write", "Read"}] String AccessLevel; + [Required, Description("The access levels for the entry"), ValueMap{"Create Target Application", "Delete Target Application", "Manage Target Application", "All Target Applications", "Manage Profiles", "Manage Audiences", "Manage Permissions", "Retrieve People Data for Search Crawlers", "Manage Social Data", "Full Control", "Read (Diagnostics Pages Only)", "Read Access to Term Store", "Read and Restricted Write Access to Term Store","Full Access to Term Store"}, Values{"Create Target Application", "Delete Target Application", "Manage Target Application", "All Target Applications", "Manage Profiles", "Manage Audiences", "Manage Permissions", "Retrieve People Data for Search Crawlers", "Manage Social Data", "Full Control", "Read (Diagnostics Pages Only)", "Read Access to Term Store", "Read and Restricted Write Access to Term Store","Full Access to Term Store"}] String AccessLevels[]; }; [ClassVersion("1.0.0.0"), FriendlyName("SPServiceAppSecurity")] class MSFT_SPServiceAppSecurity : OMI_BaseResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/readme.md index 17040c746..95d3c5e11 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceAppSecurity/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to manage the sharing security settings of a specific service application. There are a number of approaches to how this can be @@ -18,3 +19,44 @@ members that are in the group already that may not be specified here, allowing NOTE: In order to specify Local Farm you can use the token "\{LocalFarm\}" as the username. The token is case sensitive. + +## Permission overview + +Available permissions for Administrators are Full Control except for these +service applications: + +Secure Store Service Application: + +- Full Control +- Create Target Application +- Delete Target Application +- Manage Target Application +- All Target Applications + +User Profile Service Application: + +- Full Control +- Manage Profiles +- Manage Audiences +- Manage Permissions +- Retrieve People Data for Search Crawlers +- Manage Social Data + +Search Service Application: + +- Full Control +- Read (Diagnostics Pages Only) + +Permissions for Sharing Permissions are Full Control except for these +service applications: + +Managed Metadata Service Application: + +- Read Access to Term Store +- Read and Restricted Write Access to Term Store +- Full Access to Term Store + +NOTE: +Multiple permissions can be specified for each principal. Full Control +will include all other permissions. It is not required to specify all +available permissions if Full Control is specified. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceIdentity/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceIdentity/readme.md index 8774fef49..ea5143405 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceIdentity/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceIdentity/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to specify a managed account to be used to run a service instance. You can also specify LocalService, LocalSystem or NetworkService as ManagedAccount. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceInstance/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceInstance/readme.md index 9c3c5935e..dbca092c5 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPServiceInstance/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPServiceInstance/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Specific +**Requires CredSSP:** No This resource is used to specify if a specific service should be running (Ensure = "Present") or not running (Ensure = "Absent") on the current server. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSessionStateService/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSessionStateService/readme.md index c09baefb5..4a19c518a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSessionStateService/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSessionStateService/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will provision a state service app to the local farm. Specify the name of the database server and database name to provision the app with, diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.psm1 index 56cf971f0..4a17190b6 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.psm1 @@ -5,8 +5,9 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] - $Name, + [ValidateSet('Yes')] + [String] + $IsSingleInstance, [Parameter()] [System.String[]] @@ -40,7 +41,10 @@ function Get-TargetResource Write-Verbose -Message "Getting Shell Admins config" $nullreturn = @{ - Name = $null + IsSingleInstance = "Yes" + Members = $null + MembersToInclude = $null + MembersToExclude = $null } if ($Members -and (($MembersToInclude) -or ($MembersToExclude))) @@ -140,7 +144,7 @@ function Get-TargetResource } return @{ - Name = $params.Name + IsSingleInstance = "Yes" Members = $shellAdmins.UserName MembersToInclude = $params.MembersToInclude MembersToExclude = $params.MembersToExclude @@ -159,8 +163,9 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] - $Name, + [ValidateSet('Yes')] + [String] + $IsSingleInstance, [Parameter()] [System.String[]] @@ -723,8 +728,9 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] - $Name, + [ValidateSet('Yes')] + [String] + $IsSingleInstance, [Parameter()] [System.String[]] @@ -760,7 +766,9 @@ function Test-TargetResource # Start checking $CurrentValues = Get-TargetResource @PSBoundParameters - if ($null -eq $CurrentValues.Name) + if ($null -eq $CurrentValues.Members -and ` + $null -eq $CurrentValues.MembersToInclude -and ` + $null -eq $CurrentValues.MembersToExclude) { return $false } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.schema.mof index ad4d630ba..be91a5c86 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/MSFT_SPShellAdmins.schema.mof @@ -9,7 +9,7 @@ Class MSFT_SPDatabasePermissions [ClassVersion("1.0.0.0"), FriendlyName("SPShellAdmins")] class MSFT_SPShellAdmins : OMI_BaseResource { - [Key, Description("Name for the config, used for administration purposes")] String Name; + [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [Write, Description("Exact list of accounts that will have to get Shell Admin permissions")] String Members[]; [Write, Description("List of all accounts that must be in the Shell Admins group")] String MembersToInclude[]; [Write, Description("List of all accounts that are not allowed to have Shell Admin permissions")] String MembersToExclude[]; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/readme.md index 4493df601..cffeb11a1 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPShellAdmins/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to manage the users with Shell Admin permissions. There are a number of approaches to how this can be implemented. The "Members" diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSite/MSFT_SPSite.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPSite/MSFT_SPSite.schema.mof index b8dfc7f0d..f562260cb 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSite/MSFT_SPSite.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSite/MSFT_SPSite.schema.mof @@ -15,7 +15,7 @@ class MSFT_SPSite : OMI_BaseResource [Write, Description("The secondary site collection admin username")] string SecondaryOwnerAlias; [Write, Description("The template to apply to the site collection")] string Template; [Write, Description("Create the default site groups in the site collection")] boolean CreateDefaultGroups; - [Write, Description("The administration site type"), ValueMap{"TenantAdministration","None"}, Values{"TenantAdministration","None"}] string AdministrationSiteType; + [Write, Description("Specifies the type of the site collection: Regular site or tenant administration site"), ValueMap{"TenantAdministration","None"}, Values{"TenantAdministration","None"}] string AdministrationSiteType; [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSite/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSite/readme.md index 39cd0fbb6..7b20f6fea 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSite/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSite/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will provision a site collection to the current farm, based on the settings that are passed through. These settings map to the New-SPSite diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSiteUrl/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSiteUrl/readme.md index b9c9af3e7..01b239326 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSiteUrl/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSiteUrl/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will configure the site url for a host named site collection. There are four available zones to configure: Intranet, Internet, Extranet diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPStateServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPStateServiceApp/readme.md index 85ebe3788..d2ade5e75 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPStateServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPStateServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource provisions an instance of the state service in to the local farm. The database specific parameters are only used during initial provisioning of diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPSubscriptionSettingsServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPSubscriptionSettingsServiceApp/readme.md index 6b3e95660..8eb0e3480 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPSubscriptionSettingsServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPSubscriptionSettingsServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to provision and manage an instance of the App Management Services Service Application. It will identify an instance of the subscription diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPTimerJobState/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPTimerJobState/readme.md index cd772c126..b8badc461 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPTimerJobState/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPTimerJobState/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure a timer job and make sure it is in a specific state. The resource can be used to enable or disabled the job and diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/readme.md index 21b24c97f..d62b62be0 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to create or remove SPTrustedIdentityTokenIssuer in a SharePoint farm. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuerProviderRealms/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuerProviderRealms/readme.md index fc4a2139b..39c77ba6e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuerProviderRealms/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuerProviderRealms/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to add or remove provider realms to SPTrustedIdentityTokenIssuer in a SharePoint farm. The "ProviderRealms" diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/MSFT_SPTrustedRootAuthority.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/MSFT_SPTrustedRootAuthority.schema.mof index d71573d2c..8fcfc08df 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/MSFT_SPTrustedRootAuthority.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/MSFT_SPTrustedRootAuthority.schema.mof @@ -4,6 +4,6 @@ class MSFT_SPTrustedRootAuthority : OMI_BaseResource { [Key, Description("Specifies the name of the trusted root authority to create.")] String Name; [Required, Description("Specifies the X.509 certificate of the trusted root authority, as a certificate thumbprint.")] String CertificateThumbprint; - [Write, Description("Present ensures service app exists, absent ensures it is removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("Present ensures the trusted root authority exists, absent ensures it is removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, EmbeddedInstance("MSFT_Credential"), Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5")] String InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/readme.md new file mode 100644 index 000000000..f8f3f86af --- /dev/null +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPTrustedRootAuthority/readme.md @@ -0,0 +1,9 @@ +# Description + +**Type:** Distributed +**Requires CredSSP:** No + +This resource is used to create or remove SPTrustedRootAuthority in a +SharePoint farm. It imports the certificate into SharePoint in order for +high trust apps or consuming service applications from other farms will +work. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUsageApplication/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUsageApplication/readme.md index 4a517ac12..8f33c4e74 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUsageApplication/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUsageApplication/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource provisions an instance of the usage and health monitoring service application. The database settings are only used for initial provisioning, but diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.psm1 index 3047fc995..d27b79024 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.psm1 @@ -9,7 +9,7 @@ function Get-TargetResource $Name, [Parameter()] - [ValidateSet("Present","Absent")] + [ValidateSet("Present", "Absent")] [System.String] $Ensure = "Present", @@ -23,21 +23,21 @@ function Get-TargetResource [Parameter()] [ValidateSet("Big Integer", - "Binary", - "Boolean", - "Date", - "DateNoYear", - "Date Time", - "Email", - "Float", - "HTML", - "Integer", - "Person", - "String (Single Value)", - "String (Multi Value)", - "TimeZone", - "Unique Identifier", - "URL")] + "Binary", + "Boolean", + "Date", + "DateNoYear", + "Date Time", + "Email", + "Float", + "HTML", + "Integer", + "Person", + "String (Single Value)", + "String (Multi Value)", + "TimeZone", + "Unique Identifier", + "URL")] [System.string] $Type, @@ -46,7 +46,7 @@ function Get-TargetResource $Description, [Parameter()] - [ValidateSet("Mandatory", "Optin","Optout", "Disabled")] + [ValidateSet("Mandatory", "Optin", "Optout", "Disabled")] [System.string] $PolicySetting, @@ -56,16 +56,8 @@ function Get-TargetResource $PrivacySetting, [Parameter()] - [System.string] - $MappingConnectionName, - - [Parameter()] - [System.string] - $MappingPropertyName, - - [Parameter()] - [System.string] - $MappingDirection, + [Microsoft.Management.Infrastructure.CimInstance[]] + $PropertyMappings, [Parameter()] [System.uint32] @@ -123,16 +115,16 @@ function Get-TargetResource Write-Verbose -Message "Getting user profile property $Name" $result = Invoke-SPDSCCommand -Credential $InstallAccount ` - -Arguments $PSBoundParameters ` - -ScriptBlock { + -Arguments $PSBoundParameters ` + -ScriptBlock { $params = $args[0] $upsa = Get-SPServiceApplication -Name $params.UserProfileService ` - -ErrorAction SilentlyContinue + -ErrorAction SilentlyContinue $nullReturn = @{ - Name = $params.Name + Name = $params.Name UserProfileService = $params.UserProfileService - Ensure = "Absent" + Ensure = "Absent" } if ($null -eq $upsa) { @@ -140,8 +132,8 @@ function Get-TargetResource } $caURL = (Get-SPWebApplication -IncludeCentralAdministration | Where-Object -FilterScript { - $_.IsAdministrationWebApplication -eq $true - }).Url + $_.IsAdministrationWebApplication -eq $true + }).Url $context = Get-SPServiceContext -Site $caURL @@ -155,8 +147,8 @@ function Get-TargetResource } $termSet = @{ - TermSet = "" - TermGroup ="" + TermSet = "" + TermGroup = "" TermStore = "" } @@ -166,64 +158,129 @@ function Get-TargetResource $termSet.TermGroup = $userProfileProperty.CoreProperty.TermSet.Group.Name $termSet.TermStore = $userProfileProperty.CoreProperty.TermSet.TermStore.Name } - $mapping = @{ - ConectionName = "" - PropertyName ="" - Direction = "" - } - $userProfileConfigManager = New-Object -TypeName "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" ` - -ArgumentList $context + $userProfilePropertyMappings = @() + + $userProfileConfigManager = New-Object -TypeName "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" ` + -ArgumentList $context if ($null -eq $userProfileConfigManager.ConnectionManager) { return $nullReturn } - $syncConnection = $userProfileConfigManager.ConnectionManager | ` - Where-Object -FilterScript { - $null -ne $_.PropertyMapping -and $null -ne $_.PropertyMapping.Item($params.Name) - } - - if($null -ne $syncConnection) + foreach ($propertyMapping in $params.PropertyMappings) { - $currentMapping = $syncConnection.PropertyMapping.Item($params.Name) - if($null -ne $currentMapping) + try { - $mapping.Direction = "Import" - $mapping.ConnectionName = $params.MappingConnectionName - if($currentMapping.IsExport) + $connection = $userProfileConfigManager.ConnectionManager[$propertyMapping.ConnectionName] + + # This only works with SharePoint 2013 and AD Sync Connections. + $syncConnection = $connection | Where-Object -FilterScript { + $null -ne $_.PropertyMapping -and $null -ne $_.PropertyMapping.Item($params.Name) + } + + if ($null -ne $syncConnection) { - $mapping.Direction = "Export" + # This code will only be reached with SP 2013 and AD Sync Connections. + $currentMapping = $syncConnection.PropertyMapping.Item($params.Name) + if ($null -ne $currentMapping) + { + $mapping = @{} + $mapping.Direction = "Import" + $mapping.ConnectionName = $params.MappingConnectionName + if ($currentMapping.IsExport) + { + $mapping.Direction = "Export" + } + $mapping.PropertyName = $currentMapping.DataSourcePropertyName + + $userProfilePropertyMappings += (New-CimInstance -ClassName MSFT_SPUserProfilePropertyMapping -ClientOnly -Property @{ + ConnectionName = $propertyMapping.ConnectionName + PropertyName = $mapping.ConnectionName + Direction = $mapping.Direction + }) + } + } + else + { + # This code is for SP 2013, 2016 and 2019 with AD Import Connections. + if ($connection.Type -eq "ActiveDirectoryImport") + { + try + { + $adImportConnection = [Microsoft.Office.Server.UserProfiles.ActiveDirectoryImportConnection]$connection + } + catch [Exception] + { + $adImportConnection = $connection + } + + $propertyFlags = [System.Reflection.BindingFlags]::Instance -bor ` + [System.Reflection.BindingFlags]::NonPublic + + $propMembers = $adImportConnection.GetType().GetMethods($propertyFlags) + + $adImportPropertyMappingsMethod = $propMembers | Where-Object -FilterScript { + $_.Name -eq "ADImportPropertyMappings" + } + $propertyMappings = $adImportPropertyMappingsMethod.Invoke($adImportConnection, $null) + + $propertyMappings | ForEach-Object -Process { + $currentMappingMembers = $_.GetType().GetMembers($propertyFlags) + $profileProperty = $currentMappingMembers | Where-Object -FilterScript { + $_.Name -eq "ProfileProperty" + } + if ($null -ne $profileProperty) + { + $profilePropertyValue = $profileProperty.GetValue($_) + if ($profilePropertyValue -eq $params.Name) + { + $adAttributeProperty = $currentMappingMembers | Where-Object -FilterScript { + $_.Name -eq "ADAttribute" + } + if ($null -ne $adAttributeProperty) + { + $userProfilePropertyMappings += (New-CimInstance -ClassName MSFT_SPUserProfilePropertyMapping -ClientOnly -Property @{ + ConnectionName = $propertyMapping.ConnectionName + PropertyName = $adAttributeProperty.GetValue($_) + Direction = "Import" + }) + } + } + } + } + } } - $mapping.PropertyName = $currentMapping.DataSourcePropertyName + } + catch [Exception] + { + Write-Verbose "An unecpexted error occured. Please report an issue! $_" } } return @{ - Name = $userProfileProperty.Name - UserProfileService = $params.UserProfileService - DisplayName = $userProfileProperty.DisplayName - Type = $userProfileProperty.CoreProperty.Type - Description = $userProfileProperty.Description - PolicySetting = $userProfileProperty.PrivacyPolicy - PrivacySetting = $userProfileProperty.DefaultPrivacy - MappingConnectionName = $mapping.ConnectionName - MappingPropertyName = $mapping.PropertyName - MappingDirection = $Mapping.Direction - Length = $userProfileProperty.CoreProperty.Length - DisplayOrder =$userProfileProperty.DisplayOrder - IsEventLog =$userProfileProperty.TypeProperty.IsEventLog - IsVisibleOnEditor=$userProfileProperty.TypeProperty.IsVisibleOnEditor - IsVisibleOnViewer =$userProfileProperty.TypeProperty.IsVisibleOnViewer - IsUserEditable = $userProfileProperty.IsUserEditable - IsAlias = $userProfileProperty.IsAlias - IsSearchable = $userProfileProperty.CoreProperty.IsSearchable - TermStore = $termSet.TermStore - TermGroup = $termSet.TermGroup - TermSet = $termSet.TermSet + Name = $userProfileProperty.Name + UserProfileService = $params.UserProfileService + DisplayName = $userProfileProperty.DisplayName + Type = $userProfileProperty.CoreProperty.Type + Description = $userProfileProperty.Description + PolicySetting = $userProfileProperty.PrivacyPolicy + PrivacySetting = $userProfileProperty.DefaultPrivacy + PropertyMappings = $userProfilePropertyMappings + Length = $userProfileProperty.CoreProperty.Length + DisplayOrder = $userProfileProperty.DisplayOrder + IsEventLog = $userProfileProperty.TypeProperty.IsEventLog + IsVisibleOnEditor = $userProfileProperty.TypeProperty.IsVisibleOnEditor + IsVisibleOnViewer = $userProfileProperty.TypeProperty.IsVisibleOnViewer + IsUserEditable = $userProfileProperty.IsUserEditable + IsAlias = $userProfileProperty.IsAlias + IsSearchable = $userProfileProperty.CoreProperty.IsSearchable + TermStore = $termSet.TermStore + TermGroup = $termSet.TermGroup + TermSet = $termSet.TermSet UserOverridePrivacy = $userProfileProperty.UserOverridePrivacy - Ensure = "Present" + Ensure = "Present" } } @@ -240,7 +297,7 @@ function Set-TargetResource $Name, [Parameter()] - [ValidateSet("Present","Absent")] + [ValidateSet("Present", "Absent")] [System.String] $Ensure = "Present", @@ -254,21 +311,21 @@ function Set-TargetResource [Parameter()] [ValidateSet("Big Integer", - "Binary", - "Boolean", - "Date", - "DateNoYear", - "Date Time", - "Email", - "Float", - "HTML", - "Integer", - "Person", - "String (Single Value)", - "String (Multi Value)", - "TimeZone", - "Unique Identifier", - "URL")] + "Binary", + "Boolean", + "Date", + "DateNoYear", + "Date Time", + "Email", + "Float", + "HTML", + "Integer", + "Person", + "String (Single Value)", + "String (Multi Value)", + "TimeZone", + "Unique Identifier", + "URL")] [System.string] $Type, @@ -277,7 +334,7 @@ function Set-TargetResource $Description, [Parameter()] - [ValidateSet("Mandatory", "Optin","Optout", "Disabled")] + [ValidateSet("Mandatory", "Optin", "Optout", "Disabled")] [System.string] $PolicySetting, @@ -287,16 +344,8 @@ function Set-TargetResource $PrivacySetting, [Parameter()] - [System.string] - $MappingConnectionName, - - [Parameter()] - [System.string] - $MappingPropertyName, - - [Parameter()] - [System.string] - $MappingDirection, + [Microsoft.Management.Infrastructure.CimInstance[]] + $PropertyMappings, [Parameter()] [System.uint32] @@ -358,33 +407,32 @@ function Set-TargetResource $PSBoundParameters.Ensure = $Ensure - $test = $PSBoundParameters Invoke-SPDSCCommand -Credential $InstallAccount ` - -Arguments $test ` - -ScriptBlock { + -Arguments $PSBoundParameters ` + -ScriptBlock { $params = $args[0] - if( ($params.ContainsKey("TermSet") ` - -or $params.ContainsKey("TermGroup") ` - -or $params.ContainsKey("TermSet") ) ` - -and ($params.ContainsKey("TermSet") ` + if ( ($params.ContainsKey("TermSet") ` + -or $params.ContainsKey("TermGroup") ` + -or $params.ContainsKey("TermSet") ) ` + -and ($params.ContainsKey("TermSet") ` -and $params.ContainsKey("TermGroup") ` -and $params.ContainsKey("TermSet") -eq $false) - ) + ) { throw ("You have to provide all 3 parameters Termset, TermGroup and TermStore " + ` - "when providing any of the 3.") + "when providing any of the 3.") } if ($params.ContainsKey("TermSet") ` - -and (@("string (single value)","string (multi value)").Contains($params.Type.ToLower()) -eq $false)) + -and (@("string (single value)", "string (multi value)").Contains($params.Type.ToLower()) -eq $false)) { throw "Only String and String Multivalue can use Termsets" } $ups = Get-SPServiceApplication -Name $params.UserProfileService ` - -ErrorAction SilentlyContinue + -ErrorAction SilentlyContinue if ($null -eq $ups) { @@ -392,18 +440,18 @@ function Set-TargetResource } $caURL = (Get-SPWebApplication -IncludeCentralAdministration | Where-Object -FilterScript { - $_.IsAdministrationWebApplication -eq $true - }).Url + $_.IsAdministrationWebApplication -eq $true + }).Url $context = Get-SPServiceContext $caURL - $userProfileConfigManager = New-Object -TypeName "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" ` - -ArgumentList $context + $userProfileConfigManager = New-Object -TypeName "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" ` + -ArgumentList $context if ($null -eq $userProfileConfigManager) { #if config manager returns when ups is available then isuee is permissions throw ("Account running process needs admin permissions on the user profile " + ` - "service application") + "service application") } $coreProperties = $userProfileConfigManager.ProfilePropertyManager.GetCoreProperties() @@ -413,10 +461,10 @@ function Set-TargetResource $userProfileProperty = $userProfileSubType.Properties.GetPropertyByName($params.Name) if ($null -ne $userProfileProperty ` - -and $userProfileProperty.CoreProperty.Type -ne $params.Type) + -and $userProfileProperty.CoreProperty.Type -ne $params.Type) { throw ("Can't change property type. Current Type is " + ` - "$($userProfileProperty.CoreProperty.Type)") + "$($userProfileProperty.CoreProperty.Type)") } $termSet = $null @@ -424,12 +472,12 @@ function Set-TargetResource if ($params.ContainsKey("TermSet")) { $currentTermSet = $userProfileProperty.CoreProperty.TermSet; - if($currentTermSet.Name -ne $params.TermSet -or + if ($currentTermSet.Name -ne $params.TermSet -or $currentTermSet.Group.Name -ne $params.TermGroup -or $currentTermSet.TermStore.Name -ne $params.TermStore) { $session = New-Object -TypeName Microsoft.SharePoint.Taxonomy.TaxonomySession ` - -ArgumentList $caURL + -ArgumentList $caURL $termStore = $session.TermStores[$params.TermStore] @@ -440,13 +488,13 @@ function Set-TargetResource $group = $termStore.Groups[$params.TermGroup] - if($null -eq $group) + if ($null -eq $group) { throw "Term Group $($params.termGroup) not found" } $termSet = $group.TermSets[$params.TermSet] - if($null -eq $termSet) + if ($null -eq $termSet) { throw "Term Set $($params.termSet) not found" } @@ -461,24 +509,24 @@ function Set-TargetResource return } } - elseif($null -eq $userProfileProperty) + elseif ($null -eq $userProfileProperty) { $coreProperty = $coreProperties.Create($false) $coreProperty.Name = $params.Name $coreProperty.DisplayName = $params.DisplayName Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $coreProperty ` - -PropertyToSet "Length" ` - -ParamsValue $params ` - -ParamKey "Length" + -PropertyToSet "Length" ` + -ParamsValue $params ` + -ParamKey "Length" - if($params.Type -eq "String (Multi Value)") + if ($params.Type -eq "String (Multi Value)") { $coreProperty.IsMultivalued = $true } $coreProperty.Type = $params.Type - if($null -ne $termSet) + if ($null -ne $termSet) { $coreProperty.TermSet = $termSet } @@ -500,54 +548,54 @@ function Set-TargetResource $coreProperty = $userProfileProperty.CoreProperty $userProfileTypeProperty = $userProfileProperty.TypeProperty Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $coreProperty ` - -PropertyToSet "DisplayName" ` - -ParamsValue $params ` - -ParamKey "DisplayName" + -PropertyToSet "DisplayName" ` + -ParamsValue $params ` + -ParamKey "DisplayName" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $coreProperty ` - -PropertyToSet "Description" ` - -ParamsValue $params ` - -ParamKey "Description" + -PropertyToSet "Description" ` + -ParamsValue $params ` + -ParamKey "Description" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileTypeProperty ` - -PropertyToSet "IsVisibleOnViewer" ` - -ParamsValue $params ` - -ParamKey "IsVisibleOnViewer" + -PropertyToSet "IsVisibleOnViewer" ` + -ParamsValue $params ` + -ParamKey "IsVisibleOnViewer" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileTypeProperty ` - -PropertyToSet "IsVisibleOnEditor" ` - -ParamsValue $params ` - -ParamKey "IsVisibleOnEditor" + -PropertyToSet "IsVisibleOnEditor" ` + -ParamsValue $params ` + -ParamKey "IsVisibleOnEditor" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileTypeProperty ` - -PropertyToSet "IsEventLog" ` - -ParamsValue $params ` - -ParamKey "IsEventLog" + -PropertyToSet "IsEventLog" ` + -ParamsValue $params ` + -ParamKey "IsEventLog" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $coreProperty ` - -PropertyToSet "IsSearchable" ` - -ParamsValue $params ` - -ParamKey "IsSearchable" + -PropertyToSet "IsSearchable" ` + -ParamsValue $params ` + -ParamKey "IsSearchable" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileProperty ` - -PropertyToSet "DefaultPrivacy" ` - -ParamsValue $params ` - -ParamKey "PrivacySetting" + -PropertyToSet "DefaultPrivacy" ` + -ParamsValue $params ` + -ParamKey "PrivacySetting" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileProperty ` - -PropertyToSet "PrivacyPolicy" ` - -ParamsValue $params ` - -ParamKey "PolicySetting" + -PropertyToSet "PrivacyPolicy" ` + -ParamsValue $params ` + -ParamKey "PolicySetting" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileProperty ` - -PropertyToSet "IsUserEditable" ` - -ParamsValue $params ` - -ParamKey "IsUserEditable" + -PropertyToSet "IsUserEditable" ` + -ParamsValue $params ` + -ParamKey "IsUserEditable" Set-SPDscObjectPropertyIfValuePresent -ObjectToSet $userProfileProperty ` - -PropertyToSet "UserOverridePrivacy" ` - -ParamsValue $params ` - -ParamKey "UserOverridePrivacy" + -PropertyToSet "UserOverridePrivacy" ` + -ParamsValue $params ` + -ParamKey "UserOverridePrivacy" if ($termSet) { $coreProperty.TermSet = $termSet @@ -560,69 +608,65 @@ function Set-TargetResource if ($params.ContainsKey("DisplayOrder")) { $profileManager = New-Object -TypeName "Microsoft.Office.Server.UserProfiles.UserProfileManager" ` - -ArgumentList $context + -ArgumentList $context $profileManager.Properties.SetDisplayOrderByPropertyName($params.Name, $params.DisplayOrder) $profileManager.Properties.CommitDisplayOrder() } - if ($params.ContainsKey("MappingConnectionName") ` - -and $params.ContainsKey("MappingPropertyName")) + if ($params.ContainsKey("PropertyMappings")) { - $syncConnection = $userProfileConfigManager.ConnectionManager | Where-Object -FilterScript { - $_.DisplayName -eq $params.MappingConnectionName - } - - if ($null -eq $syncConnection ) + foreach ($propertyMapping in $PropertyMappings) { - throw "connection not found" - } - $syncConnection = $userProfileConfigManager.ConnectionManager | Where-Object -FilterScript { - $_.DisplayName -eq $params.MappingConnectionName - } + $syncConnection = $userProfileConfigManager.ConnectionManager[$propertyMapping.ConnectionName] - if($null -ne $syncConnection.PropertyMapping) - { - $currentMapping = $syncConnection.PropertyMapping.Item($params.Name) - } + if ($null -eq $syncConnection) + { + throw "connection not found" + } - if($null -eq $currentMapping ` - -or ($currentMapping.DataSourcePropertyName -ne $params.MappingPropertyName) ` - -or ($currentMapping.IsImport ` - -and $params.ContainsKey("MappingDirection") ` - -and $params.MappingDirection -eq "Export") - ) - { - if ($null -ne $currentMapping) + if ($null -ne $syncConnection.PropertyMapping) { - $currentMapping.Delete() #API allows updating, but UI doesn't do that. + $currentMapping = $syncConnection.PropertyMapping.Item($params.Name) } - $export = $params.ContainsKey("MappingDirection") -and $params.MappingDirection -eq "Export" - if ($syncConnection.Type -eq "ActiveDirectoryImport") + if ($null -eq $currentMapping ` + -or ($currentMapping.DataSourcePropertyName -ne $params.MappingPropertyName) ` + -or ($currentMapping.IsImport ` + -and $propertyMapping.Direction -eq "Export") + ) { - if ($export) + if ($null -ne $currentMapping) { - throw "not implemented" + $currentMapping.Delete() #API allows updating, but UI doesn't do that. } - else - { - $syncConnection.AddPropertyMapping($params.MappingPropertyName,$params.Name) - $syncConnection.Update() - } - } - else - { - if ($export) + + $export = $propertyMapping.Direction -eq "Export" + if ($syncConnection.Type -eq "ActiveDirectoryImport") { - $syncConnection.PropertyMapping.AddNewExportMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, - $params.Name, - $params.MappingPropertyName) + if ($export) + { + throw "not implemented" + } + else + { + $syncConnection.AddPropertyMapping($propertyMapping.PropertyName, $params.Name) + $syncConnection.Update() + } } else { - $syncConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, - $params.Name, - $params.MappingPropertyName) + if ($export) + { + $syncConnection.PropertyMapping.AddNewExportMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, + $params.Name, + $propertyMapping.PropertyName) + } + else + { + $syncConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, + $params.Name, + $propertyMapping.PropertyName) + } } } } @@ -641,7 +685,7 @@ function Test-TargetResource $Name, [Parameter()] - [ValidateSet("Present","Absent")] + [ValidateSet("Present", "Absent")] [System.String] $Ensure = "Present", @@ -655,21 +699,21 @@ function Test-TargetResource [Parameter()] [ValidateSet("Big Integer", - "Binary", - "Boolean", - "Date", - "DateNoYear", - "Date Time", - "Email", - "Float", - "HTML", - "Integer", - "Person", - "String (Single Value)", - "String (Multi Value)", - "TimeZone", - "Unique Identifier", - "URL")] + "Binary", + "Boolean", + "Date", + "DateNoYear", + "Date Time", + "Email", + "Float", + "HTML", + "Integer", + "Person", + "String (Single Value)", + "String (Multi Value)", + "TimeZone", + "Unique Identifier", + "URL")] [System.string] $Type, @@ -678,7 +722,7 @@ function Test-TargetResource $Description, [Parameter()] - [ValidateSet("Mandatory", "Optin","Optout", "Disabled")] + [ValidateSet("Mandatory", "Optin", "Optout", "Disabled")] [System.string] $PolicySetting, @@ -688,16 +732,8 @@ function Test-TargetResource $PrivacySetting, [Parameter()] - [System.string] - $MappingConnectionName, - - [Parameter()] - [System.string] - $MappingPropertyName, - - [Parameter()] - [System.string] - $MappingDirection, + [Microsoft.Management.Infrastructure.CimInstance[]] + $PropertyMappings, [Parameter()] [System.uint32] @@ -762,35 +798,33 @@ function Test-TargetResource if ($Ensure -eq "Present") { return Test-SPDscParameterState -CurrentValues $CurrentValues ` - -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("Name", - "DisplayName", - "Type", - "Description", - "PolicySetting", - "PrivacySetting", - "MappingConnectionName", - "MappingPropertyName", - "MappingDirection", - "Length", - "DisplayOrder", - "IsEventLog", - "IsVisibleOnEditor", - "IsVisibleOnViewer", - "IsUserEditable", - "IsAlias", - "IsSearchabe", - "UserOverridePrivacy", - "TermGroup", - "TermStore", - "TermSet", - "Ensure") + -DesiredValues $PSBoundParameters ` + -ValuesToCheck @("Name", + "DisplayName", + "Type", + "Description", + "PolicySetting", + "PrivacySetting", + "PropertyMappings", + "Length", + "DisplayOrder", + "IsEventLog", + "IsVisibleOnEditor", + "IsVisibleOnViewer", + "IsUserEditable", + "IsAlias", + "IsSearchabe", + "UserOverridePrivacy", + "TermGroup", + "TermStore", + "TermSet", + "Ensure") } else { return Test-SPDscParameterState -CurrentValues $CurrentValues ` - -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("Ensure") + -DesiredValues $PSBoundParameters ` + -ValuesToCheck @("Ensure") } } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.schema.mof index 6823e9d55..de072a65d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/MSFT_SPUserProfileProperty.schema.mof @@ -1,3 +1,11 @@ +[ClassVersion("1.0.0.0")] +class MSFT_SPUserProfilePropertyMapping +{ + [Required, Description("The name of the UPS connect to map this property to")] string ConnectionName; + [Required, Description("The name of the property from the UPS connection to map to")] string PropertyName; + [Required, Description("The direction of the mapping, either Import or Export"), ValueMap{"Import","Export"}, Values{"Import","Export"}] string Direction; +}; + [ClassVersion("1.0.0.0"), FriendlyName("SPUserProfileProperty")] class MSFT_SPUserProfileProperty : OMI_BaseResource { @@ -9,9 +17,7 @@ class MSFT_SPUserProfileProperty : OMI_BaseResource [Write, Description("The description of the property")] string Description; [Write, Description("The policy setting to apply to the property"), ValueMap{"Mandatory","Optin","Optout","Disabled"}, Values{"Mandatory","Optin","Optout","Disabled"}] string PolicySetting; [Write, Description("The privacy setting for the property"), ValueMap{"Public","Contacts","Organization","Manager","Private"}, Values{"Public","Contacts","Organization","Manager","Private"}] string PrivacySetting; - [Write, Description("The name of the UPS connect to map this property to")] string MappingConnectionName; - [Write, Description("The name of the property from the UPS connection to map to")] string MappingPropertyName; - [Write, Description("The direction of the mapping, either Import or Export")] string MappingDirection; + [Write, Description("The details about the property mapping"), EmbeddedInstance("MSFT_SPUserProfilePropertyMapping")] string PropertyMappings[]; [Write, Description("The length of the field")] uint32 Length; [Write, Description("The display order to put the property in to the list at")] uint32 DisplayOrder; [Write, Description("Is this field used for event logging")] boolean IsEventLog; @@ -24,5 +30,5 @@ class MSFT_SPUserProfileProperty : OMI_BaseResource [Write, Description("The name of the term store to look up managed terms from")] string TermStore; [Write, Description("The name of the term store group that terms are in for this field")] string TermGroup; [Write, Description("The name of the term set to allow values to be selected from")] string TermSet; - [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/readme.md index 12a3056c6..c22b8ce40 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileProperty/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will create a property in a user profile service application. It creates, update or delete a property using the parameters that are passed in to @@ -13,7 +14,5 @@ adds it as the last property of section X. Length is only relevant if Field type is "String". -This Resource doesn't currently support removing existing user profile - The default value for the Ensure parameter is Present. When not specifying this parameter, the user profile property is created. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSection/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSection/readme.md index b6dfc87ae..7129b2204 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSection/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSection/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will create a section in a user profile service application. It creates, update or delete a section using the parameters that are passed in to diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/MSFT_SPUserProfileServiceApp.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/MSFT_SPUserProfileServiceApp.psm1 index f45d894f9..8da5152ee 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/MSFT_SPUserProfileServiceApp.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/MSFT_SPUserProfileServiceApp.psm1 @@ -406,12 +406,14 @@ function Set-TargetResource if ($null -eq $serviceApps) { $app = New-SPProfileServiceApplication @params - if ($null -ne $app) + if ($null -eq $app) { - New-SPProfileServiceApplicationProxy -Name $pName ` - -ServiceApplication $app ` - -DefaultProxyGroup + throw ("An error occurred during creation of the service application: " + ` + $_.Exception.Message) } + New-SPProfileServiceApplicationProxy -Name $pName ` + -ServiceApplication $app ` + -DefaultProxyGroup $claimsPrincipal = New-SPClaimsPrincipal -Identity $setupAccount ` -IdentityType WindowsSamAccountName diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/readme.md index 76d204c5b..a9b6d86ad 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** Yes This resource will provision an instance of the user profile service to the farm. It creates the required databases using the parameters that are passed diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceAppPermissions/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceAppPermissions/readme.md index d37ca6885..2969da42f 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceAppPermissions/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileServiceAppPermissions/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will apply permissions to a user profile service application. These can control access to create my sites, use social features, and use diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncConnection/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncConnection/readme.md index 0a421a684..f841c746d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncConnection/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncConnection/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will ensure a specifc user profile sync connection is in place and that it is configured accordingly to its definition diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/MSFT_SPUserProfileSyncService.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/MSFT_SPUserProfileSyncService.psm1 index 1fe948f42..6b4996ad6 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/MSFT_SPUserProfileSyncService.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/MSFT_SPUserProfileSyncService.psm1 @@ -30,7 +30,7 @@ function Get-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -ne 15) { throw [Exception] ("Only SharePoint 2013 is supported to deploy the user profile sync " + ` - "service via DSC, as 2016 does not use the FIM based sync service.") + "service via DSC, as 2016/2019 do not use the FIM based sync service.") } $farmAccount = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -173,7 +173,7 @@ function Set-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -ne 15) { throw [Exception] ("Only SharePoint 2013 is supported to deploy the user profile sync " + ` - "service via DSC, as 2016 does not use the FIM based sync service.") + "service via DSC, as 2016/2019 do not use the FIM based sync service.") } $farmAccount = Invoke-SPDSCCommand -Credential $InstallAccount ` @@ -381,7 +381,7 @@ function Test-TargetResource if ((Get-SPDSCInstalledProductVersion).FileMajorPart -ne 15) { throw [Exception] ("Only SharePoint 2013 is supported to deploy the user profile sync " + ` - "service via DSC, as 2016 does not use the FIM based sync service.") + "service via DSC, as 2016/2019 do not use the FIM based sync service.") } $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/readme.md index 4c4d74a5c..535c6bbbc 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPUserProfileSyncService/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Specific +**Requires CredSSP:** Yes This resource is responsible for ensuring that the user profile sync service has been provisioned (Ensure = "Present") or is not running (Ensure = diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPVisioServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPVisioServiceApp/readme.md index cfdf41eb4..bb30a1f9c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPVisioServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPVisioServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating Visio Graphics Service Application instances within the local SharePoint farm. The resource will provision and diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWeb/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWeb/readme.md index 267226221..1183566fd 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWeb/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWeb/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will provision a SPWeb based on the settings that are passed through. These settings map to the New-SPWeb cmdlet and accept the same values diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/readme.md index a197bba25..3d67d1783 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppAuthentication/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for configuring the authentication on a web application within the local SharePoint farm. The resource is able to diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.psm1 index 1109828b2..81e803c85 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.psm1 @@ -4,12 +4,12 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, - [Parameter()] - [System.String[]] + [Parameter()] + [System.String[]] $Blocked, [Parameter()] @@ -21,19 +21,19 @@ function Get-TargetResource $EnsureAllowed, [Parameter()] - [System.Management.Automation.PSCredential] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Getting web application '$url' blocked file types" + Write-Verbose -Message "Getting web application '$WebAppUrl' blocked file types" $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments @($PSBoundParameters,$PSScriptRoot) ` -ScriptBlock { $params = $args[0] $ScriptRoot = $args[1] - - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { return $null @@ -43,7 +43,7 @@ function Get-TargetResource Import-Module -Name (Join-Path -Path $ScriptRoot -ChildPath $modulePath -Resolve) $result = Get-SPDSCWebApplicationBlockedFileTypeConfig -WebApplication $wa - $result.Add("Url", $params.Url) + $result.Add("WebAppUrl", $params.WebAppUrl) $result.Add("InstallAccount", $params.InstallAccount) return $result } @@ -56,12 +56,12 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, - [Parameter()] - [System.String[]] + [Parameter()] + [System.String[]] $Blocked, [Parameter()] @@ -73,11 +73,11 @@ function Set-TargetResource $EnsureAllowed, [Parameter()] - [System.Management.Automation.PSCredential] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Setting web application '$Url' blocked file types" + Write-Verbose -Message "Setting web application '$WebAppUrl' blocked file types" $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments @($PSBoundParameters,$PSScriptRoot) ` @@ -85,10 +85,10 @@ function Set-TargetResource $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { - throw "Web application $($params.Url) was not found" + throw "Web application $($params.WebAppUrl) was not found" return } @@ -106,12 +106,12 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, - [Parameter()] - [System.String[]] + [Parameter()] + [System.String[]] $Blocked, [Parameter()] @@ -123,11 +123,11 @@ function Test-TargetResource $EnsureAllowed, [Parameter()] - [System.Management.Automation.PSCredential] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Testing for web application '$Url' blocked file types" + Write-Verbose -Message "Testing for web application '$WebAppUrl' blocked file types" $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.schema.mof index b2ecbd498..1895ceed2 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/MSFT_SPWebAppBlockedFileTypes.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0"), FriendlyName("SPWebAppBlockedFileTypes")] class MSFT_SPWebAppBlockedFileTypes : OMI_BaseResource { - [Key, Description("The URL of the web application to set blocked file types for")] string Url; + [Key, Description("The URL of the web application to set blocked file types for")] string WebAppUrl; [write, Description("This is a fixed list to use for blocked file types in this web app")] string Blocked[]; [write, Description("This list of file types that will always be added to the list for this web app. Types not in this list will be left in the list")] string EnsureBlocked[]; [write, Description("This list of file types that will always be removedfrom the list for this web app. Types not in this list will be left in the list")] string EnsureAllowed[]; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/readme.md index cef31b3c5..d35c7fd8d 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppBlockedFileTypes/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No 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 diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.psm1 index 3f0c0e26b..8f9b69176 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.psm1 @@ -6,7 +6,7 @@ function Get-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [Microsoft.Management.Infrastructure.CimInstance[]] @@ -61,7 +61,7 @@ function Get-TargetResource $InstallAccount ) - Write-Verbose -Message "Getting web application '$url' client callable settings" + Write-Verbose -Message "Getting web application '$WebAppUrl' client callable settings" if ($ProxyLibraries -and (($ProxyLibrariesToInclude) -or ($ProxyLibrariesToExclude))) { @@ -74,12 +74,12 @@ function Get-TargetResource -ScriptBlock { $params = $args[0] - $webApplication = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $webApplication = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $webApplication) { - Write-Verbose "Web application $($params.Url) was not found" + Write-Verbose "Web application $($params.WebAppUrl) was not found" return @{ - Url = $null + WebAppUrl = $null ProxyLibraries = $null ProxyLibrariesToInclude = $null ProxyLibrariesToExclude = $null @@ -120,7 +120,7 @@ function Get-TargetResource } return @{ - Url = $params.Url + WebAppUrl = $params.WebAppUrl ProxyLibraries = $clientCallableSettings.ProxyLibraries #$proxyLibraries ProxyLibrariesToInclude = $include ProxyLibrariesToExclude = $exclude @@ -147,7 +147,7 @@ function Set-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [Microsoft.Management.Infrastructure.CimInstance[]] @@ -202,7 +202,7 @@ function Set-TargetResource $InstallAccount ) - Write-Verbose -Message "Setting web application '$Url' client callable settings" + Write-Verbose -Message "Setting web application '$WebAppUrl' client callable settings" if ($ProxyLibraries -and (($ProxyLibrariesToInclude) -or ($ProxyLibrariesToExclude))) { @@ -215,10 +215,10 @@ function Set-TargetResource -ScriptBlock { $params = $args[0] - $webApplication = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $webApplication = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $webApplication) { - throw "Web application $($params.Url) was not found" + throw "Web application $($params.WebAppUrl) was not found" } $clientCallableSettings = $webApplication.ClientCallableSettings @@ -406,7 +406,7 @@ function Test-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [Microsoft.Management.Infrastructure.CimInstance[]] @@ -461,7 +461,7 @@ function Test-TargetResource $InstallAccount ) - Write-Verbose -Message "Testing for web application '$Url' client callable settings" + Write-Verbose -Message "Testing for web application '$WebAppUrl' client callable settings" $currentValues = Get-TargetResource @PSBoundParameters @@ -574,7 +574,7 @@ function Test-TargetResource return Test-SPDscParameterState -CurrentValues $currentValues ` -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("Url", + -ValuesToCheck @("WebAppUrl", "MaxResourcesPerRequest", "MaxObjectPaths", "ExecutionTimeout", diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof index b456130b4..c0883304e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/MSFT_SPWebAppClientCallableSettings.schema.mof @@ -7,7 +7,7 @@ Class MSFT_SPProxyLibraryEntry [ClassVersion("1.0.0"), FriendlyName("SPWebAppClientCallableSettings")] class MSFT_SPWebAppClientCallableSettings : OMI_BaseResource { - [Key, Description("The URL of the web application to set blocked file types for")] string Url; + [Key, Description("The URL of the web application to set blocked file types for")] string WebAppUrl; [write, Description("A list of proxy libraries to set. Those not in this list will be removed"), EmbeddedInstance("MSFT_SPProxyLibraryEntry")] string ProxyLibraries[]; [write, Description("A list of proxy libraries to add. Proxy libraries not in this list will be kept"), EmbeddedInstance("MSFT_SPProxyLibraryEntry")] string ProxyLibrariesToInclude[]; [write, Description("A list of proxy libraries to remove. Proxy libraries not in this list will be kept")] string ProxyLibrariesToExclude[]; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/readme.md index 0f3394f07..9b3ed5c8c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppClientCallableSettings/readme.md @@ -1,12 +1,13 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource sets the client callable settings for the web application. It can set the proxy libraries and specific properties for the client -callable settings. -The resource can for example be used to increase the timeout for client -code, and to enable the tenant administration functionality. +callable settings. The resource can for example be used to increase the +timeout for client code, and to enable the tenant administration +functionality. Tenant administration functionality enables client code to work with the namespace Microsoft.Online.SharePoint.Client.Tenant from the @@ -34,7 +35,7 @@ Proxy library used for enabling tenant administration: Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub , Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c -**SharePoint 2016**: +**SharePoint 2016/2019**: Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub , Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.psm1 index e8c8c9429..65e66ce4e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.psm1 @@ -6,7 +6,7 @@ function Get-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.UInt32] @@ -94,7 +94,7 @@ function Get-TargetResource $InstallAccount ) - Write-Verbose -Message "Getting web application '$Url' general settings" + Write-Verbose -Message "Getting web application '$WebAppUrl' general settings" $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments @($PSBoundParameters,$PSScriptRoot) ` @@ -102,11 +102,11 @@ function Get-TargetResource $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { return @{ - Url = $params.Url + WebAppUrl = $params.WebAppUrl TimeZone = $null Alerts = $null AlertsLimit = $null @@ -134,7 +134,7 @@ function Get-TargetResource Import-Module -Name (Join-Path -Path $ScriptRoot -ChildPath $modulePath -Resolve) $result = Get-SPDSCWebApplicationGeneralConfig -WebApplication $wa - $result.Add("Url", $params.Url) + $result.Add("WebAppUrl", $params.WebAppUrl) $result.Add("InstallAccount", $params.InstallAccount) return $result } @@ -148,7 +148,7 @@ function Set-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.UInt32] @@ -236,7 +236,7 @@ function Set-TargetResource $InstallAccount ) - Write-Verbose -Message "Setting web application '$url' general settings" + Write-Verbose -Message "Setting web application '$WebAppUrl' general settings" Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments @($PSBoundParameters,$PSScriptRoot) ` @@ -244,10 +244,10 @@ function Set-TargetResource $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { - throw "Web application $($params.Url) was not found" + throw "Web application $($params.WebAppUrl) was not found" } if ($params.ContainsKey("DefaultQuotaTemplate")) @@ -277,7 +277,7 @@ function Test-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.UInt32] @@ -365,7 +365,7 @@ function Test-TargetResource $InstallAccount ) - Write-Verbose -Message "Testing web application '$url' general settings" + Write-Verbose -Message "Testing web application '$WebAppUrl' general settings" $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.schema.mof index 525a76180..544a63cb9 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/MSFT_SPWebAppGeneralSettings.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0"), FriendlyName("SPWebAppGeneralSettings")] class MSFT_SPWebAppGeneralSettings : OMI_BaseResource { - [Key, Description("The URL of the web app to set the general settings for")] string Url; + [Key, Description("The URL of the web app to set the general settings for")] string WebAppUrl; [Write, Description("The timezone code to use for this web app. A full list is at https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spregionalsettings.timezones.aspx")] uint32 TimeZone; [Write, Description("Should alerts be enabled for this web app")] boolean Alerts; [Write, Description("What is the maximum number of alerts that a user can create in this web app")] uint32 AlertsLimit; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/readme.md index 1aad9058a..af4adebd8 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppGeneralSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for setting web application settings that are found under the "general settings" screen in central admin. The web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPeoplePickerSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPeoplePickerSettings/readme.md index 589f28b5e..32987f58c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPeoplePickerSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPeoplePickerSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to configure the People Picker settings for a web application. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPermissions/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPermissions/readme.md index 077e5dfb6..25c7ca2e2 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPermissions/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPermissions/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for managing the user permissions for a web application. You can either specify to set all permissions or specify diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/readme.md index ae5142289..1ca44cf5c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to set the User Policies for web applications. The usernames can be either specified in Classic or Claims format, both will be diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPropertyBag/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPropertyBag/readme.md index 174f83df2..6fe3a07f5 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPropertyBag/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppPropertyBag/readme.md @@ -1,10 +1,11 @@ # Description **Type:** Distributed +**Requires CredSSP:** No -This resource is used to work with SharePoint Property Bags -at the web application level. -The account that runs this resource must be a farm administrator. +This resource is used to work with SharePoint Property Bags at the web +application level. The account that runs this resource must be a farm +administrator. -The default value for the Ensure parameter is Present. When not specifying this -parameter, the property bag is configured. +The default value for the Ensure parameter is Present. When not specifying +this parameter, the property bag is configured. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppProxyGroup/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppProxyGroup/readme.md index 96c6b83f0..e7dea1b5a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppProxyGroup/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppProxyGroup/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to associate a web application to a service application proxy group. Use the proxy group name "Default" to associate the web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.psm1 index aa3a82836..f17ddfd43 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.psm1 @@ -4,60 +4,60 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] - [System.String] - $Url, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $SendUnusedSiteCollectionNotifications, - - [Parameter()] - [System.UInt32] + + [Parameter()] + [System.UInt32] $UnusedSiteNotificationPeriod, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AutomaticallyDeleteUnusedSiteCollections, - [Parameter()] - [ValidateRange(2,168)] - [System.UInt32] + [Parameter()] + [ValidateRange(2,168)] + [System.UInt32] $UnusedSiteNotificationsBeforeDeletion, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Getting web application '$url' site use and deletion settings" + Write-Verbose -Message "Getting web application '$WebAppUrl' site use and deletion settings" $result = Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - - try + + try { $spFarm = Get-SPFarm - } - catch + } + catch { Write-Verbose -Message ("No local SharePoint farm was detected. Site Use and " + ` "Deletion settings will not be applied") return $null } - $wa = Get-SPWebApplication -Identity $params.Url ` + $wa = Get-SPWebApplication -Identity $params.WebAppUrl ` -ErrorAction SilentlyContinue if ($null -eq $wa) { - return $null + return $null } return @{ # Set the Site Use and Deletion settings - Url = $params.Url + WebAppUrl = $params.WebAppUrl SendUnusedSiteCollectionNotifications = $wa.SendUnusedSiteCollectionNotifications UnusedSiteNotificationPeriod = $wa.UnusedSiteNotificationPeriod.TotalDays AutomaticallyDeleteUnusedSiteCollections = $wa.AutomaticallyDeleteUnusedSiteCollections @@ -74,64 +74,64 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] - [System.String] - $Url, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $SendUnusedSiteCollectionNotifications, - - [Parameter()] - [System.UInt32] + + [Parameter()] + [System.UInt32] $UnusedSiteNotificationPeriod, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AutomaticallyDeleteUnusedSiteCollections, - [Parameter()] - [ValidateRange(2,168)] - [System.UInt32] + [Parameter()] + [ValidateRange(2,168)] + [System.UInt32] $UnusedSiteNotificationsBeforeDeletion, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Setting web application '$Url' Site Use and Deletion settings" + Write-Verbose -Message "Setting web application '$WebAppUrl' Site Use and Deletion settings" Invoke-SPDSCCommand -Credential $InstallAccount ` -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - try + try { $spFarm = Get-SPFarm - } - catch + } + catch { throw ("No local SharePoint farm was detected. Site Use and Deletion settings " + ` "will not be applied") } - - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { throw "Configured web application could not be found" } # Check if the specified value is in the range for the configured schedule - $job = Get-SPTimerJob -Identity job-dead-site-delete -WebApplication $params.Url + $job = Get-SPTimerJob -Identity job-dead-site-delete -WebApplication $params.WebAppUrl if ($null -eq $job) { - throw "Dead Site Delete timer job for web application $($params.Url) could not be found" + throw "Dead Site Delete timer job for web application $($params.WebAppUrl) could not be found" } else { - # Check schedule value + # Check schedule value switch ($job.Schedule.Description) { "Daily" { @@ -159,7 +159,7 @@ function Set-TargetResource } } } - } + } Write-Verbose -Message "Start update" @@ -182,7 +182,7 @@ function Set-TargetResource if ($params.ContainsKey("UnusedSiteNotificationsBeforeDeletion")) { $wa.UnusedSiteNotificationsBeforeDeletion = ` - $params.UnusedSiteNotificationsBeforeDeletion + $params.UnusedSiteNotificationsBeforeDeletion } $wa.Update() } @@ -194,39 +194,39 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] - [System.String] - $Url, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $SendUnusedSiteCollectionNotifications, - - [Parameter()] - [System.UInt32] + + [Parameter()] + [System.UInt32] $UnusedSiteNotificationPeriod, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $AutomaticallyDeleteUnusedSiteCollections, - [Parameter()] - [ValidateRange(2,168)] - [System.UInt32] + [Parameter()] + [ValidateRange(2,168)] + [System.UInt32] $UnusedSiteNotificationsBeforeDeletion, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Testing web application '$url' site use and deletion settings" + Write-Verbose -Message "Testing web application '$WebAppUrl' site use and deletion settings" $CurrentValues = Get-TargetResource @PSBoundParameters - + if ($null -eq $CurrentValues) { - return $false + return $false } return Test-SPDscParameterState -CurrentValues $CurrentValues ` diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.schema.mof index 0de0fd288..a6e68c30c 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0"), FriendlyName("SPWebAppSiteUseAndDeletion")] class MSFT_SPWebAppSiteUseAndDeletion : OMI_BaseResource { - [Key, Description("The URL of the web application")] string Url; + [Key, Description("The URL of the web application")] string WebAppUrl; [Write, Description("Should emails be sent to notify site owners of unused site collections")] boolean SendUnusedSiteCollectionNotifications; [Write, Description("How many days should pass before a site is flagged as unused")] uint32 UnusedSiteNotificationPeriod; [Write, Description("Should unused site collection be automatically deleted")] boolean AutomaticallyDeleteUnusedSiteCollections; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/readme.md index 256312c93..b90913975 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for controlling the Site Use and Deletion settings on a specific web application. You can enable or disable the Site Use diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/MSFT_SPWebAppSuiteBar.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/MSFT_SPWebAppSuiteBar.psm1 index aea1559d6..bbdf77e90 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/MSFT_SPWebAppSuiteBar.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/MSFT_SPWebAppSuiteBar.psm1 @@ -122,15 +122,15 @@ function Set-TargetResource { 15 { - <# Exception: One of the SP2016 specific parameter was passed with SP2013 #> + <# Exception: One of the SP2016/SP2019 specific parameter was passed with SP2013 #> if($PSBoundParameters.ContainsKey("SuiteNavBrandingLogoNavigationUrl") ` -or $PSBoundParameters.ContainsKey("SuiteNavBrandingLogoTitle") ` -or $PSBoundParameters.ContainsKey("SuiteNavBrandingLogoUrl") ` -or $PSBoundParameters.ContainsKey("SuiteNavBrandingText")) { throw ("Cannot specify SuiteNavBrandingLogoNavigationUrl, SuiteNavBrandingLogoTitle, " + ` - "SuiteNavBrandingLogoUrl or SuiteNavBrandingText with SharePoint 2013. Instead," + ` - " only specify the SuiteBarBrandingElementHtml parameter") + "SuiteNavBrandingLogoUrl or SuiteNavBrandingText with SharePoint 2013. Instead," + ` + " only specify the SuiteBarBrandingElementHtml parameter") } <# Exception: The SP2013 optional parameter is null. #> @@ -144,11 +144,11 @@ function Set-TargetResource { if($PSBoundParameters.ContainsKey("SuiteBarBrandingElementHtml")) { - Write-Verbose ("SuiteBarBrandingElementHtml with SharePoint 2016 only works if using a " + ` - "SharePoint 2016 masterpage") + Write-Verbose ("SuiteBarBrandingElementHtml with SharePoint 2016 and 2019 only works " + ` + "if using a SharePoint 2013 masterpage") } - <# Exception: All the optional parameters are null for SP2016. #> + <# Exception: All the optional parameters are null for SP2016/SP2019. #> if(!$PSBoundParameters.ContainsKey("SuiteNavBrandingLogoNavigationUrl") ` -and !$PSBoundParameters.ContainsKey("SuiteNavBrandingLogoTitle") ` -and !$PSBoundParameters.ContainsKey("SuiteNavBrandingLogoUrl") ` @@ -156,8 +156,8 @@ function Set-TargetResource -and !$PSBoundParameters.ContainsKey("SuiteBarBrandingElementHtml")) { throw ("You need to specify a value for either SuiteNavBrandingLogoNavigationUrl, " + ` - "SuiteNavBrandingLogoTitle, SuiteNavBrandingLogoUrl, SuiteNavBrandingText, " + ` - "and SuiteBarBrandingElementHtml with SharePoint 2016") + "SuiteNavBrandingLogoTitle, SuiteNavBrandingLogoUrl, SuiteNavBrandingText " + ` + "or SuiteBarBrandingElementHtml with SharePoint 2016 or 2019") } } } @@ -251,14 +251,18 @@ function Test-TargetResource if($installedVersion.FileMajorPart -eq 15) { return Test-SPDscParameterState -CurrentValues $CurrentValues ` - -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("SuiteBarBrandingElementHtml"); + -DesiredValues $PSBoundParameters ` + -ValuesToCheck @("SuiteBarBrandingElementHtml"); } else { return Test-SPDscParameterState -CurrentValues $CurrentValues ` - -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("SuiteBarBrandingElementHtml", "SuiteNavBrandingLogoNavigationUrl", "SuiteNavBrandingLogoTitle", "SuiteNavBrandingLogoUrl", "SuiteNavBrandingText") + -DesiredValues $PSBoundParameters ` + -ValuesToCheck @("SuiteBarBrandingElementHtml", + "SuiteNavBrandingLogoNavigationUrl", + "SuiteNavBrandingLogoTitle", + "SuiteNavBrandingLogoUrl", + "SuiteNavBrandingText") } } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/readme.md index 24bf443b8..d45d2b2eb 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppSuiteBar/readme.md @@ -1,13 +1,14 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to set the Suite Bar branding for web applications. It supports both the SharePoint 2013 and SharePoint -2016 ways of branding the suite bar. +2016/2019 ways of branding the suite bar. Requirements: -For SharePoint 2013, only the SuiteBarBrandingElementHtml -should be specified, whereas for SharePoint 2016, all properties +For SharePoint 2013, only the SuiteBarBrandingElementHtml should +be specified, whereas for SharePoint 2016/2019, all properties are supported. Note that SuiteBarBrandingElementHtml has no effect unless using a SharePoint 2013 master page. diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.psm1 index e3afca1d9..fa613cc38 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.psm1 @@ -6,7 +6,7 @@ function Get-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.UInt32] @@ -57,14 +57,14 @@ function Get-TargetResource $InstallAccount ) - Write-Verbose -Message "Getting web application '$url' throttling settings" + Write-Verbose -Message "Getting web application '$WebAppUrl' throttling settings" $paramArgs = @($PSBoundParameters,$PSScriptRoot) $result = Invoke-SPDSCCommand -Credential $InstallAccount -Arguments $paramArgs -ScriptBlock { $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { return $null @@ -74,7 +74,7 @@ function Get-TargetResource Import-Module -Name (Join-Path -Path $ScriptRoot -ChildPath $relPath -Resolve) $result = Get-SPDSCWebApplicationThrottlingConfig -WebApplication $wa - $result.Add("Url", $params.Url) + $result.Add("WebAppUrl", $params.WebAppUrl) $result.Add("InstallAccount", $params.InstallAccount) return $result } @@ -88,7 +88,7 @@ function Set-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.UInt32] @@ -139,7 +139,7 @@ function Set-TargetResource $InstallAccount ) - Write-Verbose -Message "Setting web application '$Url' throttling settings" + Write-Verbose -Message "Setting web application '$WebAppUrl' throttling settings" $paramArgs = @($PSBoundParameters,$PSScriptRoot) @@ -147,10 +147,10 @@ function Set-TargetResource $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { - throw "Web application $($params.Url) was not found" + throw "Web application $($params.WebAppUrl) was not found" return } @@ -164,7 +164,7 @@ function Set-TargetResource 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 + $wa2 = Get-SPWebApplication -Identity $params.WebAppUrl Set-SPDSCWebApplicationHappyHourConfig -WebApplication $wa2 -Settings $params.HappyHour $wa2.Update() } @@ -179,7 +179,7 @@ function Test-TargetResource ( [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.UInt32] @@ -230,7 +230,7 @@ function Test-TargetResource $InstallAccount ) - Write-Verbose -Message "Testing web application '$url' throttling settings" + Write-Verbose -Message "Testing web application '$WebAppUrl' throttling settings" $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.schema.mof index 0814b2568..364f6ef3b 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/MSFT_SPWebAppThrottlingSettings.schema.mof @@ -9,9 +9,9 @@ Class MSFT_SPWebApplicationHappyHour [ClassVersion("1.0.0.0"), FriendlyName("SPWebAppThrottlingSettings")] class MSFT_SPWebAppThrottlingSettings : OMI_BaseResource { - [Key, Description("The URL of the web application")] string Url; + [Key, Description("The URL of the web application")] string WebAppUrl; [Write, Description("What should the list view threshold for this site be set to")] uint32 ListViewThreshold; - [Write, Description("Should object model code be able to be override the list view threshold")] boolean AllowObjectModelOverride; + [Write, Description("Should object model code be able to be override the list view threshold")] boolean AllowObjectModelOverride; [Write, Description("What is the list view threshold for site administrators")] uint32 AdminThreshold; [Write, Description("What is the maximum number of lookup fields in a single list view")] uint32 ListViewLookupThreshold; [Write, Description("Should the happy hour window be enabled for this web app")] boolean HappyHourEnabled; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/readme.md index 37fdec3b7..bd29685df 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppThrottlingSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for setting web application settings that are found under the "resource throttling" screen in central admin. The web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.psm1 index 375e6a978..fb62273e0 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.psm1 @@ -4,46 +4,46 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory = $true)] - [System.String] - $Url, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ExternalWorkflowParticipantsEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $UserDefinedWorkflowsEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $EmailToNoPermissionWorkflowParticipantsEnable, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Getting web application '$url' workflow settings" + Write-Verbose -Message "Getting web application '$WebAppUrl' workflow settings" $paramArgs = @($PSBoundParameters,$PSScriptRoot) $result = Invoke-SPDSCCommand -Credential $InstallAccount -Arguments $paramArgs -ScriptBlock { $params = $args[0] $ScriptRoot = $args[1] - - - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + + + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { - return $null + return $null } $relPath = "..\..\Modules\SharePointDsc.WebApplication\SPWebApplication.Workflow.psm1" Import-Module (Join-Path $ScriptRoot $relPath -Resolve) $result = Get-SPDSCWebApplicationWorkflowConfig -WebApplication $wa - $result.Add("Url", $params.Url) + $result.Add("WebAppUrl", $params.WebAppUrl) $result.Add("InstallAccount", $params.InstallAccount) return $result } @@ -55,38 +55,38 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory = $true)] - [System.String] - $Url, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ExternalWorkflowParticipantsEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $UserDefinedWorkflowsEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $EmailToNoPermissionWorkflowParticipantsEnable, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Setting web application '$Url' workflow settings" + Write-Verbose -Message "Setting web application '$WebAppUrl' workflow settings" $paramArgs = @($PSBoundParameters,$PSScriptRoot) $result = Invoke-SPDSCCommand -Credential $InstallAccount -Arguments $paramArgs -ScriptBlock { $params = $args[0] $ScriptRoot = $args[1] - $wa = Get-SPWebApplication -Identity $params.Url -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { - throw "Web application $($params.Url) was not found" + throw "Web application $($params.WebAppUrl) was not found" return } @@ -102,28 +102,28 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory = $true)] - [System.String] - $Url, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $ExternalWorkflowParticipantsEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $UserDefinedWorkflowsEnabled, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $EmailToNoPermissionWorkflowParticipantsEnable, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Testing web application '$Url' workflow settings" + Write-Verbose -Message "Testing web application '$WebAppUrl' workflow settings" $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.schema.mof index 60c944fa8..edfb2811b 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPWebAppWorkflowSettings")] class MSFT_SPWebAppWorkflowSettings : OMI_BaseResource { - [Key, Description("The URL of the web application")] string Url; + [Key, Description("The URL of the web application")] string WebAppUrl; [Write, Description("Are external workflow participants enabled in the web app")] boolean ExternalWorkflowParticipantsEnabled; [Write, Description("Are user defined workflows enabled in this web app")] boolean UserDefinedWorkflowsEnabled; [Write, Description("Are documents sent via email to external participants of workflow")] boolean EmailToNoPermissionWorkflowParticipantsEnable; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/readme.md index 00b2533d7..695b1b188 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for setting web application settings that are found under the "workflow settings" screen in central admin. The web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 index 2f5240528..b78f9ef85 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.psm1 @@ -18,7 +18,7 @@ function Get-TargetResource [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.Boolean] @@ -72,7 +72,7 @@ function Get-TargetResource Name = $params.Name ApplicationPool = $params.ApplicationPool ApplicationPoolAccount = $params.ApplicationPoolAccount - Url = $params.Url + WebAppUrl = $params.WebAppUrl Ensure = "Absent" } } @@ -89,7 +89,7 @@ function Get-TargetResource Name = $wa.DisplayName ApplicationPool = $wa.ApplicationPool.Name ApplicationPoolAccount = $wa.ApplicationPool.Username - Url = $wa.Url + WebAppUrl = $wa.Url AllowAnonymous = $authProvider.AllowAnonymous DatabaseName = $wa.ContentDatabases[0].Name DatabaseServer = $wa.ContentDatabases[0].Server @@ -124,7 +124,7 @@ function Set-TargetResource [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.Boolean] @@ -181,7 +181,7 @@ function Set-TargetResource $newWebAppParams = @{ Name = $params.Name ApplicationPool = $params.ApplicationPool - Url = $params.Url + Url = $params.WebAppUrl } # Get a reference to the Administration WebService @@ -246,7 +246,7 @@ function Set-TargetResource { $newWebAppParams.Add("Port", $params.Port) } - if ((New-Object -TypeName System.Uri $params.Url).Scheme -eq "https") + if ((New-Object -TypeName System.Uri $params.WebAppUrl).Scheme -eq "https") { $newWebAppParams.Add("SecureSocketsLayer", $true) } @@ -292,7 +292,7 @@ function Test-TargetResource [Parameter(Mandatory = $true)] [System.String] - $Url, + $WebAppUrl, [Parameter()] [System.Boolean] diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.schema.mof index 052acb8e0..3d1d2a899 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/MSFT_SPWebApplication.schema.mof @@ -4,7 +4,7 @@ class MSFT_SPWebApplication : OMI_BaseResource [Key, Description("The name of the web application")] string Name; [Required, Description("The name of the application pool to run this site in")] string ApplicationPool; [Required, Description("The name of the managed account to run the app pool with")] string ApplicationPoolAccount; - [Required, Description("The URL of the web application")] string Url; + [Required, Description("The URL of the web application")] string WebAppUrl; [Write, Description("Should anonymous access be enabled for this web app")] boolean AllowAnonymous; [Write, Description("Create the web application with Classic authentication (only used during creation of a new web application)")] boolean UseClassic; [Write, Description("The name of the first content database to be created with this web app")] string DatabaseName; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/readme.md index 32f794a08..6788c0f28 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplication/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for creating a web application within the local SharePoint farm. The resource will provision the web application with all of diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.psm1 index fe418d937..e739658dd 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.psm1 @@ -5,28 +5,28 @@ function Get-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] + [System.String] $AppDomain, - [Parameter(Mandatory = $true)] - [System.String] - $WebApplication, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter(Mandatory = $true)] - [System.String] - [ValidateSet("Default","Internet","Intranet","Extranet","Custom")] + [Parameter(Mandatory = $true)] + [System.String] + [ValidateSet("Default","Internet","Intranet","Extranet","Custom")] $Zone, - [Parameter()] - [System.String] + [Parameter()] + [System.String] $Port, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $SSL, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -36,18 +36,18 @@ function Get-TargetResource -Arguments $PSBoundParameters ` -ScriptBlock { $params = $args[0] - $webAppAppDomain = Get-SPWebApplicationAppDomain -WebApplication $params.WebApplication ` + $webAppAppDomain = Get-SPWebApplicationAppDomain -WebApplication $params.WebAppUrl ` -Zone $params.Zone - if ($null -eq $webAppAppDomain) + if ($null -eq $webAppAppDomain) { return $null - } - else + } + else { return @{ - AppDomain = $webAppAppDomain.AppDomain - WebApplication = $params.WebApplication + AppDomain = $webAppAppDomain.AppDomain + WebAppUrl = $params.WebAppUrl Zone = $webAppAppDomain.UrlZone Port = $webAppAppDomain.Port SSL = $webAppAppDomain.IsSchemeSSL @@ -64,28 +64,28 @@ function Set-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] + [System.String] $AppDomain, - [Parameter(Mandatory = $true)] - [System.String] - $WebApplication, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter(Mandatory = $true)] - [System.String] - [ValidateSet("Default","Internet","Intranet","Extranet","Custom")] + [Parameter(Mandatory = $true)] + [System.String] + [ValidateSet("Default","Internet","Intranet","Extranet","Custom")] $Zone, - [Parameter()] - [System.String] + [Parameter()] + [System.String] $Port, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $SSL, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -99,21 +99,21 @@ function Set-TargetResource $params = $args[0] $CurrentValues = $args[1] - if ($null -ne $CurrentValues) + if ($null -ne $CurrentValues) { - Get-SPWebApplicationAppDomain -WebApplication $params.WebApplication ` + Get-SPWebApplicationAppDomain -WebApplication $params.WebAppUrl ` -Zone $params.Zone | Remove-SPWebApplicationAppDomain Start-Sleep -Seconds 5 } $newParams = @{ AppDomain = $params.AppDomain - WebApplication = $params.WebApplication + WebApplication = $params.WebAppUrl Zone = $params.Zone } if ($params.ContainsKey("Port") -eq $true) { - $newParams.Add("Port", $params.Port) + $newParams.Add("Port", $params.Port) } if ($params.ContainsKey("SSL") -eq $true) { @@ -131,28 +131,28 @@ function Test-TargetResource param ( [Parameter(Mandatory = $true)] - [System.String] + [System.String] $AppDomain, - [Parameter(Mandatory = $true)] - [System.String] - $WebApplication, + [Parameter(Mandatory = $true)] + [System.String] + $WebAppUrl, - [Parameter(Mandatory = $true)] - [System.String] - [ValidateSet("Default","Internet","Intranet","Extranet","Custom")] + [Parameter(Mandatory = $true)] + [System.String] + [ValidateSet("Default","Internet","Intranet","Extranet","Custom")] $Zone, - [Parameter()] - [System.String] + [Parameter()] + [System.String] $Port, - [Parameter()] - [System.Boolean] + [Parameter()] + [System.Boolean] $SSL, - [Parameter()] - [System.Management.Automation.PSCredential] + [Parameter()] + [System.Management.Automation.PSCredential] $InstallAccount ) @@ -162,12 +162,12 @@ function Test-TargetResource if ($null -eq $CurrentValues) { - return $false + return $false } return Test-SPDscParameterState -CurrentValues $CurrentValues ` -DesiredValues $PSBoundParameters ` - -ValuesToCheck @("AppDomain", "Port", "SSL") + -ValuesToCheck @("AppDomain", "Port", "SSL") } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.schema.mof b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.schema.mof index 37e111331..65c1259c3 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.schema.mof +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/MSFT_SPWebApplicationAppDomain.schema.mof @@ -1,7 +1,7 @@ [ClassVersion("1.0.0.0"), FriendlyName("SPWebApplicationAppDomain")] class MSFT_SPWebApplicationAppDomain : OMI_BaseResource { - [Key, Description("The URL of the web application to set the app domain for")] string WebApplication; + [Key, Description("The URL of the web application to set the app domain for")] string WebAppUrl; [Key, Description("The zone that this app domain applies to"), ValueMap{"Default","Internet","Intranet","Extranet","Custom"}, Values{"Default","Internet","Intranet","Extranet","Custom"}] string Zone; [Required, Description("The domain for apps in this web app zone")] string AppDomain; [Write, Description("The port to run apps on")] string Port; diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/readme.md index 89f9625af..700fb4a23 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationAppDomain/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource will configure the App Domain at a specific zone for the given Web Application. The configuration is done per zone on the specified web diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationExtension/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationExtension/readme.md index eba0b6a38..fb402a451 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationExtension/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWebApplicationExtension/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is responsible for extending an existing web application into a new zone. The resource will provision the web application extension with all of diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWordAutomationServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWordAutomationServiceApp/readme.md index 485c4daf1..bf567cf4a 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWordAutomationServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWordAutomationServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No The resource is able to provision, unprovision and configure the Word Automation Service Application. All settings that you can configure on the diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/MSFT_SPWorkManagementServiceApp.psm1 b/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/MSFT_SPWorkManagementServiceApp.psm1 index 747629408..070300433 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/MSFT_SPWorkManagementServiceApp.psm1 +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/MSFT_SPWorkManagementServiceApp.psm1 @@ -56,7 +56,7 @@ function Get-TargetResource if ($installedVersion.FileMajorPart -eq 16) { throw [Exception] ("Work Management Service Application is no longer available " + ` - "in SharePoint 2016: " + ` + "in SharePoint 2016/2019: " + ` "https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx") } @@ -174,7 +174,7 @@ function Set-TargetResource if ($installedVersion.FileMajorPart -eq 16) { throw [Exception] ("Work Management Service Application is no longer available " + ` - "in SharePoint 2016: " + ` + "in SharePoint 2016/2019: " + ` "https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx") } @@ -387,7 +387,7 @@ function Test-TargetResource if ($installedVersion.FileMajorPart -eq 16) { throw [Exception] ("Work Management Service Application is no longer available " + ` - "in SharePoint 2016: " + ` + "in SharePoint 2016/2019: " + ` "https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx") } diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/readme.md index 47946fd97..66294e47e 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWorkManagementServiceApp/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to provision and manage an instance of the Work Management Services Service Application. It will identify an instance of the @@ -19,7 +20,7 @@ The default value for the Ensure parameter is Present. When not specifying this parameter, the service application is provisioned. NOTE: -You cannot use this resource with SharePoint 2016, since the Work -Management functionality has been removed in SharePoint 2016. +You cannot use this resource with SharePoint 2016/2019, since the Work +Management functionality has been removed in SharePoint 2016/2019. More information: https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx diff --git a/Modules/SharePointDsc/DSCResources/MSFT_SPWorkflowService/readme.md b/Modules/SharePointDsc/DSCResources/MSFT_SPWorkflowService/readme.md index 1a16a7bb9..0ae3c014b 100644 --- a/Modules/SharePointDsc/DSCResources/MSFT_SPWorkflowService/readme.md +++ b/Modules/SharePointDsc/DSCResources/MSFT_SPWorkflowService/readme.md @@ -1,6 +1,7 @@ # Description **Type:** Distributed +**Requires CredSSP:** No This resource is used to register the SharePoint Server against a Workflow Manager Instance. diff --git a/Modules/SharePointDsc/Examples/ProjectServer/ProjectServer.ps1 b/Modules/SharePointDsc/Examples/ProjectServer/ProjectServer.ps1 index af9fbc789..9b3506f98 100644 --- a/Modules/SharePointDsc/Examples/ProjectServer/ProjectServer.ps1 +++ b/Modules/SharePointDsc/Examples/ProjectServer/ProjectServer.ps1 @@ -21,6 +21,7 @@ Configuration Example SPInstallPrereqs InstallPrereqs { + IsSingleInstance = "Yes" Ensure = "Present" InstallerPath = "C:\binaries\prerequisiteinstaller.exe" OnlineMode = $true @@ -28,10 +29,11 @@ Configuration Example SPInstall InstallSharePoint { - Ensure = "Present" - BinaryDir = "C:\binaries\" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" - DependsOn = "[SPInstallPrereqs]InstallPrereqs" + IsSingleInstance = "Yes" + Ensure = "Present" + BinaryDir = "C:\binaries\" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + DependsOn = "[SPInstallPrereqs]InstallPrereqs" } #********************************************************** @@ -43,6 +45,7 @@ Configuration Example #********************************************************** SPFarm CreateSPFarm { + IsSingleInstance = "Yes" Ensure = "Present" DatabaseServer = "sql.contoso.com" FarmConfigDatabaseName = "SP_Config" @@ -70,6 +73,7 @@ Configuration Example } SPDiagnosticLoggingSettings ApplyDiagnosticLogSettings { + IsSingleInstance = "Yes" PsDscRunAsCredential = $SPSetupAccount LogPath = "C:\ULS" LogSpaceInGB = 5 @@ -134,7 +138,7 @@ Configuration Example ApplicationPoolAccount = $WebPoolManagedAccount.UserName AllowAnonymous = $false DatabaseName = "SP_Content" - Url = "http://sites.contoso.com" + WebAppUrl = "http://sites.contoso.com" HostHeader = "sites.contoso.com" Port = 80 PsDscRunAsCredential = $SPSetupAccount @@ -272,6 +276,7 @@ Configuration Example SPProjectServerLicense PWALicense { + IsSingleInstance = "Yes" Ensure = "Present" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" PsDscRunAsCredential = $SPSetupAccount diff --git a/Modules/SharePointDsc/Examples/Resources/SPAntivirusSettings/1-SetAntivirusConfig.ps1 b/Modules/SharePointDsc/Examples/Resources/SPAntivirusSettings/1-SetAntivirusConfig.ps1 index 72c2d7430..202ea6adf 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPAntivirusSettings/1-SetAntivirusConfig.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPAntivirusSettings/1-SetAntivirusConfig.ps1 @@ -3,7 +3,7 @@ This example shows how to apply specific anti-virus configuration to the farm #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,6 +15,7 @@ node localhost { SPAntivirusSettings AVSettings { + IsSingleInstance = "Yes" ScanOnDownload = $true ScanOnUpload = $true AllowDownloadInfected = $false diff --git a/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/1-RunConfigWizard.ps1 b/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/1-RunConfigWizard.ps1 index 549cbe912..637c90cf0 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/1-RunConfigWizard.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/1-RunConfigWizard.ps1 @@ -3,7 +3,7 @@ This example runs the Configuration Wizard as soon as it is applied. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,7 +15,7 @@ node localhost { SPConfigWizard RunConfigWizard { - Ensure = "Present" + IsSingleInstance = "Yes" PsDscRunAsCredential = $SetupAccount } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/2-RunConfigWizardInWindow.ps1 b/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/2-RunConfigWizardInWindow.ps1 index 3f6e431ed..a36a73944 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/2-RunConfigWizardInWindow.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPConfigWizard/2-RunConfigWizardInWindow.ps1 @@ -4,7 +4,7 @@ - Saturday and Sunday night between 3am and 5am. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ node localhost { SPConfigWizard RunConfigWizard { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sat", "sun" DatabaseUpgradeTime = "3:00am to 5:00am" PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/Examples/Resources/SPDesignerSettings/1-ApplyDesignerConfig.ps1 b/Modules/SharePointDsc/Examples/Resources/SPDesignerSettings/1-ApplyDesignerConfig.ps1 index 6e4423980..670bf0578 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPDesignerSettings/1-ApplyDesignerConfig.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPDesignerSettings/1-ApplyDesignerConfig.ps1 @@ -1,10 +1,10 @@ <# .EXAMPLE - This example applies settings to disable SharePoint Designer access to the + This example applies settings to disable SharePoint Designer access to the specified web application. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ node localhost { SPDesignerSettings MainWebAppSPDSettings { - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "WebApplication" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false diff --git a/Modules/SharePointDsc/Examples/Resources/SPDiagnosticLoggingSettings/1-ApplyLoggingSettings.ps1 b/Modules/SharePointDsc/Examples/Resources/SPDiagnosticLoggingSettings/1-ApplyLoggingSettings.ps1 index d9d026363..4bfff07f1 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPDiagnosticLoggingSettings/1-ApplyLoggingSettings.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPDiagnosticLoggingSettings/1-ApplyLoggingSettings.ps1 @@ -5,7 +5,7 @@ whatever value has been manually configured outside of DSC. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -17,7 +17,7 @@ node localhost { SPDiagnosticLoggingSettings ApplyDiagnosticLogSettings { - PsDscRunAsCredential = $SetupAccount + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $false @@ -36,6 +36,7 @@ ScriptErrorReportingDelay = 30 ScriptErrorReportingEnabled = $true ScriptErrorReportingRequireAuth = $true + PsDscRunAsCredential = $SetupAccount } } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPFarm/1-CreateBasicFarm.ps1 b/Modules/SharePointDsc/Examples/Resources/SPFarm/1-CreateBasicFarm.ps1 index ded8f6381..e43f477d6 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPFarm/1-CreateBasicFarm.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPFarm/1-CreateBasicFarm.ps1 @@ -6,7 +6,7 @@ example is provisioned to port 9999 using NTLM authentication. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -26,7 +26,7 @@ node localhost { SPFarm SharePointFarm { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" FarmConfigDatabaseName = "SP_Config" AdminContentDatabaseName = "SP_AdminContent" diff --git a/Modules/SharePointDsc/Examples/Resources/SPFarm/2-CreateCustomCentralAdmin.ps1 b/Modules/SharePointDsc/Examples/Resources/SPFarm/2-CreateCustomCentralAdmin.ps1 index 4dbe64daa..8f985676f 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPFarm/2-CreateCustomCentralAdmin.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPFarm/2-CreateCustomCentralAdmin.ps1 @@ -6,7 +6,7 @@ run on, as well as the authentication mode for the site are also specified. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -26,7 +26,7 @@ node localhost { SPFarm SharePointFarm { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" FarmConfigDatabaseName = "SP_Config" AdminContentDatabaseName = "SP_AdminContent" diff --git a/Modules/SharePointDsc/Examples/Resources/SPFarm/3-CreateFarmWithServerRole.ps1 b/Modules/SharePointDsc/Examples/Resources/SPFarm/3-CreateFarmWithServerRole.ps1 index 245a87450..d63e5f2fc 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPFarm/3-CreateFarmWithServerRole.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPFarm/3-CreateFarmWithServerRole.ps1 @@ -1,15 +1,15 @@ <# -.EXAMPLE +.EXAMPLE This example shows how a basic SharePoint farm can be created. The database server and names are specified, and the accounts to run the setup as, the farm account and the passphrase are all passed in to the configuration to be applied. By default the central admin site in this example is provisioned to port 9999 using NTLM authentication. In this example we also see - the server role defined as "Application" which tells SharePoint 2016 the role to apply to + the server role defined as "Application" which tells SharePoint 2016/2019 the role to apply to this server as soon as the farm is created. This property is not supported for SharePoint 2013 and so this specific example would fail if used against that verison. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -29,7 +29,7 @@ node localhost { SPFarm SharePointFarm { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" FarmConfigDatabaseName = "SP_Config" AdminContentDatabaseName = "SP_AdminContent" diff --git a/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/1-SetSpecificAdmins.ps1 b/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/1-SetSpecificAdmins.ps1 index fc87b95d8..73fe291d9 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/1-SetSpecificAdmins.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/1-SetSpecificAdmins.ps1 @@ -1,10 +1,10 @@ <# .EXAMPLE This example shows how to set a specific list of members for the farm admins group. - Any members not in this list will be removed. + Any members not in this list will be removed. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ node localhost { SPFarmAdministrators LocalFarmAdmins { - Name = "Farm Administrators" + IsSingleInstance = "Yes" Members = @("CONTOSO\user1", "CONTOSO\user2") PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/2-SetIncludeExcludeAdmins.ps1 b/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/2-SetIncludeExcludeAdmins.ps1 index dc7232bc3..79613d80a 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/2-SetIncludeExcludeAdmins.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPFarmAdministrators/2-SetIncludeExcludeAdmins.ps1 @@ -6,7 +6,7 @@ in either of these properties are left alone. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -18,7 +18,7 @@ node localhost { SPFarmAdministrators LocalFarmAdmins { - Name = "Farm Administrators" + IsSingleInstance = "Yes" MembersToInclude = @("CONTOSO\user1") MembersToExclude = @("CONTOSO\user2") PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/Examples/Resources/SPFarmSolution/1-DeploySolution.ps1 b/Modules/SharePointDsc/Examples/Resources/SPFarmSolution/1-DeploySolution.ps1 index e061e37ad..12ba4881b 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPFarmSolution/1-DeploySolution.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPFarmSolution/1-DeploySolution.ps1 @@ -1,9 +1,9 @@ <# .EXAMPLE - This example shows how to deploy a WSP to specific web applications. + This example shows how to deploy a WSP to specific web applications. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -19,7 +19,7 @@ LiteralPath = "C:\src\MySolution.wsp" Ensure = "Present" Version = "1.0.0" - WebApplications = @("http://collaboration", "http://mysites") + WebAppUrls = @("http://collaboration", "http://mysites") PsDscRunAsCredential = $SetupAccount } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPInfoPathFormsServiceConfig/1-Configure.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInfoPathFormsServiceConfig/1-Configure.ps1 index fa2cd4b79..b31388cc1 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInfoPathFormsServiceConfig/1-Configure.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInfoPathFormsServiceConfig/1-Configure.ps1 @@ -16,7 +16,7 @@ node localhost { SPInfoPathFormsServiceConfig InfoPathFormsServiceConfig { - Ensure = "Present" + IsSingleInstance = "Yes" AllowUserFormBrowserEnabling = $true AllowUserFormBrowserRendering = $true MaxDataConnectionTimeout = 20000 diff --git a/Modules/SharePointDsc/Examples/Resources/SPInstall/1-InstallToDefaultPath.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInstall/1-InstallToDefaultPath.ps1 index dae1960a0..ca8fd8583 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInstall/1-InstallToDefaultPath.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInstall/1-InstallToDefaultPath.ps1 @@ -5,7 +5,7 @@ C:\SPInstall\Setup.exe) #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -17,8 +17,9 @@ node localhost { SPInstall InstallBinaries { - BinaryDir = "C:\SPInstall" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + BinaryDir = "C:\SPInstall" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPInstall/2-InstallToCustomPath.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInstall/2-InstallToCustomPath.ps1 index 9f4c1c11e..77e37845b 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInstall/2-InstallToCustomPath.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInstall/2-InstallToCustomPath.ps1 @@ -1,10 +1,10 @@ <# .EXAMPLE This module will install SharePoint to the specific locations set for the - InstallPath and DataPath directories. + InstallPath and DataPath directories. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,10 +16,11 @@ node localhost { SPInstall InstallBinaries { - BinaryDir = "D:\SharePoint\Binaries" - InstallPath = "D:\SharePoint\Install" - DataPath = "D:\SharePoint\Data" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + BinaryDir = "D:\SharePoint\Binaries" + InstallPath = "D:\SharePoint\Install" + DataPath = "D:\SharePoint\Data" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPInstall/3-InstallSPFoundation.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInstall/3-InstallSPFoundation.ps1 index 0d79b1bf3..02456ce38 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInstall/3-InstallSPFoundation.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInstall/3-InstallSPFoundation.ps1 @@ -3,7 +3,7 @@ This module will install SharePoint Foundation 2013 to the local server #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] diff --git a/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/1-OnlineInstall.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/1-OnlineInstall.ps1 index b99e0155e..2ccc74cc8 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/1-OnlineInstall.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/1-OnlineInstall.ps1 @@ -4,7 +4,7 @@ online mode, looking to download all prerequisites from the internet. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,6 +16,7 @@ node localhost { SPInstallPrereqs InstallPrerequisites { + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true } diff --git a/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/2-OfflineInstall_SP2013.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/2-OfflineInstall_SP2013.ps1 index 2833bc7e0..1de135724 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/2-OfflineInstall_SP2013.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/2-OfflineInstall_SP2013.ps1 @@ -4,7 +4,7 @@ offline mode, running all prerequisite installations from the specified paths. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,6 +16,7 @@ node localhost { SPInstallPrereqs InstallPrerequisites { + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false SXSpath = "c:\SPInstall\Windows2012r2-SXS" diff --git a/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/3-OfflineInstall_SP2016.ps1 b/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/3-OfflineInstall_SP2016.ps1 index e97450513..5422e027e 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/3-OfflineInstall_SP2016.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPInstallPrereqs/3-OfflineInstall_SP2016.ps1 @@ -1,6 +1,6 @@ <# .EXAMPLE - This module will install the prerequisites for SharePoint 2016. This resource will run in + This module will install the prerequisites for SharePoint 2016/2019. This resource will run in offline mode, running all prerequisite installations from the specified paths. #> @@ -16,6 +16,7 @@ node localhost { SPInstallPrereqs InstallPrerequisites { + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false SXSpath = "C:\SPInstall\Windows2012r2-SXS" diff --git a/Modules/SharePointDsc/Examples/Resources/SPIrmSettings/1-ApplyIRMSConfig.ps1 b/Modules/SharePointDsc/Examples/Resources/SPIrmSettings/1-ApplyIRMSConfig.ps1 index 3d93190c2..f86d1ab3b 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPIrmSettings/1-ApplyIRMSConfig.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPIrmSettings/1-ApplyIRMSConfig.ps1 @@ -4,7 +4,7 @@ a specific RMS server #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ node localhost { SPIrmSettings RMSSettings { - Ensure = "Present" + IsSingleInstance = "Yes" RMSserver = "https://rms.contoso.com" PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPMinRoleCompliance/1-EnsureCompliance.ps1 b/Modules/SharePointDsc/Examples/Resources/SPMinRoleCompliance/1-EnsureCompliance.ps1 index d15923002..69c8e3b41 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPMinRoleCompliance/1-EnsureCompliance.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPMinRoleCompliance/1-EnsureCompliance.ps1 @@ -3,7 +3,7 @@ This example shows how to ensure the farm is always compliant with MinRole settings #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -13,8 +13,9 @@ Import-DscResource -ModuleName SharePointDsc node localhost { - SPMinRoleCompliance MinRoleCompliance + SPMinRoleCompliance MinRoleCompliance { + IsSingleInstance = "Yes" State = "Compliant" PSDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPPasswordChangeSettings/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPPasswordChangeSettings/1-Example.ps1 index 634274b10..12eaa05a9 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPPasswordChangeSettings/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPPasswordChangeSettings/1-Example.ps1 @@ -3,7 +3,7 @@ This example sets the password change settings for managed accounts in the local farm #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,7 +15,8 @@ node localhost { SPPasswordChangeSettings ManagedAccountPasswordResetSettings { - MailAddress = "sharepoint`@contoso.com" + IsSingleInstance = "Yes" + MailAddress = "sharepoint@contoso.com" DaysBeforeExpiry = "14" PasswordChangeWaitTimeSeconds = "60" NumberOfRetries = "3" diff --git a/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/1-EnableProjectServer.ps1 b/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/1-EnableProjectServer.ps1 index 1b2f7c39e..d5e33f909 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/1-EnableProjectServer.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/1-EnableProjectServer.ps1 @@ -3,7 +3,7 @@ This example enables Project Server in the current environment #> -Configuration Example +Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,7 +15,7 @@ Configuration Example node localhost { SPProjectServerLicense ProjectLicense { - Ensure = "Present" + IsSingleInstance = "Yes" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/2-DisableProjectServer.ps1 b/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/2-DisableProjectServer.ps1 index 88bd39532..5f50d306e 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/2-DisableProjectServer.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPProjectServerLicense/2-DisableProjectServer.ps1 @@ -3,7 +3,7 @@ This example disables Project Server in the current environment #> -Configuration Example +Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,6 +15,7 @@ Configuration Example node localhost { SPProjectServerLicense ProjectLicense { + IsSingleInstance = "Yes" Ensure = "Absent" PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPSearchMetadataCategory/1-EnsureMetadataCategory.ps1 b/Modules/SharePointDsc/Examples/Resources/SPSearchMetadataCategory/1-EnsureMetadataCategory.ps1 new file mode 100644 index 000000000..f2690f071 --- /dev/null +++ b/Modules/SharePointDsc/Examples/Resources/SPSearchMetadataCategory/1-EnsureMetadataCategory.ps1 @@ -0,0 +1,27 @@ +<# +.EXAMPLE + This example shows how to create a new Search Metadata Category, using the required parameters +#> + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPSearchMetadataCategory NewCategory + { + Name = "My New category" + ServiceAppName = "Search Service Application" + AutoCreateNewManagedProperties = $true + DiscoverNewProperties = $true + MapToContents = $true + Ensure = "Present" + PsDscRunAsCredential = $SetupAccount + } + } + } diff --git a/Modules/SharePointDsc/Examples/Resources/SPSearchResultSource/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPSearchResultSource/1-Example.ps1 index cd3f38f77..ea2bd7a84 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPSearchResultSource/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPSearchResultSource/1-Example.ps1 @@ -3,7 +3,7 @@ This example shows how to create a remote sharepoint search result source #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -11,11 +11,13 @@ $SetupAccount ) Import-DscResource -ModuleName SharePointDsc - + node localhost { SPSearchResultSource RemoteSharePointFarm { Name = "External SharePoint results" + ScopeName = "SPSite" + ScopeUrl = "https://SharePoint.contoso.com" SearchServiceAppName = "Search Service Application" Query = "{searchTerms}" ProviderType = "Remote SharePoint Provider" diff --git a/Modules/SharePointDsc/Examples/Resources/SPSecurityTokenServiceConfig/1-SetConfiguration.ps1 b/Modules/SharePointDsc/Examples/Resources/SPSecurityTokenServiceConfig/1-SetConfiguration.ps1 index 196cf57ba..f5bb0642c 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPSecurityTokenServiceConfig/1-SetConfiguration.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPSecurityTokenServiceConfig/1-SetConfiguration.ps1 @@ -3,7 +3,7 @@ This example configures the Security Token Service #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,6 +15,7 @@ node localhost { SPSecurityTokenServiceConfig SecurityTokenService { + IsSingleInstance = "Yes" Name = "SPSecurityTokenService" NameIdentifier = "00000003-0000-0ff1-ce00-000000000000@9f11c5ea-2df9-4950-8dcf-da8cd7aa4eff" UseSessionCookies = $false diff --git a/Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/1-EnableSelfServiceSiteCreation.ps1 b/Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/1-EnableSelfServiceSiteCreation.ps1 similarity index 92% rename from Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/1-EnableSelfServiceSiteCreation.ps1 rename to Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/1-EnableSelfServiceSiteCreation.ps1 index 528f22e2d..1455c596a 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/1-EnableSelfServiceSiteCreation.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/1-EnableSelfServiceSiteCreation.ps1 @@ -15,7 +15,7 @@ node localhost { SPSelfServiceSiteCreation SSC { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" Enabled = $true OnlineEnabled = $false QuotaTemplate = "SSCQoutaTemplate" diff --git a/Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/2-EnableSelfServiceSiteCreationCustomForm.ps1 b/Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/2-EnableSelfServiceSiteCreationCustomForm.ps1 similarity index 91% rename from Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/2-EnableSelfServiceSiteCreationCustomForm.ps1 rename to Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/2-EnableSelfServiceSiteCreationCustomForm.ps1 index 1ff456e07..d06858bd8 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/2-EnableSelfServiceSiteCreationCustomForm.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/2-EnableSelfServiceSiteCreationCustomForm.ps1 @@ -15,7 +15,7 @@ node localhost { SPSelfServiceSiteCreation SSC { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" Enabled = $true ShowStartASiteMenuItem = $true CustomFormUrl = "http://ssc.contoso.com.local/ssc" diff --git a/Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/3-DisableSelfServiceSiteCreation.ps1 b/Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/3-DisableSelfServiceSiteCreation.ps1 similarity index 89% rename from Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/3-DisableSelfServiceSiteCreation.ps1 rename to Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/3-DisableSelfServiceSiteCreation.ps1 index 3ed39d31e..ffd4b2cf8 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPSPSelfServiceSiteCreation/3-DisableSelfServiceSiteCreation.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPSelfServiceSiteCreation/3-DisableSelfServiceSiteCreation.ps1 @@ -15,7 +15,7 @@ node localhost { SPSelfServiceSiteCreation SSC { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" Enabled = $false PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/1-Example.ps1 index aa02f2099..6d9baed72 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/1-Example.ps1 @@ -1,11 +1,12 @@ <# .EXAMPLE - This example shows how full control permission can be given to the farm - account and service app pool account to the user profile service app's + This example shows how full control permission can be given to the farm + account and service app pool account to the user profile service app's sharing permission. + It also shows granting access to specific areas to a user. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -17,12 +18,16 @@ node localhost { $membersToInclude = @() $membersToInclude += MSFT_SPServiceAppSecurityEntry { - Username = "CONTOSO\SharePointFarmAccount" - AccessLevel = "Full Control" + Username = "CONTOSO\SharePointFarmAccount" + AccessLevels = @("Full Control") } $membersToInclude += MSFT_SPServiceAppSecurityEntry { - Username = "CONTOSO\SharePointServiceApps" - AccessLevel = "Full Control" + Username = "CONTOSO\SharePointServiceApps" + AccessLevels = @("Full Control") + } + $membersToInclude += MSFT_SPServiceAppSecurityEntry { + Username = "CONTOSO\User1" + AccessLevels = @("Manage Profiles", "Manage Social Data") } SPServiceAppSecurity UserProfileServiceSecurity { @@ -30,7 +35,7 @@ SecurityType = "SharingPermissions" MembersToInclude = $membersToInclude MembersToExclude = @("CONTOSO\BadAccount1", "CONTOSO\BadAccount2") - PsDscRunAsCredential = $SetupAccount + PsDscRunAsCredential = $SetupAccount } } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/2-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/2-Example.ps1 index 9c21890e8..f33400b24 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/2-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/2-Example.ps1 @@ -1,11 +1,11 @@ <# .EXAMPLE - This example shows how to use the local farm token to grant - full control permission to the local farm to the + This example shows how to use the local farm token to grant + full control permission to the local farm to the user profile service app's sharing permission. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -17,15 +17,15 @@ node localhost { $members = @() $members += MSFT_SPServiceAppSecurityEntry { - Username = "{LocalFarm}" - AccessLevel = "Full Control" + Username = "{LocalFarm}" + AccessLevels = @("Full Control") } SPServiceAppSecurity UserProfileServiceSecurity { ServiceAppName = "User Profile Service Application" SecurityType = "SharingPermissions" Members = $members - PsDscRunAsCredential = $SetupAccount + PsDscRunAsCredential = $SetupAccount } } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/1-FarmAdmins.ps1 b/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/1-FarmAdmins.ps1 index b6e0b18d6..0303b64d8 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/1-FarmAdmins.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/1-FarmAdmins.ps1 @@ -4,7 +4,7 @@ all content databases in the local farm. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,9 +16,9 @@ node localhost { SPShellAdmins ShellAdmins { - Name = "Shell Admins" - Members = "CONTOSO\user1", "CONTOSO\user2" - AllDatabases = $true + IsSingleInstance = "Yes" + Members = "CONTOSO\user1", "CONTOSO\user2" + AllDatabases = $true } } } diff --git a/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/2-SpecificDBs.ps1 b/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/2-SpecificDBs.ps1 index 821de6c76..e18e7d066 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/2-SpecificDBs.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/2-SpecificDBs.ps1 @@ -4,7 +4,7 @@ all content databases in the local farm. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,9 +16,9 @@ node localhost { SPShellAdmins ShellAdmins { - Name = "Shell Admins" - Members = "CONTOSO\user1", "CONTOSO\user2" - Databases = @( + IsSingleInstance = "Yes" + Members = "CONTOSO\user1", "CONTOSO\user2" + Databases = @( @(MSFT_SPDatabasePermissions { Name = "SharePoint_Content_1" Members = "CONTOSO\user2", "CONTOSO\user3" diff --git a/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/3-ExcludeDatabases.ps1 b/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/3-ExcludeDatabases.ps1 index 06a016404..d888bb74a 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/3-ExcludeDatabases.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPShellAdmins/3-ExcludeDatabases.ps1 @@ -17,7 +17,7 @@ node localhost { SPShellAdmins ShellAdmins { - Name = "Shell Admins" + IsSingleInstance = "Yes" Members = "CONTOSO\user1", "CONTOSO\user2" AllDatabases = $true ExcludeDatabases = "WSS_Content_Portal" diff --git a/Modules/SharePointDsc/Examples/Resources/SPUserProfileProperty/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPUserProfileProperty/1-Example.ps1 index eff2fd4f1..97edd589d 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPUserProfileProperty/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPUserProfileProperty/1-Example.ps1 @@ -4,42 +4,47 @@ app #> - Configuration Example - { - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $SetupAccount - ) - Import-DscResource -ModuleName SharePointDsc +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc - node localhost { - SPUserProfileProperty WorkEmailProperty - { - Name = "WorkEmail2" - Ensure = "Present" - UserProfileService = "User Profile Service Application" - DisplayName = "Work Email" - Type = "Email" - Description = "" #implementation isn't using it yet - PolicySetting = "Mandatory" - PrivacySetting = "Public" - MappingConnectionName = "contoso.com" - MappingPropertyName = "mail" - MappingDirection = "Import" - Length = 10 - DisplayOrder =25 - IsEventLog =$false - IsVisibleOnEditor=$true - IsVisibleOnViewer = $true - IsUserEditable = $true - IsAlias = $false - IsSearchable = $false - TermStore = "" - TermGroup = "" - TermSet = "" - UserOverridePrivacy = $false - PsDscRunAsCredential = $SetupAccount - } + node localhost { + + SPUserProfileProperty WorkEmailProperty + { + Name = "WorkEmail2" + Ensure = "Present" + UserProfileService = "User Profile Service Application" + DisplayName = "Work Email" + Type = "Email" + Description = "" #implementation isn't using it yet + PolicySetting = "Mandatory" + PrivacySetting = "Public" + PropertyMappings = @( + MSFT_SPUserProfilePropertyMapping { + ConnectionName = "contoso.com" + PropertyName = "mail" + Direction = "Import" + } + ) + Length = 10 + DisplayOrder = 25 + IsEventLog = $false + IsVisibleOnEditor = $true + IsVisibleOnViewer = $true + IsUserEditable = $true + IsAlias = $false + IsSearchable = $false + TermStore = "" + TermGroup = "" + TermSet = "" + UserOverridePrivacy = $false + PsDscRunAsCredential = $SetupAccount } } +} diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/1-Inclusion.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/1-Inclusion.ps1 index bfe1bc1c4..ed527d3b5 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/1-Inclusion.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/1-Inclusion.ps1 @@ -1,11 +1,11 @@ <# .EXAMPLE - This example shows how to ensure that specific file types are always blocked while + This example shows how to ensure that specific file types are always blocked while others will always be allowed. Any file types not mentioned in this config will be able to be managed manually. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -17,7 +17,7 @@ node localhost { SPWebAppBlockedFileTypes PrimaryWebAppBlockedFileTypes { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" EnsureBlocked = @("exe", "dll", "msi") EnsureAllowed = @("pdf", "docx", "xlsx") PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/2-SpecificList.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/2-SpecificList.ps1 index e05e3dc53..4c21e96d7 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/2-SpecificList.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppBlockedFileTypes/2-SpecificList.ps1 @@ -4,7 +4,7 @@ specifically matches this list. #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ node localhost { SPWebAppBlockedFileTypes PrimaryWebAppBlockedFileTypes { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" Blocked = @("exe", "dll", "msi") PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/1-SetClientCallableSettings.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/1-SetClientCallableSettings.ps1 index c619eefff..1c71446dc 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/1-SetClientCallableSettings.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/1-SetClientCallableSettings.ps1 @@ -15,7 +15,7 @@ node localhost { SPWebAppClientCallableSettings DefaultClientCallableSettings { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" MaxResourcesPerRequest = 16 MaxObjectPaths = 256 ExecutionTimeout = 90 diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/2-EnableTenantAdministration.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/2-EnableTenantAdministration.ps1 index f8ac1d81f..4fb80e698 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/2-EnableTenantAdministration.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/2-EnableTenantAdministration.ps1 @@ -21,7 +21,7 @@ SPWebAppClientCallableSettings TenantAdministration { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" ProxyLibraries = $proxyLibraries PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppGeneralSettings/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppGeneralSettings/1-Example.ps1 index 42e925cdd..5c5f8fe37 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppGeneralSettings/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppGeneralSettings/1-Example.ps1 @@ -1,10 +1,10 @@ <# .EXAMPLE - This example shows how to apply some of the available general settings to the + This example shows how to apply some of the available general settings to the specified web app #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ node localhost { SPWebAppGeneralSettings PrimaryWebAppGeneralSettings { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" TimeZone = 76 Alerts = $true RSS = $false diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppSiteUseAndDeletion/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppSiteUseAndDeletion/1-Example.ps1 index 682195a4c..30c25bf69 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppSiteUseAndDeletion/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppSiteUseAndDeletion/1-Example.ps1 @@ -15,7 +15,7 @@ node localhost { SPWebAppSiteUseAndDeletion ConfigureSiteUseAndDeletion { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppSuiteBar/1-ApplySuiteBarBranding2016.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppSuiteBar/1-ApplySuiteBarBranding2016.ps1 index 6d99b3cb4..9930403d0 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppSuiteBar/1-ApplySuiteBarBranding2016.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppSuiteBar/1-ApplySuiteBarBranding2016.ps1 @@ -1,7 +1,7 @@ <# .EXAMPLE This example sets the branding for the suite bar of a given - Web Application in SharePoint 2016. + Web Application in SharePoint 2016/2019. #> Configuration Example diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppThrottlingSettings/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppThrottlingSettings/1-Example.ps1 index 46c6928fa..716310194 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppThrottlingSettings/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppThrottlingSettings/1-Example.ps1 @@ -3,7 +3,7 @@ This example shows how to apply throttling settings to a specific web app #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,7 +15,7 @@ node localhost { SPWebAppThrottlingSettings PrimaryWebAppThrottlingSettings { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" ListViewThreshold = 5000 AllowObjectModelOverride = $false HappyHourEnabled = $true diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebAppWorkflowSettings/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebAppWorkflowSettings/1-Example.ps1 index 3c4a62fe7..85ba0d93b 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebAppWorkflowSettings/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebAppWorkflowSettings/1-Example.ps1 @@ -3,7 +3,7 @@ This example shows how to apply workflow settings to the specific web application #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -15,7 +15,7 @@ node localhost { SPWebAppWorkflowSettings PrimaryWebAppWorkflowSettings { - Url = "Shttp://exmaple.contoso.local" + WebAppUrl = "Shttp://exmaple.contoso.local" ExternalWorkflowParticipantsEnabled = $false EmailToNoPermissionWorkflowParticipantsEnable = $false PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebApplication/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebApplication/1-Example.ps1 index bb3decc06..3119cfd20 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebApplication/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebApplication/1-Example.ps1 @@ -21,7 +21,7 @@ AllowAnonymous = $false DatabaseName = "SP_Content_01" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" Port = 80 Ensure = "Present" PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/Examples/Resources/SPWebApplicationAppDomain/1-Example.ps1 b/Modules/SharePointDsc/Examples/Resources/SPWebApplicationAppDomain/1-Example.ps1 index 09096388f..8440128a6 100644 --- a/Modules/SharePointDsc/Examples/Resources/SPWebApplicationAppDomain/1-Example.ps1 +++ b/Modules/SharePointDsc/Examples/Resources/SPWebApplicationAppDomain/1-Example.ps1 @@ -3,7 +3,7 @@ This example shows how to set the app domain for a specified web application #> - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -16,7 +16,7 @@ SPWebApplicationAppDomain Domain { AppDomain = "contosointranetapps.com" - WebApplication ="http://portal.contoso.com"; + WebAppUrl ="http://portal.contoso.com"; Zone = "Default"; Port = 80; SSL = $false; diff --git a/Modules/SharePointDsc/Examples/Single Server/SharePoint.ps1 b/Modules/SharePointDsc/Examples/Single Server/SharePoint.ps1 index fb4aff938..5663a5f9e 100644 --- a/Modules/SharePointDsc/Examples/Single Server/SharePoint.ps1 +++ b/Modules/SharePointDsc/Examples/Single Server/SharePoint.ps1 @@ -20,16 +20,18 @@ Configuration Example #********************************************************** SPInstallPrereqs InstallPrereqs { + IsSingleInstance = "Yes" Ensure = "Present" InstallerPath = "C:\binaries\prerequisiteinstaller.exe" OnlineMode = $true } SPInstall InstallSharePoint { - Ensure = "Present" - BinaryDir = "C:\binaries\" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" - DependsOn = "[SPInstallPrereqs]InstallPrereqs" + IsSingleInstance = "Yes" + Ensure = "Present" + BinaryDir = "C:\binaries\" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + DependsOn = "[SPInstallPrereqs]InstallPrereqs" } #********************************************************** @@ -41,6 +43,7 @@ Configuration Example #********************************************************** SPFarm CreateSPFarm { + IsSingleInstance = "Yes" Ensure = "Present" DatabaseServer = "sql.contoso.com" FarmConfigDatabaseName = "SP_Config" @@ -67,6 +70,7 @@ Configuration Example } SPDiagnosticLoggingSettings ApplyDiagnosticLogSettings { + IsSingleInstance = "Yes" PsDscRunAsCredential = $SPSetupAccount LogPath = "C:\ULS" LogSpaceInGB = 5 @@ -131,7 +135,7 @@ Configuration Example ApplicationPoolAccount = $WebPoolManagedAccount.UserName AllowAnonymous = $false DatabaseName = "SP_Content" - Url = "http://sites.contoso.com" + WebAppUrl = "http://sites.contoso.com" HostHeader = "sites.contoso.com" Port = 80 PsDscRunAsCredential = $SPSetupAccount diff --git a/Modules/SharePointDsc/Examples/Small Farm/SharePoint.ps1 b/Modules/SharePointDsc/Examples/Small Farm/SharePoint.ps1 index 9b8e92576..dbcbd70c9 100644 --- a/Modules/SharePointDsc/Examples/Small Farm/SharePoint.ps1 +++ b/Modules/SharePointDsc/Examples/Small Farm/SharePoint.ps1 @@ -33,16 +33,18 @@ Configuration Example #********************************************************** SPInstallPrereqs InstallPrereqs { + IsSingleInstance = "Yes" Ensure = "Present" InstallerPath = "C:\binaries\prerequisiteinstaller.exe" OnlineMode = $true } SPInstall InstallSharePoint { - Ensure = "Present" - BinaryDir = "C:\binaries\" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" - DependsOn = "[SPInstallPrereqs]InstallPrereqs" + IsSingleInstance = "Yes" + Ensure = "Present" + BinaryDir = "C:\binaries\" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + DependsOn = "[SPInstallPrereqs]InstallPrereqs" } #********************************************************** @@ -54,6 +56,7 @@ Configuration Example #********************************************************** SPFarm CreateSPFarm { + IsSingleInstance = "Yes" Ensure = "Present" DatabaseServer = "sql.contoso.com" FarmConfigDatabaseName = "SP_Config" @@ -80,6 +83,7 @@ Configuration Example } SPDiagnosticLoggingSettings ApplyDiagnosticLogSettings { + IsSingleInstance = "Yes" PsDscRunAsCredential = $SPSetupAccount LogPath = "C:\ULS" LogSpaceInGB = 5 @@ -144,7 +148,7 @@ Configuration Example ApplicationPoolAccount = $WebPoolManagedAccount.UserName AllowAnonymous = $false DatabaseName = "SP_Content" - Url = "http://sites.contoso.com" + WebAppUrl = "http://sites.contoso.com" HostHeader = "sites.contoso.com" Port = 80 PsDscRunAsCredential = $SPSetupAccount @@ -277,16 +281,18 @@ Configuration Example #********************************************************** SPInstallPrereqs InstallPrereqs { + IsSingleInstance = "Yes" Ensure = "Present" InstallerPath = "C:\binaries\prerequisiteinstaller.exe" OnlineMode = $true } SPInstall InstallSharePoint { - Ensure = "Present" - BinaryDir = "C:\binaries\" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" - DependsOn = "[SPInstallPrereqs]InstallPrereqs" + IsSingleInstance = "Yes" + Ensure = "Present" + BinaryDir = "C:\binaries\" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + DependsOn = "[SPInstallPrereqs]InstallPrereqs" } #********************************************************** @@ -298,6 +304,7 @@ Configuration Example #********************************************************** SPFarm JoinSPFarm { + IsSingleInstance = "Yes" Ensure = "Present" DatabaseServer = "sql.contoso.com" FarmConfigDatabaseName = "SP_Config" diff --git a/Modules/SharePointDsc/Modules/SharePointDsc.Farm/SPFarm.psm1 b/Modules/SharePointDsc/Modules/SharePointDsc.Farm/SPFarm.psm1 index c0016716d..94130d151 100644 --- a/Modules/SharePointDsc/Modules/SharePointDsc.Farm/SPFarm.psm1 +++ b/Modules/SharePointDsc/Modules/SharePointDsc.Farm/SPFarm.psm1 @@ -84,6 +84,62 @@ function Get-SPDSCConfigDBStatus .SYNOPSIS +Get-SPDSCSQLInstanceStatus is used to determine the state of the SQL instance + +.DESCRIPTION + +Get-SPDSCSQLInstanceStatus will determine the state of the MaxDOP setting. This +value is used by the SPFarm resource to determine if the SQL instance is ready +for SharePoint deployment. + +.PARAMETER SQLServer + +The name of the SQL server to check against + +.EXAMPLE + +Get-SPDSCConfigDBStatus -SQLServer sql.contoso.com + +#> +function Get-SPDSCSQLInstanceStatus +{ + param( + [Parameter(Mandatory = $true)] + [String] + $SQLServer + ) + + $connection = New-Object -TypeName "System.Data.SqlClient.SqlConnection" + $connection.ConnectionString = "Server=$SQLServer;Integrated Security=SSPI;Database=Master" + $command = New-Object -TypeName "System.Data.SqlClient.SqlCommand" + + try + { + $currentUser = ([Security.Principal.WindowsIdentity]::GetCurrent()).Name + $connection.Open() + $command.Connection = $connection + + $command.CommandText = "SELECT value_in_use FROM sys.configurations WHERE name = 'max degree of parallelism'" + $maxDOPCorrect = ($command.ExecuteScalar() -eq 1) + + return @{ + MaxDOPCorrect = $maxDOPCorrect + } + } + finally + { + if ($connection.State -eq "Open") + { + $connection.Close() + $connection.Dispose() + } + } +} + +<# + +.SYNOPSIS + Add-SPDSCConfigDBLock is used to create a lock to tell other servers that the config DB is currently provisioning diff --git a/Modules/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 b/Modules/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 index 8073a8fa7..f3e9433e7 100644 --- a/Modules/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 +++ b/Modules/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 @@ -114,6 +114,17 @@ function Get-SPDSCAssemblyVersion return (Get-Command $PathToAssembly).FileVersionInfo.FileMajorPart } +function Get-SPDSCBuildVersion +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true,Position=1)] + [string] + $PathToAssembly + ) + return (Get-Command $PathToAssembly).FileVersionInfo.FileBuildPart +} function Get-SPDscFarmAccount { @@ -194,7 +205,8 @@ function Get-SPDscFarmVersionInfo ($patchableUnit -notmatch "OMUI") -and ($patchableUnit -notmatch "XMUI") -and ($patchableUnit -notmatch "Project Server") -and - ($patchableUnit -notmatch "Microsoft SharePoint Server (2013|2016)")) + (($patchableUnit -notmatch "Microsoft SharePoint Server (2013|2016|2019)" -or ` + $patchableUnit -match "Core"))) { $patchableUnitsInfo = $singleProductInfo.GetPatchableUnitInfoByDisplayName($patchableUnit) $currentVersion = "" diff --git a/Modules/SharePointDsc/SharePointDsc.psd1 b/Modules/SharePointDsc/SharePointDsc.psd1 index f593caeb2..180fe2d42 100644 --- a/Modules/SharePointDsc/SharePointDsc.psd1 +++ b/Modules/SharePointDsc/SharePointDsc.psd1 @@ -1,9 +1,9 @@ # # Module manifest for module 'SharePointDsc' # -# Generated by: Brian Farnhill +# Generated by: Microsoft Corporation # -# Generated on: 17/03/2015 +# Generated on: 20/06/2018 # @{ @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '2.6.0.0' +ModuleVersion = '3.0.0.0' # ID used to uniquely identify this module GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90' @@ -27,7 +27,7 @@ CompanyName = 'Microsoft Corporation' Copyright = '(c) 2015-2018 Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module -Description = 'This DSC module is used to deploy and configure SharePoint Server 2013 and 2016, and covers a wide range of areas including web apps, service apps and farm configuration.' +Description = 'This DSC module is used to deploy and configure SharePoint Server 2013, 2016 and 2019, and covers a wide range of areas including web apps, service apps and farm configuration.' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '4.0' @@ -128,56 +128,80 @@ PrivateData = @{ # ReleaseNotes of this module ReleaseNotes = " - * SPFarm - * Fixed issue where Central Admin service was not starting for non-english farms - * SPManagedMetadataServiceApp - * Added additional content type settings (ContentTypePushdownEnabled & - ContentTypeSyndicationEnabled). - * Fixed issue where Get method would throw an error when the proxy did not exist. - * Fixed an issue where the resource checks if the proxy exists and if not, it is - created. + * Changes to SharePointDsc + * Added support for SharePoint 2019 + * Added CredSSP requirement to the Readme files + * Added VSCode Support for running SharePoint 2019 unit tests + * Removed the deprecated resources SPCreateFarm and SPJoinFarm (replaced + in v2.0 by SPFarm) + * SPBlobCacheSettings + * Updated the Service Instance retrieval to be language independent + * SPConfigWizard + * Fixed check for Ensure=Absent in the Set method + * SPInstallPrereqs + * Added support for detecting updated installation of Microsoft Visual C++ + 2015/2017 Redistributable (x64) for SharePoint 2016 and SharePoint 2019. * SPSearchContentSource - * Fixed issue with numerical Content Sources name - * Fixed issue where the code throws an error when the content source cannot be - successfully created - * SPSearchManagedProperty - * Added a new resource to support Search Managed Properties - * Fix for multiple aliases - * SPSearchResultSource - * Added a new ScopeUrl parameter to allow for local source creation - * SPSearchTopology - * Updated Readme.md to remove some incorrect information - * Fixed logic to handle the FirstPartitionDirectory in Get-TargetResource - * SPSelfServiceSiteCreation - * New resource to manage self-service site creation - * SPServiceAppSecurity - * Added local farm token. - * Fixed issues that prevented the resource to work as expected in many situations. - * SPSite - * Added the possibility for creating the default site groups - * Added the possibility to set AdministrationSiteType - * Fixed test method that in some cases always would return false - * Fixed a typo in the values to check for AdministrationSiteType - * Fixed an access denied issue when creating default site groups - when the run as account does not have proper permissions for the site - * SPTrustedIdentityTokenIssuer - * Added parameter UseWReplyParameter + * Added support for Business Content Source Type + * SPSearchMetadataCategory + * New resource added + * SPSearchServiceApp + * Updated resource to make sure the presence of the service app proxy is + checked and created if it does not exist + * SPSecurityTokenServiceConfig + * The resource only tested for the Ensure parameter. Added more parameters + * SPServiceAppSecurity + * Added support for specifying array of access levels. + * Changed implementation to use Grant-SPObjectSecurity with Replace switch + instead of using a combination of Revoke-SPObjectSecurity and + Grant-SPObjectSecurity + * Added all supported access levels as available values. + * Removed unknown access levels: Change Permissions, Write, and Read + * SPUserProfileProperty + * Removed obsolete parameters (MappingConnectionName, MappingPropertyName, + MappingDirection) and introduced new parameter PropertyMappings * SPUserProfileServiceApp - * Fixed issue which was introduced in v2.5 where the service application proxy - was not created. - * Updated resource to grant the InstallAccount permissions to a newly created service - application to prevent issues in the Get method. - * SPUserProfileSyncConnection - * Fixed issue where empty IncludedOUs and ExcludedOUs would throw an error - * SPWebAppClientCallableSettings - * New resource to manage web application client callable settings including - proxy libraries. - * SPWebAppPropertyBag - * New resource to manage web application property bag - * SPWebAppSuiteBar - * Fixed incorrect test method that resulted in this resource to never apply changes. - * Enable usage of SuiteBarBrandingElementHtml for SharePoint 2016 - (only supported if using a SharePoint 2013 masterpage) " + * Updated the check for successful creation of the service app to throw an + error if this is not done correctly + + The following changes will break v2.x and earlier configurations that use these + resources: + + * Implemented IsSingleInstance parameter to force that the resource can only + be used once in a configuration for the following resources: + * SPAntivirusSettings + * SPConfigWizard + * SPDiagnosticLoggingSettings + * SPFarm + * SPFarmAdministrators + * SPInfoPathFormsServiceConfig + * SPInstall + * SPInstallPrereqs + * SPIrmSettings + * SPMinRoleCompliance + * SPPasswordChangeSettings + * SPProjectServerLicense + * SPSecurityTokenServiceConfig + * SPShellAdmin + * Standardized Url/WebApplication parameter to default WebAppUrl parameter + for the following resources: + * SPDesignerSettings + * SPFarmSolution + * SPSelfServiceSiteCreation + * SPWebAppBlockedFileTypes + * SPWebAppClientCallableSettings + * SPWebAppGeneralSettings + * SPWebApplication + * SPWebApplicationAppDomain + * SPWebAppSiteUseAndDeletion + * SPWebAppThrottlingSettings + * SPWebAppWorkflowSettings + * Introduced new mandatory parameters + * SPSearchResultSource: Added option to create Result Sources at different scopes. + * SPServiceAppSecurity: Changed parameter AccessLevel to AccessLevels in + MSFT_SPServiceAppSecurityEntry to support array of access levels. + * SPUserProfileProperty: New parameter PropertyMappings + " } # End of PSData hashtable } # End of PrivateData hashtable diff --git a/Modules/SharePointDsc/en-US/about_SPAccessServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPAccessServiceApp.help.txt index 7c47d5fd6..daedfdc63 100644 --- a/Modules/SharePointDsc/en-US/about_SPAccessServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAccessServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating Access Services Application instances within the local SharePoint farm. The resource will provision and configure the diff --git a/Modules/SharePointDsc/en-US/about_SPAccessServices2010.help.txt b/Modules/SharePointDsc/en-US/about_SPAccessServices2010.help.txt new file mode 100644 index 000000000..7306ce274 --- /dev/null +++ b/Modules/SharePointDsc/en-US/about_SPAccessServices2010.help.txt @@ -0,0 +1,33 @@ +.NAME + SPAccessServices2010 + +# Description + + **Type:** Distributed + **Requires CredSSP:** No + + This resource is responsible for creating Access Services 2010 Application + instances within the local SharePoint farm. The resource will provision and + configure the Access Services 2010 Service Application. + + The default value for the Ensure parameter is Present. When not specifying this + parameter, the service application is provisioned. + +.PARAMETER Name + Key - String + The name of the service application + +.PARAMETER ApplicationPool + Required - String + The name of the application pool to run the service app in + +.PARAMETER Ensure + Write - String + Allowed values: Present, Absent + Present ensures service app exists, absent ensures it is removed + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run thsi resource as, use PsDscRunAsCredential if using PowerShell 5 + + diff --git a/Modules/SharePointDsc/en-US/about_SPAlternateUrl.help.txt b/Modules/SharePointDsc/en-US/about_SPAlternateUrl.help.txt index adf0e202c..b61e08714 100644 --- a/Modules/SharePointDsc/en-US/about_SPAlternateUrl.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAlternateUrl.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to define an alternate access mapping URL for a specified web application. These can be assigned to specific zones for each web diff --git a/Modules/SharePointDsc/en-US/about_SPAntivirusSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPAntivirusSettings.help.txt index a311bd156..1a51b0d64 100644 --- a/Modules/SharePointDsc/en-US/about_SPAntivirusSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAntivirusSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to set the global antivirus settings for the local farm. These settings will be used to control the behavior of an external anti-virus @@ -11,8 +12,13 @@ not scan documents for viruses on it's own, an external tool still needs to be installed on the servers that integrates with SharePoint. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER ScanOnDownload - Key - Boolean + Write - Boolean Should documents be scanned before being downloaded .PARAMETER ScanOnUpload @@ -44,7 +50,7 @@ This example shows how to apply specific anti-virus configuration to the farm - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -56,6 +62,7 @@ node localhost { SPAntivirusSettings AVSettings { + IsSingleInstance = "Yes" ScanOnDownload = $true ScanOnUpload = $true AllowDownloadInfected = $false diff --git a/Modules/SharePointDsc/en-US/about_SPAppCatalog.help.txt b/Modules/SharePointDsc/en-US/about_SPAppCatalog.help.txt index 1fd2673d8..de083e063 100644 --- a/Modules/SharePointDsc/en-US/about_SPAppCatalog.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAppCatalog.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** Yes This resource will ensure that a specific site collection is marked as the app catalog for the web application that the site is in. The catalog site needs to diff --git a/Modules/SharePointDsc/en-US/about_SPAppDomain.help.txt b/Modules/SharePointDsc/en-US/about_SPAppDomain.help.txt index 522632ebf..6acffc7e5 100644 --- a/Modules/SharePointDsc/en-US/about_SPAppDomain.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAppDomain.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will set the value for the app domain settings at the farm level. You can set the domain name and the prefix that is to be used for app URLs. diff --git a/Modules/SharePointDsc/en-US/about_SPAppManagementServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPAppManagementServiceApp.help.txt index 3782a62e2..6e88b4c7e 100644 --- a/Modules/SharePointDsc/en-US/about_SPAppManagementServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAppManagementServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to provision and manage an instance of the App Management Services Service Application. It will identify an instance of the app diff --git a/Modules/SharePointDsc/en-US/about_SPAppStoreSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPAppStoreSettings.help.txt index 1f0c44782..07ae80b41 100644 --- a/Modules/SharePointDsc/en-US/about_SPAppStoreSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPAppStoreSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will configure the ability to purchase apps for both SharePoint and Office apps. diff --git a/Modules/SharePointDsc/en-US/about_SPBCSServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPBCSServiceApp.help.txt index 11a901a7b..c213a52d2 100644 --- a/Modules/SharePointDsc/en-US/about_SPBCSServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPBCSServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to provision and manage an instance of the Business Connectivity Services Service Application. It will identify an instance diff --git a/Modules/SharePointDsc/en-US/about_SPBlobCacheSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPBlobCacheSettings.help.txt index 682705314..60c7bfe86 100644 --- a/Modules/SharePointDsc/en-US/about_SPBlobCacheSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPBlobCacheSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Specific + **Requires CredSSP:** No This resource is used to configure the Blob Cache settings for a web application. diff --git a/Modules/SharePointDsc/en-US/about_SPCacheAccounts.help.txt b/Modules/SharePointDsc/en-US/about_SPCacheAccounts.help.txt index 7545cc4bd..13d3df0a2 100644 --- a/Modules/SharePointDsc/en-US/about_SPCacheAccounts.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPCacheAccounts.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to set the "super user" and "super reader" cache accounts for the specified web application object (as described in the TechNet article diff --git a/Modules/SharePointDsc/en-US/about_SPConfigWizard.help.txt b/Modules/SharePointDsc/en-US/about_SPConfigWizard.help.txt index 8cd498ddc..83197c294 100644 --- a/Modules/SharePointDsc/en-US/about_SPConfigWizard.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPConfigWizard.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Utility + **Requires CredSSP:** No This resource is used to perform the upgrade step of installing SharePoint updates, like Cumulative Updates, Service Packs and Language Packs. The @@ -11,10 +12,15 @@ which the update can be installed. This module has to be used to complete the update installation step, performed by SPProductUpdate. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER Ensure - Key - string + Write - string Allowed values: Present, Absent - Present to install SharePoint. Absent is currently not supported + Present to run the Configuration Wizard. Absent is currently not supported .PARAMETER DatabaseUpgradeDays Write - String @@ -34,7 +40,7 @@ This example runs the Configuration Wizard as soon as it is applied. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -46,7 +52,7 @@ node localhost { SPConfigWizard RunConfigWizard { - Ensure = "Present" + IsSingleInstance = "Yes" PsDscRunAsCredential = $SetupAccount } } @@ -58,7 +64,7 @@ - Saturday and Sunday night between 3am and 5am. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -70,7 +76,7 @@ node localhost { SPConfigWizard RunConfigWizard { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sat", "sun" DatabaseUpgradeTime = "3:00am to 5:00am" PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/en-US/about_SPContentDatabase.help.txt b/Modules/SharePointDsc/en-US/about_SPContentDatabase.help.txt index ec5888af0..820a6cdd1 100644 --- a/Modules/SharePointDsc/en-US/about_SPContentDatabase.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPContentDatabase.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to add and remove Content Databases to web applications and configure these databases. diff --git a/Modules/SharePointDsc/en-US/about_SPCreateFarm.help.txt b/Modules/SharePointDsc/en-US/about_SPCreateFarm.help.txt deleted file mode 100644 index d7f4e2ea5..000000000 --- a/Modules/SharePointDsc/en-US/about_SPCreateFarm.help.txt +++ /dev/null @@ -1,47 +0,0 @@ -.NAME - SPCreateFarm - -# Description - - WARNING: This resource has been removed. Please use SPFarm instead. - See http://aka.ms/SPDsc-SPFarm for details. - -.PARAMETER FarmConfigDatabaseName - Key - String - Name of the configuration database - -.PARAMETER DatabaseServer - Key - String - Server that will host the configuration and admin content databases - -.PARAMETER FarmAccount - Required - String - The account to use as the main farm account - -.PARAMETER Passphrase - Required - String - The passphrase to use to allow servers to join this farm - -.PARAMETER AdminContentDatabaseName - Required - String - The name of the admin content database - -.PARAMETER CentralAdministrationPort - Write - uint32 - What port will Central Admin be provisioned to - default is 9999 - -.PARAMETER CentralAdministrationAuth - Write - String - Allowed values: NTLM, Kerberos - The authentication provider of the CentralAdministration web application - -.PARAMETER ServerRole - Write - string - Allowed values: Application, ApplicationWithSearch, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, WebFrontEnd, WebFrontEndWithDistributedCache - SharePoint 2016 only - the MinRole role to enroll this server as - -.PARAMETER InstallAccount - Write - String - POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 - - diff --git a/Modules/SharePointDsc/en-US/about_SPDatabaseAAG.help.txt b/Modules/SharePointDsc/en-US/about_SPDatabaseAAG.help.txt index 5dff457fb..d722e76bd 100644 --- a/Modules/SharePointDsc/en-US/about_SPDatabaseAAG.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPDatabaseAAG.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will allow specifying which SQL Server AlwaysOn Availability group a resource should be in. This resource does not configure the diff --git a/Modules/SharePointDsc/en-US/about_SPDesignerSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPDesignerSettings.help.txt index b6337b942..76b780aa1 100644 --- a/Modules/SharePointDsc/en-US/about_SPDesignerSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPDesignerSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to set the SharePoint Designer settings for the local farm or site collections. These settings will be used to control if users are @@ -22,7 +23,7 @@ changing the Site Collection settings results in an Access Denied error. Consider implementing PowerShell v5 and switching to the PsDscRunAsCredential -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web application or site collection to configure @@ -65,11 +66,11 @@ .EXAMPLE - This example applies settings to disable SharePoint Designer access to the + This example applies settings to disable SharePoint Designer access to the specified web application. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -81,7 +82,7 @@ node localhost { SPDesignerSettings MainWebAppSPDSettings { - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "WebApplication" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false diff --git a/Modules/SharePointDsc/en-US/about_SPDiagnosticLoggingSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPDiagnosticLoggingSettings.help.txt index a7ac89ff3..08fb18203 100644 --- a/Modules/SharePointDsc/en-US/about_SPDiagnosticLoggingSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPDiagnosticLoggingSettings.help.txt @@ -4,14 +4,20 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuring settings to do with the diagnostic (ULS) logging on servers in the farm. These settings are applied to the diagnostic logging service for the farm and do not need to be applied to each server individually, the settings will be propagated throughout the farm when +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER LogPath - Key - string + Required - string The physical path on each server to store ULS logs .PARAMETER LogSpaceInGB @@ -93,7 +99,7 @@ whatever value has been manually configured outside of DSC. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -105,7 +111,7 @@ node localhost { SPDiagnosticLoggingSettings ApplyDiagnosticLogSettings { - PsDscRunAsCredential = $SetupAccount + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $false @@ -124,6 +130,7 @@ ScriptErrorReportingDelay = 30 ScriptErrorReportingEnabled = $true ScriptErrorReportingRequireAuth = $true + PsDscRunAsCredential = $SetupAccount } } } diff --git a/Modules/SharePointDsc/en-US/about_SPDiagnosticsProvider.help.txt b/Modules/SharePointDsc/en-US/about_SPDiagnosticsProvider.help.txt index 43b0acf98..bfc898057 100644 --- a/Modules/SharePointDsc/en-US/about_SPDiagnosticsProvider.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPDiagnosticsProvider.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuring the Diagnostics Provider within the local SharePoint farm. Using Ensure equals to Absent is not supported. diff --git a/Modules/SharePointDsc/en-US/about_SPDistributedCacheClientSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPDistributedCacheClientSettings.help.txt index acf3d850b..d366ef408 100644 --- a/Modules/SharePointDsc/en-US/about_SPDistributedCacheClientSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPDistributedCacheClientSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuring the distributed cache client settings. It only accepts Ensure='Present' as a key. The resource can diff --git a/Modules/SharePointDsc/en-US/about_SPDistributedCacheService.help.txt b/Modules/SharePointDsc/en-US/about_SPDistributedCacheService.help.txt index 5210953af..d2387c7e4 100644 --- a/Modules/SharePointDsc/en-US/about_SPDistributedCacheService.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPDistributedCacheService.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Specific + **Requires CredSSP:** No This resource is responsible for provisioning the distributed cache to the service it runs on. This is required in your farm on at least one server (as diff --git a/Modules/SharePointDsc/en-US/about_SPExcelServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPExcelServiceApp.help.txt index 4a95d56dc..217884c77 100644 --- a/Modules/SharePointDsc/en-US/about_SPExcelServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPExcelServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating Excel Services Application instances within the local SharePoint farm. The resource will provision and configure the diff --git a/Modules/SharePointDsc/en-US/about_SPFarm.help.txt b/Modules/SharePointDsc/en-US/about_SPFarm.help.txt index c0ce3ae8a..de881fe49 100644 --- a/Modules/SharePointDsc/en-US/about_SPFarm.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPFarm.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Specific + **Requires CredSSP:** No This resource is used to create a new SharePoint farm and allow servers to join that farm. It will detect the presence of the configuration database @@ -36,8 +37,13 @@ specified, it defaults to NTLM. If using Kerberos, make sure to have appropriate SPNs setup for Farm account and Central Administration URI. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER Ensure - Key - string + Write - string Allowed values: Present, Absent Present to create/join the farm. Absent is currently not supported @@ -77,7 +83,7 @@ .PARAMETER ServerRole Write - string Allowed values: Application, ApplicationWithSearch, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, WebFrontEnd, WebFrontEndWithDistributedCache - SharePoint 2016 only - the MinRole role to enroll this server as + SharePoint 2016 & 2019 only - the MinRole role to enroll this server as .PARAMETER InstallAccount Write - String @@ -91,7 +97,7 @@ example is provisioned to port 9999 using NTLM authentication. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -111,7 +117,7 @@ node localhost { SPFarm SharePointFarm { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" FarmConfigDatabaseName = "SP_Config" AdminContentDatabaseName = "SP_AdminContent" @@ -131,7 +137,7 @@ run on, as well as the authentication mode for the site are also specified. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -151,7 +157,7 @@ node localhost { SPFarm SharePointFarm { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" FarmConfigDatabaseName = "SP_Config" AdminContentDatabaseName = "SP_AdminContent" @@ -166,17 +172,17 @@ } -.EXAMPLE +.EXAMPLE This example shows how a basic SharePoint farm can be created. The database server and names are specified, and the accounts to run the setup as, the farm account and the passphrase are all passed in to the configuration to be applied. By default the central admin site in this example is provisioned to port 9999 using NTLM authentication. In this example we also see - the server role defined as "Application" which tells SharePoint 2016 the role to apply to + the server role defined as "Application" which tells SharePoint 2016/2019 the role to apply to this server as soon as the farm is created. This property is not supported for SharePoint 2013 and so this specific example would fail if used against that verison. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -196,7 +202,7 @@ node localhost { SPFarm SharePointFarm { - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" FarmConfigDatabaseName = "SP_Config" AdminContentDatabaseName = "SP_AdminContent" diff --git a/Modules/SharePointDsc/en-US/about_SPFarmAdministrators.help.txt b/Modules/SharePointDsc/en-US/about_SPFarmAdministrators.help.txt index 4820892b7..a7b8c17f4 100644 --- a/Modules/SharePointDsc/en-US/about_SPFarmAdministrators.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPFarmAdministrators.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Common + **Requires CredSSP:** No This resource is used to manage the membership of the farm administrators group. There are a number of approaches to how this can be implemented. The @@ -15,9 +16,10 @@ group already that may not be specified here, allowing for some manual management outside of this configuration resource. -.PARAMETER Name +.PARAMETER IsSingleInstance Key - String - A generic name for this resource, its value is not important + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' .PARAMETER Members Write - String @@ -38,10 +40,10 @@ .EXAMPLE This example shows how to set a specific list of members for the farm admins group. - Any members not in this list will be removed. + Any members not in this list will be removed. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -53,7 +55,7 @@ node localhost { SPFarmAdministrators LocalFarmAdmins { - Name = "Farm Administrators" + IsSingleInstance = "Yes" Members = @("CONTOSO\user1", "CONTOSO\user2") PsDscRunAsCredential = $SetupAccount } @@ -68,7 +70,7 @@ in either of these properties are left alone. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -80,7 +82,7 @@ node localhost { SPFarmAdministrators LocalFarmAdmins { - Name = "Farm Administrators" + IsSingleInstance = "Yes" MembersToInclude = @("CONTOSO\user1") MembersToExclude = @("CONTOSO\user2") PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/en-US/about_SPFarmPropertyBag.help.txt b/Modules/SharePointDsc/en-US/about_SPFarmPropertyBag.help.txt index c2e12c59d..318f1fa0b 100644 --- a/Modules/SharePointDsc/en-US/about_SPFarmPropertyBag.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPFarmPropertyBag.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to work with SharePoint Property Bags at the farm level. The account that runs this resource must be a farm administrator. diff --git a/Modules/SharePointDsc/en-US/about_SPFarmSolution.help.txt b/Modules/SharePointDsc/en-US/about_SPFarmSolution.help.txt index 6bfc8c997..b0aca92a2 100644 --- a/Modules/SharePointDsc/en-US/about_SPFarmSolution.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPFarmSolution.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to make sure that a specific farm solution is either present or absent in a farm. The solution can be deployed to one or more web @@ -23,7 +24,7 @@ Required - string The full path to the WSP file -.PARAMETER WebApplications +.PARAMETER WebAppUrls Write - string A list of the web applications to deploy this to @@ -51,10 +52,10 @@ .EXAMPLE - This example shows how to deploy a WSP to specific web applications. + This example shows how to deploy a WSP to specific web applications. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -70,7 +71,7 @@ LiteralPath = "C:\src\MySolution.wsp" Ensure = "Present" Version = "1.0.0" - WebApplications = @("http://collaboration", "http://mysites") + WebAppUrls = @("http://collaboration", "http://mysites") PsDscRunAsCredential = $SetupAccount } } diff --git a/Modules/SharePointDsc/en-US/about_SPFeature.help.txt b/Modules/SharePointDsc/en-US/about_SPFeature.help.txt index aee7301c4..425e7f266 100644 --- a/Modules/SharePointDsc/en-US/about_SPFeature.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPFeature.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to make sure that a specific feature is either enabled or disabled at a given URL/scope. The Ensure property will dictate if the diff --git a/Modules/SharePointDsc/en-US/about_SPHealthAnalyzerRuleState.help.txt b/Modules/SharePointDsc/en-US/about_SPHealthAnalyzerRuleState.help.txt index 9373405b9..a3e5ecb59 100644 --- a/Modules/SharePointDsc/en-US/about_SPHealthAnalyzerRuleState.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPHealthAnalyzerRuleState.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure Health Analyzer rules for the local farm. The resource is able to enable/disable and configure the specified rule. diff --git a/Modules/SharePointDsc/en-US/about_SPInfoPathFormsServiceConfig.help.txt b/Modules/SharePointDsc/en-US/about_SPInfoPathFormsServiceConfig.help.txt index a3f29c642..d4319cab8 100644 --- a/Modules/SharePointDsc/en-US/about_SPInfoPathFormsServiceConfig.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPInfoPathFormsServiceConfig.help.txt @@ -4,13 +4,19 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuring the InfoPath Forms service within the local SharePoint farm. Using Ensure equals to Absent is not supported. This resource can only apply configuration, not ensure they don't exist. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER Ensure - Key - string + Write - string Allowed values: Present, Absent Present ensures the settings are applied @@ -88,7 +94,7 @@ node localhost { SPInfoPathFormsServiceConfig InfoPathFormsServiceConfig { - Ensure = "Present" + IsSingleInstance = "Yes" AllowUserFormBrowserEnabling = $true AllowUserFormBrowserRendering = $true MaxDataConnectionTimeout = 20000 diff --git a/Modules/SharePointDsc/en-US/about_SPInstall.help.txt b/Modules/SharePointDsc/en-US/about_SPInstall.help.txt index 64379e38d..6f82e5715 100644 --- a/Modules/SharePointDsc/en-US/about_SPInstall.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPInstall.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Common + **Requires CredSSP:** No This resource is used to install the SharePoint binaries. The BinaryDir parameter should point to the path that setup.exe is located (not to setup.exe @@ -35,8 +36,13 @@ deployments. However due to constraints in how we set up and install the product, only English ISOs are supported for installing SharePoint. -.PARAMETER BinaryDir +.PARAMETER IsSingleInstance Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + +.PARAMETER BinaryDir + Required - String The directory that contains all of the SharePoint binaries .PARAMETER ProductKey @@ -63,7 +69,7 @@ C:\SPInstall\Setup.exe) - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -75,8 +81,9 @@ node localhost { SPInstall InstallBinaries { - BinaryDir = "C:\SPInstall" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + BinaryDir = "C:\SPInstall" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } } } @@ -84,10 +91,10 @@ .EXAMPLE This module will install SharePoint to the specific locations set for the - InstallPath and DataPath directories. + InstallPath and DataPath directories. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -99,10 +106,11 @@ node localhost { SPInstall InstallBinaries { - BinaryDir = "D:\SharePoint\Binaries" - InstallPath = "D:\SharePoint\Install" - DataPath = "D:\SharePoint\Data" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + BinaryDir = "D:\SharePoint\Binaries" + InstallPath = "D:\SharePoint\Install" + DataPath = "D:\SharePoint\Data" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } } } @@ -112,7 +120,7 @@ This module will install SharePoint Foundation 2013 to the local server - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] diff --git a/Modules/SharePointDsc/en-US/about_SPInstallLanguagePack.help.txt b/Modules/SharePointDsc/en-US/about_SPInstallLanguagePack.help.txt index 86c7283e9..56e6c53b1 100644 --- a/Modules/SharePointDsc/en-US/about_SPInstallLanguagePack.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPInstallLanguagePack.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to install the SharePoint Language Pack binaries. The BinaryDir parameter should point to the path that setup.exe is located (not to @@ -12,8 +13,8 @@ The BinaryInstallDays and BinaryInstallTime parameters specify a window in which the update can be installed. - With SharePoint 2016, the Language Packs are offered as an EXE package. You have - to extract this package before installing, using the following command: + Starting with SharePoint 2016, the Language Packs are offered as an EXE package. + You have to extract this package before installing, using the following command: .\serverlanguagepack.exe /extract:[Extract Folder] .PARAMETER BinaryDir diff --git a/Modules/SharePointDsc/en-US/about_SPInstallPrereqs.help.txt b/Modules/SharePointDsc/en-US/about_SPInstallPrereqs.help.txt index 384b1e13a..d05a000bc 100644 --- a/Modules/SharePointDsc/en-US/about_SPInstallPrereqs.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPInstallPrereqs.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Common + **Requires CredSSP:** No This resource is responsible for ensuring the installation of all SharePoint prerequisites. It makes use of the PrerequisiteInstaller.exe file that is part @@ -49,8 +50,15 @@ SharePoint 2016: https://technet.microsoft.com/en-us/library/cc262485(v=office.16).aspx#section5 -.PARAMETER InstallerPath + SharePoint 2019: + +.PARAMETER IsSingleInstance Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + +.PARAMETER InstallerPath + Required - String The full path to prerequisiteinstaller.exe .PARAMETER OnlineMode @@ -125,6 +133,14 @@ Write - String The path to the installer for this prerequisite (SP2016 only) +.PARAMETER DotNet472 + Write - String + The path to the installer for this prerequisite (SP2019 only) + +.PARAMETER MSVCRT141 + Write - String + The path to the installer for this prerequisite (SP2019 only) + .PARAMETER Ensure Write - string Allowed values: Present, Absent @@ -136,7 +152,7 @@ online mode, looking to download all prerequisites from the internet. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -148,6 +164,7 @@ node localhost { SPInstallPrereqs InstallPrerequisites { + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true } @@ -160,7 +177,7 @@ offline mode, running all prerequisite installations from the specified paths. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -172,6 +189,7 @@ node localhost { SPInstallPrereqs InstallPrerequisites { + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false SXSpath = "c:\SPInstall\Windows2012r2-SXS" @@ -192,7 +210,7 @@ .EXAMPLE - This module will install the prerequisites for SharePoint 2016. This resource will run in + This module will install the prerequisites for SharePoint 2016/2019. This resource will run in offline mode, running all prerequisite installations from the specified paths. @@ -208,6 +226,7 @@ node localhost { SPInstallPrereqs InstallPrerequisites { + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false SXSpath = "C:\SPInstall\Windows2012r2-SXS" diff --git a/Modules/SharePointDsc/en-US/about_SPIrmSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPIrmSettings.help.txt index fdd87143b..5440b52f4 100644 --- a/Modules/SharePointDsc/en-US/about_SPIrmSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPIrmSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to manipulate the IRM settings in SharePoint, integrating it with AD RMS @@ -11,8 +12,13 @@ The default value for the Ensure parameter is Present. When not specifying this parameter, IRM is configured. -.PARAMETER Ensure +.PARAMETER IsSingleInstance Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + +.PARAMETER Ensure + Write - String Allowed values: Present, Absent Enable or Disable IRM on this farm @@ -34,7 +40,7 @@ a specific RMS server - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -46,7 +52,7 @@ node localhost { SPIrmSettings RMSSettings { - Ensure = "Present" + IsSingleInstance = "Yes" RMSserver = "https://rms.contoso.com" PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/en-US/about_SPJoinFarm.help.txt b/Modules/SharePointDsc/en-US/about_SPJoinFarm.help.txt deleted file mode 100644 index 2a98ad3e9..000000000 --- a/Modules/SharePointDsc/en-US/about_SPJoinFarm.help.txt +++ /dev/null @@ -1,30 +0,0 @@ -.NAME - SPJoinFarm - -# Description - - WARNING: This resource has been removed. Please use SPFarm instead. - See http://aka.ms/SPDsc-SPFarm for details. - -.PARAMETER FarmConfigDatabaseName - Key - string - The name of the config database to connect to - -.PARAMETER DatabaseServer - Key - string - The server that hosts the config database - -.PARAMETER Passphrase - Required - string - The passphrase that should be used to join the farm - -.PARAMETER ServerRole - Write - string - Allowed values: Application, ApplicationWithSearch, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, WebFrontEnd, WebFrontEndWithDistributedCache - SharePoint 2016 only - the MinRole role to enroll this server as - -.PARAMETER InstallAccount - Write - String - POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 - - diff --git a/Modules/SharePointDsc/en-US/about_SPLogLevel.help.txt b/Modules/SharePointDsc/en-US/about_SPLogLevel.help.txt index 8ecc0003f..d3edae9ef 100644 --- a/Modules/SharePointDsc/en-US/about_SPLogLevel.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPLogLevel.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to change the minimum severity of events captured in the trace logs (ULS logs) and the Windows event logs. Settings can be changed diff --git a/Modules/SharePointDsc/en-US/about_SPMachineTranslationServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPMachineTranslationServiceApp.help.txt index 92cc49c62..01d77d580 100644 --- a/Modules/SharePointDsc/en-US/about_SPMachineTranslationServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPMachineTranslationServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to provision and manage an instance of the Machine Translation Service Application. It will identify an instance of the MT diff --git a/Modules/SharePointDsc/en-US/about_SPManagedAccount.help.txt b/Modules/SharePointDsc/en-US/about_SPManagedAccount.help.txt index 38738833a..b646af763 100644 --- a/Modules/SharePointDsc/en-US/about_SPManagedAccount.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPManagedAccount.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will ensure a managed account is provisioned in to the SharePoint farm. The Account object specific the credential to store (including username diff --git a/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceApp.help.txt index 65cb8b84d..7a7cb9ddd 100644 --- a/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No Creates a managed metadata service application. The application pool property specifies which application pool it should use, and will reset the application diff --git a/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceAppDefault.help.txt b/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceAppDefault.help.txt index 551c38276..db888be2f 100644 --- a/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceAppDefault.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPManagedMetaDataServiceAppDefault.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No Using several managed metadata service instances in a farm requires some configuration, which service application proxy should be used as default diff --git a/Modules/SharePointDsc/en-US/about_SPManagedPath.help.txt b/Modules/SharePointDsc/en-US/about_SPManagedPath.help.txt index aba74df6b..290bc0a98 100644 --- a/Modules/SharePointDsc/en-US/about_SPManagedPath.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPManagedPath.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating managed paths associated with a specific web application. The WebAppUrl parameter is used to specify the web diff --git a/Modules/SharePointDsc/en-US/about_SPMinRoleCompliance.help.txt b/Modules/SharePointDsc/en-US/about_SPMinRoleCompliance.help.txt index 3f7776d9f..294d794cd 100644 --- a/Modules/SharePointDsc/en-US/about_SPMinRoleCompliance.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPMinRoleCompliance.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Utility + **Requires CredSSP:** No This resource will help manage compliance of MinRole based servers. Each time the resource runs it will investigate which service instances should be running @@ -11,8 +12,13 @@ compliant state it will tell SharePoint to create timer jobs to make the necesssary modifications to make the farm compliant again. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER State - Key - string + Required - string Allowed values: Compliant, NonCompliant Should the state be set to compliant @@ -25,7 +31,7 @@ This example shows how to ensure the farm is always compliant with MinRole settings - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -35,8 +41,9 @@ Import-DscResource -ModuleName SharePointDsc node localhost { - SPMinRoleCompliance MinRoleCompliance + SPMinRoleCompliance MinRoleCompliance { + IsSingleInstance = "Yes" State = "Compliant" PSDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/en-US/about_SPOfficeOnlineServerBinding.help.txt b/Modules/SharePointDsc/en-US/about_SPOfficeOnlineServerBinding.help.txt index 82a1c2487..0cf347584 100644 --- a/Modules/SharePointDsc/en-US/about_SPOfficeOnlineServerBinding.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPOfficeOnlineServerBinding.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will create a binding to an Office Online Server (formerly known as Office Web Apps). The DnsName property can be a single server name, or a diff --git a/Modules/SharePointDsc/en-US/about_SPOutgoingEmailSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPOutgoingEmailSettings.help.txt index cd4886d7d..c61283630 100644 --- a/Modules/SharePointDsc/en-US/about_SPOutgoingEmailSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPOutgoingEmailSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to set the outgoing email settings for either a single web application, or the whole farm. To configure the resource for a specific @@ -34,11 +35,11 @@ .PARAMETER UseTLS Write - boolean - Use TLS when connecting to the SMTP server (SharePoint 2016 only) + Use TLS when connecting to the SMTP server (SharePoint 2016 and 2019 only) .PARAMETER SMTPPort Write - uint32 - The port which is used to connect to the SMTP server (SharePoint 2016 only) + The port which is used to connect to the SMTP server (SharePoint 2016 and 2019 only) .PARAMETER InstallAccount Write - String diff --git a/Modules/SharePointDsc/en-US/about_SPPasswordChangeSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPPasswordChangeSettings.help.txt index 344e716c6..534d81e89 100644 --- a/Modules/SharePointDsc/en-US/about_SPPasswordChangeSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPPasswordChangeSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to control settings that relate to the automatic changing of passwords for managed accounts (where they opt-in to be managed by @@ -11,8 +12,13 @@ administration, or configured in this resource. The settings relate to email notifications of when passwords are reset, as well as behavior when a reset +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER MailAddress - key - string + Required - string The email address to send notifications of password changes to .PARAMETER DaysBeforeExpiry @@ -36,7 +42,7 @@ This example sets the password change settings for managed accounts in the local farm - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -48,7 +54,8 @@ node localhost { SPPasswordChangeSettings ManagedAccountPasswordResetSettings { - MailAddress = "sharepoint`@contoso.com" + IsSingleInstance = "Yes" + MailAddress = "sharepoint@contoso.com" DaysBeforeExpiry = "14" PasswordChangeWaitTimeSeconds = "60" NumberOfRetries = "3" diff --git a/Modules/SharePointDsc/en-US/about_SPPerformancePointServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPPerformancePointServiceApp.help.txt index 40a9da043..dce2562ff 100644 --- a/Modules/SharePointDsc/en-US/about_SPPerformancePointServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPPerformancePointServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating Performance Point Service Application instances within the local SharePoint farm. The resource will provision and diff --git a/Modules/SharePointDsc/en-US/about_SPPowerPointAutomationServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPPowerPointAutomationServiceApp.help.txt new file mode 100644 index 000000000..a3531185a --- /dev/null +++ b/Modules/SharePointDsc/en-US/about_SPPowerPointAutomationServiceApp.help.txt @@ -0,0 +1,112 @@ +.NAME + SPPowerPointAutomationServiceApp + +# Description + + **Type:** Distributed + **Requires CredSSP:** No + + This resource is responsible for creating PowerPoint Automation Service + Application instances within the local SharePoint farm. The resource will + provision and configure the PowerPoint Automation Service Application. + + The default value for the Ensure parameter is Present. When not specifying this + parameter, the service application is provisioned. + +.PARAMETER Name + Key - String + The name of the service application + +.PARAMETER ProxyName + Write - String + The name of the service application proxy + +.PARAMETER ApplicationPool + Write - String + The name of the application pool to run the service app in + +.PARAMETER CacheExpirationPeriodInSeconds + Write - Uint32 + Specifies the maximum time, in seconds, that items remain in the back-end server cache. The default value is 600 seconds (10 minutes). + +.PARAMETER MaximumConversionsPerWorker + Write - Uint32 + Specifies the maximum number of presentations that a conversion worker process can convert before recycling. The default value is 5. + +.PARAMETER WorkerKeepAliveTimeoutInSeconds + Write - Uint32 + Specifies the maximum time, in seconds, that a conversion worker process can be unresponsive before being terminated. The default value is 120 seconds. + +.PARAMETER WorkerProcessCount + Write - Uint32 + Specifies the number of active instances of the conversion worker process on each back-end. This value must be less than the Windows Communication Foundation (WCF) connection limit for this computer. The default value is 3. + +.PARAMETER WorkerTimeoutInSeconds + Write - Uint32 + Specifies the maximum time, in seconds, that a conversion worker process is given for any single conversion. The default is 300 seconds (5 minutes). + +.PARAMETER Ensure + Write - String + Allowed values: Present, Absent + Ensure the crawl rule is Present or Absent + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run thsi resource as, use PsDscRunAsCredential if using PowerShell 5 + + +.EXAMPLE + This example makes sure the service application exists and has a specific configuration + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPPowerPointAutomationServiceApp PowerPointAutomation + { + Name = "PowerPoint Automation Service Application" + ProxyName = "PowerPoint Automation Service Application Proxy" + CacheExpirationPeriodInSeconds = 600 + MaximumConversionsPerWorker = 5 + WorkerKeepAliveTimeoutInSeconds = 120 + WorkerProcessCount = 3 + WorkerTimeoutInSeconds = 300 + ApplicationPool = "SharePoint Web Services" + Ensure = "Present" + PsDscRunAsCredential = $SetupAccount + } + } + } + + +.EXAMPLE + This example removes a word automation service app + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPPowerPointAutomationServiceApp WordAutomation + { + Name = "PowerPoint Automation Service Application" + Ensure = "Absent" + PsDscRunAsCredential = $SetupAccount + } + } + } + + diff --git a/Modules/SharePointDsc/en-US/about_SPProductUpdate.help.txt b/Modules/SharePointDsc/en-US/about_SPProductUpdate.help.txt index b244788f4..079a04c75 100644 --- a/Modules/SharePointDsc/en-US/about_SPProductUpdate.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProductUpdate.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Common + **Requires CredSSP:** No This resource is used to perform the update step of installing SharePoint updates, like Cumulative Updates and Service Packs. The SetupFile parameter diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerADResourcePoolSync.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerADResourcePoolSync.help.txt index 35d5372e4..5cb4d1094 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerADResourcePoolSync.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerADResourcePoolSync.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to control the settings of the Active Directory resource pool sync for Project Server, for a specific PWA instance. diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerAdditionalSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerAdditionalSettings.help.txt index fd3114aea..0683e92bf 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerAdditionalSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerAdditionalSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to manage the "additional settings" for a PWA instance (based on what is in the 'additional settings' page of the web interface). diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerGlobalPermissions.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerGlobalPermissions.help.txt index 0beb81a13..f20c5a217 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerGlobalPermissions.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerGlobalPermissions.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource allows you to enforce global permissions in a PWA site for a specific project server group or an individual resource. diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerGroup.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerGroup.help.txt index f6a67953d..ab2cae30f 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerGroup.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerGroup.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure a group within Project Server. This is only available for use when the site is configured to use Project Server permissions diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerLicense.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerLicense.help.txt index c22b21e95..9d6b9229e 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerLicense.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerLicense.help.txt @@ -4,12 +4,18 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to enable a Project Server license in to a SharePoint - 2016 farm. + 2016 or 2019 farm. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER Ensure - Key - string + Write - string Allowed values: Present, Absent Should a Project Server license be enabled or disabled @@ -26,7 +32,7 @@ This example enables Project Server in the current environment -Configuration Example +Configuration Example { param( [Parameter(Mandatory = $true)] @@ -38,7 +44,7 @@ Configuration Example node localhost { SPProjectServerLicense ProjectLicense { - Ensure = "Present" + IsSingleInstance = "Yes" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" PsDscRunAsCredential = $SetupAccount } @@ -50,7 +56,7 @@ Configuration Example This example disables Project Server in the current environment -Configuration Example +Configuration Example { param( [Parameter(Mandatory = $true)] @@ -62,6 +68,7 @@ Configuration Example node localhost { SPProjectServerLicense ProjectLicense { + IsSingleInstance = "Yes" Ensure = "Absent" PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerPermissionMode.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerPermissionMode.help.txt index e73d6e644..ec9426453 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerPermissionMode.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerPermissionMode.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource allows you to set the permissions mode (either SharePoint or ProjectServer) for a specific project server site. diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerServiceApp.help.txt index cbc06e397..0e39cf7b2 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerServiceApp.help.txt @@ -4,9 +4,10 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for provisioning and managing the Project Server - service application in SharePoint Server 2016. + service application in SharePoint Server 2016 or 2019. To create a Project Server site the following DSC resources can be used to create the site and enable the feature. diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerTimeSheetSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerTimeSheetSettings.help.txt index a53f30310..77c0bd2be 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerTimeSheetSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerTimeSheetSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No Allows you to configure the default timesheet settings for a specific PWA instance. diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerUserSyncSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerUserSyncSettings.help.txt index 3ce3df5c2..a22ad256e 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerUserSyncSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerUserSyncSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuration of the user sync settings between projects and project sites. diff --git a/Modules/SharePointDsc/en-US/about_SPProjectServerWssSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPProjectServerWssSettings.help.txt index 575397561..e4f8913c3 100644 --- a/Modules/SharePointDsc/en-US/about_SPProjectServerWssSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPProjectServerWssSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to control settings that relate to the SharePoint sites that are linked to projects in Project Server. diff --git a/Modules/SharePointDsc/en-US/about_SPPublishServiceApplication.help.txt b/Modules/SharePointDsc/en-US/about_SPPublishServiceApplication.help.txt index dfa1ad01d..715c2ff59 100644 --- a/Modules/SharePointDsc/en-US/about_SPPublishServiceApplication.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPPublishServiceApplication.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to specify if a specific service application should be published (Ensure = "Present") or not published (Ensure = "Absent") on the @@ -11,7 +12,7 @@ shown in the Central Admin website. You can publish the following service applications in a SharePoint Server - 2013/2016 farm: + 2013/2016/2019 farm: * Business Data Connectivity * Machine Translation diff --git a/Modules/SharePointDsc/en-US/about_SPQuotaTemplate.help.txt b/Modules/SharePointDsc/en-US/about_SPQuotaTemplate.help.txt index ca4dd1e9f..8adb95d9f 100644 --- a/Modules/SharePointDsc/en-US/about_SPQuotaTemplate.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPQuotaTemplate.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure quota templates in the farm. These settings will be used to make sure a certain quota template exists or not. When it diff --git a/Modules/SharePointDsc/en-US/about_SPRemoteFarmTrust.help.txt b/Modules/SharePointDsc/en-US/about_SPRemoteFarmTrust.help.txt index 2d3079f83..3dbff7ac5 100644 --- a/Modules/SharePointDsc/en-US/about_SPRemoteFarmTrust.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPRemoteFarmTrust.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to trust a remote SharePoint farm. This is used when federating search results between two different SharePoint farms. The diff --git a/Modules/SharePointDsc/en-US/about_SPSearchAuthoritativePage.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchAuthoritativePage.help.txt index 9164a96d9..3331d2679 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchAuthoritativePage.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchAuthoritativePage.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for managing the search authoritative pages in the search service application. You can create new pages, change existing pages and diff --git a/Modules/SharePointDsc/en-US/about_SPSearchContentSource.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchContentSource.help.txt index eb5f41447..17581f6c9 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchContentSource.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchContentSource.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will deploy and configure a content source in a specified search service application. @@ -21,15 +22,15 @@ .PARAMETER ContentSourceType Required - String - Allowed values: SharePoint, Website, FileShare - The type of content source - currently only SharePoint, Website and File Shares are supported + Allowed values: SharePoint, Website, FileShare, Business + The type of content source - currently only SharePoint, Website, File Shares and Business are supported .PARAMETER Addresses - Required - String + Write - String A list of the addresses this content source includes .PARAMETER CrawlSetting - Required - String + Write - String Allowed values: CrawlEverything, CrawlFirstOnly, Custom Should the crawler index everything, just the first site or page, or a custom depth (applies to websites only) @@ -58,6 +59,10 @@ Write - Uint32 How many server hops should the crawler make (-1 = unlimtied, website sources only) +.PARAMETER LOBSystemSet + Write - String + Line of Business System and System Instance names + .PARAMETER Ensure Write - string Allowed values: Present, Absent diff --git a/Modules/SharePointDsc/en-US/about_SPSearchCrawlMapping.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchCrawlMapping.help.txt index 0ce04c2b1..4029ebce5 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchCrawlMapping.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchCrawlMapping.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for managing the search crawl mapping in the search service application. You can create new mappings, change existing mappings diff --git a/Modules/SharePointDsc/en-US/about_SPSearchCrawlRule.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchCrawlRule.help.txt index b21158382..f01096fb1 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchCrawlRule.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchCrawlRule.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for managing the search crawl rules in the search service application. You can create new rules, change existing rules and remove diff --git a/Modules/SharePointDsc/en-US/about_SPSearchCrawlerImpactRule.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchCrawlerImpactRule.help.txt index a1765d510..1b6c64173 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchCrawlerImpactRule.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchCrawlerImpactRule.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for managing the search crawl impact rules in the search service application. You can create new rules, change existing rules and diff --git a/Modules/SharePointDsc/en-US/about_SPSearchFileType.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchFileType.help.txt index 6c027f7fb..a987ee9a9 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchFileType.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchFileType.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for managing the search file types in the search service application. You can create new file types, change existing types and diff --git a/Modules/SharePointDsc/en-US/about_SPSearchIndexPartition.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchIndexPartition.help.txt index 8be8cbeb6..11a4dc11a 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchIndexPartition.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchIndexPartition.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating search indexes. It works by creating the index topology components and updating the topology from the server that diff --git a/Modules/SharePointDsc/en-US/about_SPSearchManagedProperty.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchManagedProperty.help.txt index a144dcf8b..bcade07fd 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchManagedProperty.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchManagedProperty.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will deploy and configure a managed property in a specified search service application. diff --git a/Modules/SharePointDsc/en-US/about_SPSearchMetadataCategory.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchMetadataCategory.help.txt new file mode 100644 index 000000000..6db4cd921 --- /dev/null +++ b/Modules/SharePointDsc/en-US/about_SPSearchMetadataCategory.help.txt @@ -0,0 +1,72 @@ +.NAME + SPSearchMetadataCategory + +# Description + + **Type:** Distributed + **Requires CredSSP:** No + + This resource will deploy and configure a Metadata Category in a specified search + service application. + + The default value for the Ensure parameter is Present. When not specifying this + parameter, the Metadata Category is created. + +.PARAMETER Name + Key - String + The name of the Metadata Category + +.PARAMETER ServiceAppName + Key - String + The name of the search service app that this Metadata Category exists within + +.PARAMETER AutoCreateNewManagedProperties + Write - Boolean + Specifies that when a new crawled property in this category is found, a corresponding managed property is created and mapped to this new crawled property + +.PARAMETER DiscoverNewProperties + Write - Boolean + Specifies that if there are unknown properties in this category, these new properties are discovered during a crawl. + +.PARAMETER MapToContents + Write - Boolean + Specifies that all crawled properties of type string are mapped to corresponding managed properties of this category. + +.PARAMETER Ensure + Write - string + Allowed values: Present, Absent + Present if the result source should exist, absent if it should not + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 + + +.EXAMPLE + This example shows how to create a new Search Metadata Category, using the required parameters + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPSearchMetadataCategory NewCategory + { + Name = "My New category" + ServiceAppName = "Search Service Application" + AutoCreateNewManagedProperties = $true + DiscoverNewProperties = $true + MapToContents = $true + Ensure = "Present" + PsDscRunAsCredential = $SetupAccount + } + } + } + + diff --git a/Modules/SharePointDsc/en-US/about_SPSearchResultSource.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchResultSource.help.txt index 2fa561889..0ce15567d 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchResultSource.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchResultSource.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure search result sources in the SharePoint search service application. Result sources can be configured to be of the @@ -19,10 +20,22 @@ The default value for the Ensure parameter is Present. When not specifying this parameter, the result source is created. + To define a result source as global, use the value 'SSA' as the ScopeName + value. + .PARAMETER Name Key - String The name of the result source +.PARAMETER ScopeName + Key - String + Allowed values: SSA, SPSite, SPWeb + The scope at which the Result Source will be created. Options are SSA, SPSite or SPWeb + +.PARAMETER ScopeUrl + Key - String + The URI of the site where to create the result source. Leave empty to have it created globally + .PARAMETER SearchServiceAppName Required - String The name of the search service application to associate this result source with @@ -40,10 +53,6 @@ Write - String The URI to connect to the remote location -.PARAMETER ScopeUrl - Write - String - The URI of the site where to create the result source. Leave empty to have it created globally - .PARAMETER Ensure Write - string Allowed values: Present, Absent @@ -58,7 +67,7 @@ This example shows how to create a remote sharepoint search result source - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -66,11 +75,13 @@ $SetupAccount ) Import-DscResource -ModuleName SharePointDsc - + node localhost { SPSearchResultSource RemoteSharePointFarm { Name = "External SharePoint results" + ScopeName = "SPSite" + ScopeUrl = "https://SharePoint.contoso.com" SearchServiceAppName = "Search Service Application" Query = "{searchTerms}" ProviderType = "Remote SharePoint Provider" diff --git a/Modules/SharePointDsc/en-US/about_SPSearchServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchServiceApp.help.txt index 90bc720ee..5f0463e09 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for provisioning the search service application. The current version lets you specify the database name and server, as well as diff --git a/Modules/SharePointDsc/en-US/about_SPSearchTopology.help.txt b/Modules/SharePointDsc/en-US/about_SPSearchTopology.help.txt index 47784d4f2..93e38a46d 100644 --- a/Modules/SharePointDsc/en-US/about_SPSearchTopology.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSearchTopology.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for provisioning a search topology in to the current farm. It allows the configuration to dictate the search topology roles diff --git a/Modules/SharePointDsc/en-US/about_SPSecureStoreServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPSecureStoreServiceApp.help.txt index bf5f94015..f865daa12 100644 --- a/Modules/SharePointDsc/en-US/about_SPSecureStoreServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSecureStoreServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for provisioning and configuring the secure store service application. The parameters passed in (except those related to database diff --git a/Modules/SharePointDsc/en-US/about_SPSecurityTokenServiceConfig.help.txt b/Modules/SharePointDsc/en-US/about_SPSecurityTokenServiceConfig.help.txt index 0812616ea..c25220d64 100644 --- a/Modules/SharePointDsc/en-US/about_SPSecurityTokenServiceConfig.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSecurityTokenServiceConfig.help.txt @@ -4,13 +4,19 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuring the Security Token Service within the local SharePoint farm. Using Ensure equals to Absent is not supported. This resource can only apply configuration, not ensure they don't exist. +.PARAMETER IsSingleInstance + Key - String + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' + .PARAMETER Name - Key - string + Required - string The name of the security token service .PARAMETER NameIdentifier @@ -43,7 +49,7 @@ This example configures the Security Token Service - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -55,6 +61,7 @@ node localhost { SPSecurityTokenServiceConfig SecurityTokenService { + IsSingleInstance = "Yes" Name = "SPSecurityTokenService" NameIdentifier = "00000003-0000-0ff1-ce00-000000000000@9f11c5ea-2df9-4950-8dcf-da8cd7aa4eff" UseSessionCookies = $false diff --git a/Modules/SharePointDsc/en-US/about_SPSelfServiceSiteCreation.help.txt b/Modules/SharePointDsc/en-US/about_SPSelfServiceSiteCreation.help.txt index 4044d0d72..d59b69c11 100644 --- a/Modules/SharePointDsc/en-US/about_SPSelfServiceSiteCreation.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSelfServiceSiteCreation.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure self-service site creation on a web application. @@ -26,7 +27,7 @@ SharePoint Online. This requires that [hybrid self-service site creation](https://docs.microsoft.com/en-us/sharepoint/hybrid/hybrid-self-service-site-creation) is configured using the Hybrid Picker. -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The url of the web application @@ -72,3 +73,83 @@ POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 +.EXAMPLE + This example shows how to configure self-service site creation for a web application + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPSelfServiceSiteCreation SSC + { + WebAppUrl = "http://example.contoso.local" + Enabled = $true + OnlineEnabled = $false + QuotaTemplate = "SSCQoutaTemplate" + ShowStartASiteMenuItem = $true + CreateIndividualSite = $true + PolicyOption = "CanHavePolicy" + RequireSecondaryContact = $false + PsDscRunAsCredential = $SetupAccount + } + } + } + + +.EXAMPLE + This example shows how to configure self-service site creation with a custom form for a web application + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPSelfServiceSiteCreation SSC + { + WebAppUrl = "http://example.contoso.local" + Enabled = $true + ShowStartASiteMenuItem = $true + CustomFormUrl = "http://ssc.contoso.com.local/ssc" + PsDscRunAsCredential = $SetupAccount + } + } + } + + +.EXAMPLE + This example shows how to disable self-service site creation for a web application + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPSelfServiceSiteCreation SSC + { + WebAppUrl = "http://example.contoso.local" + Enabled = $false + PsDscRunAsCredential = $SetupAccount + } + } + } + + diff --git a/Modules/SharePointDsc/en-US/about_SPServiceAppPool.help.txt b/Modules/SharePointDsc/en-US/about_SPServiceAppPool.help.txt index 7a61d86f7..313972269 100644 --- a/Modules/SharePointDsc/en-US/about_SPServiceAppPool.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPServiceAppPool.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used for provisioning an application pool that can be used for service applications. The account used for the service account must already be diff --git a/Modules/SharePointDsc/en-US/about_SPServiceAppProxyGroup.help.txt b/Modules/SharePointDsc/en-US/about_SPServiceAppProxyGroup.help.txt index 998180edb..8f2391453 100644 --- a/Modules/SharePointDsc/en-US/about_SPServiceAppProxyGroup.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPServiceAppProxyGroup.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to manage SharePoint Service Application Proxy Groups. The "Ensure" parameter controls whether or not the Proxy Group should exist. A diff --git a/Modules/SharePointDsc/en-US/about_SPServiceAppSecurity.help.txt b/Modules/SharePointDsc/en-US/about_SPServiceAppSecurity.help.txt index df557c5cc..991887cff 100644 --- a/Modules/SharePointDsc/en-US/about_SPServiceAppSecurity.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPServiceAppSecurity.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to manage the sharing security settings of a specific service application. There are a number of approaches to how this can be @@ -22,6 +23,47 @@ In order to specify Local Farm you can use the token "\{LocalFarm\}" as the username. The token is case sensitive. + ## Permission overview + + Available permissions for Administrators are Full Control except for these + service applications: + + Secure Store Service Application: + + - Full Control + - Create Target Application + - Delete Target Application + - Manage Target Application + - All Target Applications + + User Profile Service Application: + + - Full Control + - Manage Profiles + - Manage Audiences + - Manage Permissions + - Retrieve People Data for Search Crawlers + - Manage Social Data + + Search Service Application: + + - Full Control + - Read (Diagnostics Pages Only) + + Permissions for Sharing Permissions are Full Control except for these + service applications: + + Managed Metadata Service Application: + + - Read Access to Term Store + - Read and Restricted Write Access to Term Store + - Full Access to Term Store + + NOTE: + Multiple permissions can be specified for each principal. Full Control + will include all other permissions. It is not required to specify all + available permissions if Full Control is specified. + .PARAMETER ServiceAppName Key - String The name of the service application you wish to apply security settings to @@ -49,12 +91,13 @@ .EXAMPLE - This example shows how full control permission can be given to the farm - account and service app pool account to the user profile service app's + This example shows how full control permission can be given to the farm + account and service app pool account to the user profile service app's sharing permission. + It also shows granting access to specific areas to a user. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -66,12 +109,16 @@ node localhost { $membersToInclude = @() $membersToInclude += MSFT_SPServiceAppSecurityEntry { - Username = "CONTOSO\SharePointFarmAccount" - AccessLevel = "Full Control" + Username = "CONTOSO\SharePointFarmAccount" + AccessLevels = @("Full Control") + } + $membersToInclude += MSFT_SPServiceAppSecurityEntry { + Username = "CONTOSO\SharePointServiceApps" + AccessLevels = @("Full Control") } $membersToInclude += MSFT_SPServiceAppSecurityEntry { - Username = "CONTOSO\SharePointServiceApps" - AccessLevel = "Full Control" + Username = "CONTOSO\User1" + AccessLevels = @("Manage Profiles", "Manage Social Data") } SPServiceAppSecurity UserProfileServiceSecurity { @@ -79,19 +126,19 @@ SecurityType = "SharingPermissions" MembersToInclude = $membersToInclude MembersToExclude = @("CONTOSO\BadAccount1", "CONTOSO\BadAccount2") - PsDscRunAsCredential = $SetupAccount + PsDscRunAsCredential = $SetupAccount } } } .EXAMPLE - This example shows how to use the local farm token to grant - full control permission to the local farm to the + This example shows how to use the local farm token to grant + full control permission to the local farm to the user profile service app's sharing permission. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -103,15 +150,15 @@ node localhost { $members = @() $members += MSFT_SPServiceAppSecurityEntry { - Username = "{LocalFarm}" - AccessLevel = "Full Control" + Username = "{LocalFarm}" + AccessLevels = @("Full Control") } SPServiceAppSecurity UserProfileServiceSecurity { ServiceAppName = "User Profile Service Application" SecurityType = "SharingPermissions" Members = $members - PsDscRunAsCredential = $SetupAccount + PsDscRunAsCredential = $SetupAccount } } } diff --git a/Modules/SharePointDsc/en-US/about_SPServiceIdentity.help.txt b/Modules/SharePointDsc/en-US/about_SPServiceIdentity.help.txt index 05a0d9e23..079c2d27c 100644 --- a/Modules/SharePointDsc/en-US/about_SPServiceIdentity.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPServiceIdentity.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to specify a managed account to be used to run a service instance. You can also specify LocalService, LocalSystem or NetworkService as ManagedAccount. diff --git a/Modules/SharePointDsc/en-US/about_SPServiceInstance.help.txt b/Modules/SharePointDsc/en-US/about_SPServiceInstance.help.txt index 6296109a1..68330cf6d 100644 --- a/Modules/SharePointDsc/en-US/about_SPServiceInstance.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPServiceInstance.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Specific + **Requires CredSSP:** No This resource is used to specify if a specific service should be running (Ensure = "Present") or not running (Ensure = "Absent") on the current server. diff --git a/Modules/SharePointDsc/en-US/about_SPSessionStateService.help.txt b/Modules/SharePointDsc/en-US/about_SPSessionStateService.help.txt index 873001830..bd2261a38 100644 --- a/Modules/SharePointDsc/en-US/about_SPSessionStateService.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSessionStateService.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will provision a state service app to the local farm. Specify the name of the database server and database name to provision the app with, diff --git a/Modules/SharePointDsc/en-US/about_SPShellAdmins.help.txt b/Modules/SharePointDsc/en-US/about_SPShellAdmins.help.txt index d35cb799c..bda7639b0 100644 --- a/Modules/SharePointDsc/en-US/about_SPShellAdmins.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPShellAdmins.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to manage the users with Shell Admin permissions. There are a number of approaches to how this can be implemented. The "Members" @@ -42,9 +43,10 @@ cannot add it to the Shell Admins (common for AllContentDatabases parameter) and the resource will throw an error. Workaround: Change database owner in SQL -.PARAMETER Name +.PARAMETER IsSingleInstance Key - String - Name for the config, used for administration purposes + Allowed values: Yes + Specifies the resource is a single instance, the value must be 'Yes' .PARAMETER Members Write - String @@ -80,7 +82,7 @@ all content databases in the local farm. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -92,9 +94,9 @@ node localhost { SPShellAdmins ShellAdmins { - Name = "Shell Admins" - Members = "CONTOSO\user1", "CONTOSO\user2" - AllDatabases = $true + IsSingleInstance = "Yes" + Members = "CONTOSO\user1", "CONTOSO\user2" + AllDatabases = $true } } } @@ -105,7 +107,7 @@ all content databases in the local farm. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -117,9 +119,9 @@ node localhost { SPShellAdmins ShellAdmins { - Name = "Shell Admins" - Members = "CONTOSO\user1", "CONTOSO\user2" - Databases = @( + IsSingleInstance = "Yes" + Members = "CONTOSO\user1", "CONTOSO\user2" + Databases = @( @(MSFT_SPDatabasePermissions { Name = "SharePoint_Content_1" Members = "CONTOSO\user2", "CONTOSO\user3" @@ -152,7 +154,7 @@ node localhost { SPShellAdmins ShellAdmins { - Name = "Shell Admins" + IsSingleInstance = "Yes" Members = "CONTOSO\user1", "CONTOSO\user2" AllDatabases = $true ExcludeDatabases = "WSS_Content_Portal" diff --git a/Modules/SharePointDsc/en-US/about_SPSite.help.txt b/Modules/SharePointDsc/en-US/about_SPSite.help.txt index 25972ab8c..8fd06e444 100644 --- a/Modules/SharePointDsc/en-US/about_SPSite.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSite.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will provision a site collection to the current farm, based on the settings that are passed through. These settings map to the New-SPSite @@ -89,7 +90,7 @@ .PARAMETER AdministrationSiteType Write - string Allowed values: TenantAdministration, None - The administration site type + Specifies the type of the site collection: Regular site or tenant administration site .PARAMETER InstallAccount Write - String diff --git a/Modules/SharePointDsc/en-US/about_SPSiteUrl.help.txt b/Modules/SharePointDsc/en-US/about_SPSiteUrl.help.txt index 6975b2f84..476a3c355 100644 --- a/Modules/SharePointDsc/en-US/about_SPSiteUrl.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSiteUrl.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will configure the site url for a host named site collection. There are four available zones to configure: Intranet, Internet, Extranet diff --git a/Modules/SharePointDsc/en-US/about_SPStateServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPStateServiceApp.help.txt index 3f86c150a..b9c70d895 100644 --- a/Modules/SharePointDsc/en-US/about_SPStateServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPStateServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource provisions an instance of the state service in to the local farm. The database specific parameters are only used during initial provisioning of diff --git a/Modules/SharePointDsc/en-US/about_SPSubscriptionSettingsServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPSubscriptionSettingsServiceApp.help.txt index 48fa80533..9a9dcd244 100644 --- a/Modules/SharePointDsc/en-US/about_SPSubscriptionSettingsServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPSubscriptionSettingsServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to provision and manage an instance of the App Management Services Service Application. It will identify an instance of the subscription diff --git a/Modules/SharePointDsc/en-US/about_SPTimerJobState.help.txt b/Modules/SharePointDsc/en-US/about_SPTimerJobState.help.txt index 95c14b49f..126b5fc78 100644 --- a/Modules/SharePointDsc/en-US/about_SPTimerJobState.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPTimerJobState.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure a timer job and make sure it is in a specific state. The resource can be used to enable or disabled the job and diff --git a/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuer.help.txt b/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuer.help.txt index fc2ad394c..9ffd968f2 100644 --- a/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuer.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuer.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to create or remove SPTrustedIdentityTokenIssuer in a SharePoint farm. diff --git a/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuerProviderRealms.help.txt b/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuerProviderRealms.help.txt index 837832af7..2b2005933 100644 --- a/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuerProviderRealms.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPTrustedIdentityTokenIssuerProviderRealms.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to add or remove provider realms to SPTrustedIdentityTokenIssuer in a SharePoint farm. The "ProviderRealms" diff --git a/Modules/SharePointDsc/en-US/about_SPTrustedRootAuthority.help.txt b/Modules/SharePointDsc/en-US/about_SPTrustedRootAuthority.help.txt new file mode 100644 index 000000000..bb21df75f --- /dev/null +++ b/Modules/SharePointDsc/en-US/about_SPTrustedRootAuthority.help.txt @@ -0,0 +1,81 @@ +.NAME + SPTrustedRootAuthority + +# Description + + **Type:** Distributed + **Requires CredSSP:** No + + This resource is used to create or remove SPTrustedRootAuthority in a + SharePoint farm. It imports the certificate into SharePoint in order for + high trust apps or consuming service applications from other farms will + work. + +.PARAMETER Name + Key - String + Specifies the name of the trusted root authority to create. + +.PARAMETER CertificateThumbprint + Required - String + Specifies the X.509 certificate of the trusted root authority, as a certificate thumbprint. + +.PARAMETER Ensure + Write - String + Allowed values: Present, Absent + Present ensures the trusted root authority exists, absent ensures it is removed + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 + + +.EXAMPLE + This example deploys a SP Trusted Root Authority to the local farm. + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPTrustedRootAuthority SampleRootAuthority + { + Name = "Contoso" + CertificateThumbprint = "770515261D1AB169057E246E0EE6431D557C3AFB" + Ensure = "Present" + PsDscRunAsCredential = $SetupAccount + } + } + } + + +.EXAMPLE + This example removes a SP Trusted Root Authority from the local farm. + + + Configuration Example + { + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + SPTrustedRootAuthority SampleRootAuthority + { + Name = "Contoso" + CertificateThumbprint = "770515261D1AB169057E246E0EE6431D557C3AFB" + Ensure = "Absent" + PsDscRunAsCredential = $SetupAccount + } + } + } + + diff --git a/Modules/SharePointDsc/en-US/about_SPUsageApplication.help.txt b/Modules/SharePointDsc/en-US/about_SPUsageApplication.help.txt index 3a935104f..8654c0986 100644 --- a/Modules/SharePointDsc/en-US/about_SPUsageApplication.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUsageApplication.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource provisions an instance of the usage and health monitoring service application. The database settings are only used for initial provisioning, but diff --git a/Modules/SharePointDsc/en-US/about_SPUserProfileProperty.help.txt b/Modules/SharePointDsc/en-US/about_SPUserProfileProperty.help.txt index b15ea0204..77226fd26 100644 --- a/Modules/SharePointDsc/en-US/about_SPUserProfileProperty.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUserProfileProperty.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will create a property in a user profile service application. It creates, update or delete a property using the parameters that are passed in to @@ -16,8 +17,6 @@ Length is only relevant if Field type is "String". - This Resource doesn't currently support removing existing user profile - The default value for the Ensure parameter is Present. When not specifying this parameter, the user profile property is created. @@ -57,17 +56,9 @@ Allowed values: Public, Contacts, Organization, Manager, Private The privacy setting for the property -.PARAMETER MappingConnectionName - Write - string - The name of the UPS connect to map this property to - -.PARAMETER MappingPropertyName +.PARAMETER PropertyMappings Write - string - The name of the property from the UPS connection to map to - -.PARAMETER MappingDirection - Write - string - The direction of the mapping, either Import or Export + The details about the property mapping .PARAMETER Length Write - uint32 @@ -118,7 +109,7 @@ The name of the term set to allow values to be selected from .PARAMETER InstallAccount - Write - String + Write - string POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 @@ -127,44 +118,49 @@ app - Configuration Example - { - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $SetupAccount - ) - Import-DscResource -ModuleName SharePointDsc - - node localhost { - SPUserProfileProperty WorkEmailProperty - { - Name = "WorkEmail2" - Ensure = "Present" - UserProfileService = "User Profile Service Application" - DisplayName = "Work Email" - Type = "Email" - Description = "" #implementation isn't using it yet - PolicySetting = "Mandatory" - PrivacySetting = "Public" - MappingConnectionName = "contoso.com" - MappingPropertyName = "mail" - MappingDirection = "Import" - Length = 10 - DisplayOrder =25 - IsEventLog =$false - IsVisibleOnEditor=$true - IsVisibleOnViewer = $true - IsUserEditable = $true - IsAlias = $false - IsSearchable = $false - TermStore = "" - TermGroup = "" - TermSet = "" - UserOverridePrivacy = $false - PsDscRunAsCredential = $SetupAccount - } +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $SetupAccount + ) + Import-DscResource -ModuleName SharePointDsc + + node localhost { + + SPUserProfileProperty WorkEmailProperty + { + Name = "WorkEmail2" + Ensure = "Present" + UserProfileService = "User Profile Service Application" + DisplayName = "Work Email" + Type = "Email" + Description = "" #implementation isn't using it yet + PolicySetting = "Mandatory" + PrivacySetting = "Public" + PropertyMappings = @( + MSFT_SPUserProfilePropertyMapping { + ConnectionName = "contoso.com" + PropertyName = "mail" + Direction = "Import" + } + ) + Length = 10 + DisplayOrder = 25 + IsEventLog = $false + IsVisibleOnEditor = $true + IsVisibleOnViewer = $true + IsUserEditable = $true + IsAlias = $false + IsSearchable = $false + TermStore = "" + TermGroup = "" + TermSet = "" + UserOverridePrivacy = $false + PsDscRunAsCredential = $SetupAccount } } +} diff --git a/Modules/SharePointDsc/en-US/about_SPUserProfileSection.help.txt b/Modules/SharePointDsc/en-US/about_SPUserProfileSection.help.txt index f298036a2..11a9f7ea0 100644 --- a/Modules/SharePointDsc/en-US/about_SPUserProfileSection.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUserProfileSection.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will create a section in a user profile service application. It creates, update or delete a section using the parameters that are passed in to diff --git a/Modules/SharePointDsc/en-US/about_SPUserProfileServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPUserProfileServiceApp.help.txt index 2ab8ccba5..eaaa0d399 100644 --- a/Modules/SharePointDsc/en-US/about_SPUserProfileServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUserProfileServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** Yes This resource will provision an instance of the user profile service to the farm. It creates the required databases using the parameters that are passed diff --git a/Modules/SharePointDsc/en-US/about_SPUserProfileServiceAppPermissions.help.txt b/Modules/SharePointDsc/en-US/about_SPUserProfileServiceAppPermissions.help.txt index 89470cea2..2b250c58e 100644 --- a/Modules/SharePointDsc/en-US/about_SPUserProfileServiceAppPermissions.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUserProfileServiceAppPermissions.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will apply permissions to a user profile service application. These can control access to create my sites, use social features, and use diff --git a/Modules/SharePointDsc/en-US/about_SPUserProfileSyncConnection.help.txt b/Modules/SharePointDsc/en-US/about_SPUserProfileSyncConnection.help.txt index b37f0f99a..9303edc25 100644 --- a/Modules/SharePointDsc/en-US/about_SPUserProfileSyncConnection.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUserProfileSyncConnection.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will ensure a specifc user profile sync connection is in place and that it is configured accordingly to its definition diff --git a/Modules/SharePointDsc/en-US/about_SPUserProfileSyncService.help.txt b/Modules/SharePointDsc/en-US/about_SPUserProfileSyncService.help.txt index 8975104ec..42ae55316 100644 --- a/Modules/SharePointDsc/en-US/about_SPUserProfileSyncService.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPUserProfileSyncService.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Specific + **Requires CredSSP:** Yes This resource is responsible for ensuring that the user profile sync service has been provisioned (Ensure = "Present") or is not running (Ensure = diff --git a/Modules/SharePointDsc/en-US/about_SPVisioServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPVisioServiceApp.help.txt index e5819b715..5a7cf1b9c 100644 --- a/Modules/SharePointDsc/en-US/about_SPVisioServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPVisioServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating Visio Graphics Service Application instances within the local SharePoint farm. The resource will provision and diff --git a/Modules/SharePointDsc/en-US/about_SPWeb.help.txt b/Modules/SharePointDsc/en-US/about_SPWeb.help.txt index fe4b41121..56dfc25df 100644 --- a/Modules/SharePointDsc/en-US/about_SPWeb.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWeb.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will provision a SPWeb based on the settings that are passed through. These settings map to the New-SPWeb cmdlet and accept the same values diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppAuthentication.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppAuthentication.help.txt index 95c0c65f8..2ee0cff66 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppAuthentication.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppAuthentication.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for configuring the authentication on a web application within the local SharePoint farm. The resource is able to diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppBlockedFileTypes.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppBlockedFileTypes.help.txt index 6c00a2e51..9c1e71b49 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppBlockedFileTypes.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppBlockedFileTypes.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No 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 @@ -17,7 +18,7 @@ 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 -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web application to set blocked file types for @@ -39,12 +40,12 @@ .EXAMPLE - This example shows how to ensure that specific file types are always blocked while + This example shows how to ensure that specific file types are always blocked while others will always be allowed. Any file types not mentioned in this config will be able to be managed manually. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -56,7 +57,7 @@ node localhost { SPWebAppBlockedFileTypes PrimaryWebAppBlockedFileTypes { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" EnsureBlocked = @("exe", "dll", "msi") EnsureAllowed = @("pdf", "docx", "xlsx") PsDscRunAsCredential = $SetupAccount @@ -70,7 +71,7 @@ specifically matches this list. - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -82,7 +83,7 @@ node localhost { SPWebAppBlockedFileTypes PrimaryWebAppBlockedFileTypes { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" Blocked = @("exe", "dll", "msi") PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppClientCallableSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppClientCallableSettings.help.txt index 14b999c8a..c218791b1 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppClientCallableSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppClientCallableSettings.help.txt @@ -4,12 +4,13 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource sets the client callable settings for the web application. It can set the proxy libraries and specific properties for the client - callable settings. - The resource can for example be used to increase the timeout for client - code, and to enable the tenant administration functionality. + callable settings. The resource can for example be used to increase the + timeout for client code, and to enable the tenant administration + functionality. Tenant administration functionality enables client code to work with the namespace Microsoft.Online.SharePoint.Client.Tenant from the @@ -37,7 +38,7 @@ Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub , Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - **SharePoint 2016**: + **SharePoint 2016/2019**: Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub , Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c @@ -47,7 +48,7 @@ An IIS reset needs to be performed on all servers in the farm after modifying the registered proxy libraries. -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web application to set blocked file types for @@ -120,7 +121,7 @@ node localhost { SPWebAppClientCallableSettings DefaultClientCallableSettings { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" MaxResourcesPerRequest = 16 MaxObjectPaths = 256 ExecutionTimeout = 90 @@ -158,7 +159,7 @@ SPWebAppClientCallableSettings TenantAdministration { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" ProxyLibraries = $proxyLibraries PsDscRunAsCredential = $SetupAccount } diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppGeneralSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppGeneralSettings.help.txt index e19a2bcb8..8825ced80 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppGeneralSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppGeneralSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for setting web application settings that are found under the "general settings" screen in central admin. The web @@ -11,7 +12,7 @@ settings can be applied. Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web app to set the general settings for @@ -102,11 +103,11 @@ .EXAMPLE - This example shows how to apply some of the available general settings to the + This example shows how to apply some of the available general settings to the specified web app - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -118,7 +119,7 @@ node localhost { SPWebAppGeneralSettings PrimaryWebAppGeneralSettings { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" TimeZone = 76 Alerts = $true RSS = $false diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppPeoplePickerSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppPeoplePickerSettings.help.txt index 556fb2333..b8f01206b 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppPeoplePickerSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppPeoplePickerSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to configure the People Picker settings for a web application. diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppPermissions.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppPermissions.help.txt index ec399bd14..eeecb1ecb 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppPermissions.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppPermissions.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for managing the user permissions for a web application. You can either specify to set all permissions or specify diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppPolicy.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppPolicy.help.txt index 0a6ce43e1..93ac24f56 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppPolicy.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppPolicy.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to set the User Policies for web applications. The usernames can be either specified in Classic or Claims format, both will be diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppPropertyBag.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppPropertyBag.help.txt index 0a91519b8..9c1975845 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppPropertyBag.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppPropertyBag.help.txt @@ -4,13 +4,14 @@ # Description **Type:** Distributed + **Requires CredSSP:** No - This resource is used to work with SharePoint Property Bags - at the web application level. - The account that runs this resource must be a farm administrator. + This resource is used to work with SharePoint Property Bags at the web + application level. The account that runs this resource must be a farm + administrator. - The default value for the Ensure parameter is Present. When not specifying this - parameter, the property bag is configured. + The default value for the Ensure parameter is Present. When not specifying + this parameter, the property bag is configured. .PARAMETER WebAppUrl Key - string diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppProxyGroup.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppProxyGroup.help.txt index 726b24e8f..62800c8bb 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppProxyGroup.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppProxyGroup.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to associate a web application to a service application proxy group. Use the proxy group name "Default" to associate the web diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppSiteUseAndDeletion.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppSiteUseAndDeletion.help.txt index a8cbe3e18..2bebd9a97 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppSiteUseAndDeletion.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppSiteUseAndDeletion.help.txt @@ -4,13 +4,14 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for controlling the Site Use and Deletion settings on a specific web application. You can enable or disable the Site Use and Deletion feature, specify the amount of days after which the alerts are being send, if sites have to be deleted automatically and if so after how many -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web application @@ -51,7 +52,7 @@ node localhost { SPWebAppSiteUseAndDeletion ConfigureSiteUseAndDeletion { - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppSuiteBar.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppSuiteBar.help.txt index 5f7e74cb9..1f1da82f0 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppSuiteBar.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppSuiteBar.help.txt @@ -4,14 +4,15 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to set the Suite Bar branding for web applications. It supports both the SharePoint 2013 and SharePoint - 2016 ways of branding the suite bar. + 2016/2019 ways of branding the suite bar. Requirements: - For SharePoint 2013, only the SuiteBarBrandingElementHtml - should be specified, whereas for SharePoint 2016, all properties + For SharePoint 2013, only the SuiteBarBrandingElementHtml should + be specified, whereas for SharePoint 2016/2019, all properties are supported. Note that SuiteBarBrandingElementHtml has no effect unless using a SharePoint 2013 master page. @@ -46,7 +47,7 @@ .EXAMPLE This example sets the branding for the suite bar of a given - Web Application in SharePoint 2016. + Web Application in SharePoint 2016/2019. Configuration Example diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppThrottlingSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppThrottlingSettings.help.txt index 6b21ce165..8e62dc284 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppThrottlingSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppThrottlingSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for setting web application settings that are found under the "resource throttling" screen in central admin. The web @@ -13,7 +14,7 @@ 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 -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web application @@ -70,7 +71,7 @@ This example shows how to apply throttling settings to a specific web app - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -82,7 +83,7 @@ node localhost { SPWebAppThrottlingSettings PrimaryWebAppThrottlingSettings { - Url = "http://exmaple.contoso.local" + WebAppUrl = "http://exmaple.contoso.local" ListViewThreshold = 5000 AllowObjectModelOverride = $false HappyHourEnabled = $true diff --git a/Modules/SharePointDsc/en-US/about_SPWebAppWorkflowSettings.help.txt b/Modules/SharePointDsc/en-US/about_SPWebAppWorkflowSettings.help.txt index fe71b8148..656211252 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebAppWorkflowSettings.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebAppWorkflowSettings.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for setting web application settings that are found under the "workflow settings" screen in central admin. The web @@ -11,7 +12,7 @@ settings can be applied. Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). -.PARAMETER Url +.PARAMETER WebAppUrl Key - string The URL of the web application @@ -36,7 +37,7 @@ This example shows how to apply workflow settings to the specific web application - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -48,7 +49,7 @@ node localhost { SPWebAppWorkflowSettings PrimaryWebAppWorkflowSettings { - Url = "Shttp://exmaple.contoso.local" + WebAppUrl = "Shttp://exmaple.contoso.local" ExternalWorkflowParticipantsEnabled = $false EmailToNoPermissionWorkflowParticipantsEnable = $false PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/en-US/about_SPWebApplication.help.txt b/Modules/SharePointDsc/en-US/about_SPWebApplication.help.txt index 4962bccfd..c1cd03a9f 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebApplication.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebApplication.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for creating a web application within the local SharePoint farm. The resource will provision the web application with all of @@ -33,7 +34,7 @@ Required - string The name of the managed account to run the app pool with -.PARAMETER Url +.PARAMETER WebAppUrl Required - string The URL of the web application @@ -97,7 +98,7 @@ AllowAnonymous = $false DatabaseName = "SP_Content_01" DatabaseServer = "SQL.contoso.local\SQLINSTANCE" - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" Port = 80 Ensure = "Present" PsDscRunAsCredential = $SetupAccount diff --git a/Modules/SharePointDsc/en-US/about_SPWebApplicationAppDomain.help.txt b/Modules/SharePointDsc/en-US/about_SPWebApplicationAppDomain.help.txt index 351b54ed1..e27025010 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebApplicationAppDomain.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebApplicationAppDomain.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource will configure the App Domain at a specific zone for the given Web Application. The configuration is done per zone on the specified web @@ -11,7 +12,7 @@ of a web application. The app prefix should still be set using the SPAppDomain resource before this is applied to customise a specific zone. -.PARAMETER WebApplication +.PARAMETER WebAppUrl Key - string The URL of the web application to set the app domain for @@ -41,7 +42,7 @@ This example shows how to set the app domain for a specified web application - Configuration Example + Configuration Example { param( [Parameter(Mandatory = $true)] @@ -54,7 +55,7 @@ SPWebApplicationAppDomain Domain { AppDomain = "contosointranetapps.com" - WebApplication ="http://portal.contoso.com"; + WebAppUrl ="http://portal.contoso.com"; Zone = "Default"; Port = 80; SSL = $false; diff --git a/Modules/SharePointDsc/en-US/about_SPWebApplicationExtension.help.txt b/Modules/SharePointDsc/en-US/about_SPWebApplicationExtension.help.txt index 3911fc15d..609149451 100644 --- a/Modules/SharePointDsc/en-US/about_SPWebApplicationExtension.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWebApplicationExtension.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is responsible for extending an existing web application into a new zone. The resource will provision the web application extension with all of diff --git a/Modules/SharePointDsc/en-US/about_SPWordAutomationServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPWordAutomationServiceApp.help.txt index e902221ee..d8aab140f 100644 --- a/Modules/SharePointDsc/en-US/about_SPWordAutomationServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWordAutomationServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No The resource is able to provision, unprovision and configure the Word Automation Service Application. All settings that you can configure on the diff --git a/Modules/SharePointDsc/en-US/about_SPWorkManagementServiceApp.help.txt b/Modules/SharePointDsc/en-US/about_SPWorkManagementServiceApp.help.txt index ec7b9d855..b8050ab56 100644 --- a/Modules/SharePointDsc/en-US/about_SPWorkManagementServiceApp.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWorkManagementServiceApp.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to provision and manage an instance of the Work Management Services Service Application. It will identify an instance of the @@ -22,8 +23,8 @@ parameter, the service application is provisioned. NOTE: - You cannot use this resource with SharePoint 2016, since the Work - Management functionality has been removed in SharePoint 2016. + You cannot use this resource with SharePoint 2016/2019, since the Work + Management functionality has been removed in SharePoint 2016/2019. More information: https://technet.microsoft.com/en-us/library/mt346112(v=office.16).aspx diff --git a/Modules/SharePointDsc/en-US/about_SPWorkflowService.help.txt b/Modules/SharePointDsc/en-US/about_SPWorkflowService.help.txt index 1b64effe7..62304ade7 100644 --- a/Modules/SharePointDsc/en-US/about_SPWorkflowService.help.txt +++ b/Modules/SharePointDsc/en-US/about_SPWorkflowService.help.txt @@ -4,6 +4,7 @@ # Description **Type:** Distributed + **Requires CredSSP:** No This resource is used to register the SharePoint Server against a Workflow Manager Instance. diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPAntivirusSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPAntivirusSettings.Tests.ps1 index 7a1af61df..d3533601e 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPAntivirusSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPAntivirusSettings.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -18,9 +18,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope - # Test contexts + # Test contexts Context -Name "The server is not part of SharePoint farm" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" ScanOnDownload = $true ScanOnUpload = $true AllowDownloadInfected = $true @@ -29,8 +30,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { NumberOfThreads = 5 } - Mock -CommandName Get-SPFarm -MockWith { - throw "Unable to detect local farm" + Mock -CommandName Get-SPFarm -MockWith { + throw "Unable to detect local farm" } It "Should return null from the get method" { @@ -54,6 +55,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm and the incorrect settings have been applied" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" ScanOnDownload = $true ScanOnUpload = $true AllowDownloadInfected = $true @@ -74,9 +76,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { TotalSeconds = 0; } } - } - $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { - $Global:SPDscAntivirusUpdated = $true + } + $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { + $Global:SPDscAntivirusUpdated = $true } -PassThru return $returnVal } @@ -99,6 +101,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm and the correct settings have been applied" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" ScanOnDownload = $true ScanOnUpload = $true AllowDownloadInfected = $true @@ -132,7 +135,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Test-TargetResource @testParams | Should Be $true } } - } + } } Invoke-Command -ScriptBlock $Global:SPDscHelper.CleanupScript -NoNewScope diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPBlobCacheSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPBlobCacheSettings.Tests.ps1 index 3ebf2bf3f..26b727ae0 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPBlobCacheSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPBlobCacheSettings.Tests.ps1 @@ -48,11 +48,31 @@ namespace Microsoft.SharePoint.Administration { } Mock -CommandName Get-SPServiceInstance -MockWith { - return @(@{ - TypeName = "Microsoft SharePoint Foundation Web Application" - }) + return @( + @{ + Name = "" + TypeName = "Microsoft SharePoint Foundation Web Application" + } | Add-Member -MemberType ScriptMethod ` + -Name GetType ` + -Value { + return @{ + Name = "SPWebServiceInstance" + } + } -PassThru -Force | Add-Member -Name Name ` + -MemberType ScriptProperty ` + -PassThru ` + { + # get + "" + }` + { + # set + param ( $arg ) + } + ) } + function Update-SPDscTestConfigFile { [CmdletBinding()] @@ -97,7 +117,7 @@ namespace Microsoft.SharePoint.Administration { Zone = "Default" EnableCache = $true Location = "c:\BlobCache" - MaxSizeInGB = 30 + MaxSizeInGB = 30 FileTypes = "\.(gif|jpg|jpeg)$" } @@ -330,7 +350,27 @@ namespace Microsoft.SharePoint.Administration { ' Mock -CommandName Test-Path -MockWith { return $true } - Mock -CommandName Get-SPServiceInstance -MockWith { return $null } + Mock -CommandName Get-SPServiceInstance -MockWith { + return @( + $null | Add-Member -MemberType ScriptMethod ` + -Name GetType ` + -Value { + return @{ + Name = "SPWebServiceInstance" + } + } -PassThru -Force | Add-Member -Name Name ` + -MemberType ScriptProperty ` + -PassThru ` + { + # get + "" + }` + { + # set + param ( $arg ) + } + ) + } It "Should return values from the get method" { (Get-TargetResource @testParams).WebAppUrl | Should BeNullOrEmpty diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPConfigWizard.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPConfigWizard.Tests.ps1 index f009c5da7..a7d7ae418 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPConfigWizard.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPConfigWizard.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -21,7 +21,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "Upgrade required for Language Pack" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" } Mock -CommandName Get-SPDSCRegistryKey -MockWith { @@ -31,9 +31,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 } } @@ -53,9 +53,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Upgrade required for Cumulative Update" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -63,9 +63,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 } } @@ -85,10 +85,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Current date outside Upgrade Days" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "mon" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -98,7 +98,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $testDate = Get-Date -Day 17 -Month 7 -Year 2016 -Hour 12 -Minute 00 -Second 00 Mock -CommandName Get-Date -MockWith { - return $testDate + return $testDate } It "Should return Ensure=Absent from the get method" { @@ -116,11 +116,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Current date outside Upgrade Time" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sun" DatabaseUpgradeTime = "3:00am to 5:00am" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -140,11 +140,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Upgrade Time incorrectly formatted" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sun" DatabaseUpgradeTime = "error 3:00am to 5:00am" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -154,7 +154,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $testDate = Get-Date -Day 17 -Month 7 -Year 2016 -Hour 12 -Minute 00 -Second 00 Mock -CommandName Get-Date -MockWith { - return $testDate + return $testDate } It "Should return exception from the set method" { @@ -164,11 +164,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Start time Upgrade Time incorrectly formatted" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sun" DatabaseUpgradeTime = "3:00xm to 5:00am" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -178,7 +178,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $testDate = Get-Date -Day 17 -Month 7 -Year 2016 -Hour 12 -Minute 00 -Second 00 Mock -CommandName Get-Date -MockWith { - return $testDate + return $testDate } It "Should return exception from the set method" { @@ -188,11 +188,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "End time Upgrade Time incorrectly formatted" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sun" DatabaseUpgradeTime = "3:00am to 5:00xm" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -212,11 +212,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Start time of Upgrade Time larger than end time" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" DatabaseUpgradeDays = "sun" DatabaseUpgradeTime = "3:00pm to 5:00am" } - + Mock -CommandName Get-SPDSCRegistryKey -MockWith { if ($Value -eq "SetupType") { @@ -226,7 +226,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $testDate = Get-Date -Day 17 -Month 7 -Year 2016 -Hour 12 -Minute 00 -Second 00 Mock -CommandName Get-Date -MockWith { - return $testDate + return $testDate } It "Should return exception from the set method" { @@ -236,7 +236,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "ExitCode of process is not 0" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" } Mock -CommandName Get-SPDSCRegistryKey -MockWith { @@ -246,9 +246,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Start-Process -MockWith { return - @{ - ExitCode = -1 + Mock -CommandName Start-Process -MockWith { return + @{ + ExitCode = -1 } } @@ -267,16 +267,17 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Ensure is set to Absent, Config Wizard not required" -Fixture { $testParams = @{ - Ensure = "Absent" + IsSingleInstance = "Yes" + Ensure = "Absent" } Mock -CommandName Get-SPDSCRegistryKey -MockWith { return 0 } - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPCreateFarm.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPCreateFarm.Tests.ps1 deleted file mode 100644 index a3cda626d..000000000 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPCreateFarm.Tests.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -[CmdletBinding()] -[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] -param( - [Parameter()] - [string] - $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` - -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` - -Resolve) -) - -Import-Module -Name (Join-Path -Path $PSScriptRoot ` - -ChildPath "..\UnitTestHelper.psm1" ` - -Resolve) - -$Global:SPDscHelper = New-SPDscUnitTestHelper -SharePointStubModule $SharePointCmdletModule ` - -DscResource "SPCreateFarm" - -Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { - InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { - Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope - - # Initialize tests - $mockPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force - $mockFarmAccount = New-Object -TypeName "System.Management.Automation.PSCredential" ` - -ArgumentList @("username", $mockPassword) - $mockPassphrase = New-Object -TypeName "System.Management.Automation.PSCredential" ` - -ArgumentList @("PASSPHRASEUSER", $mockPassword) - - $modulePath = "Modules\SharePointDsc\Modules\SharePointDsc.Farm\SPFarm.psm1" - Import-Module -Name (Join-Path -Path $Global:SPDscHelper.RepoRoot -ChildPath $modulePath -Resolve) - - # Mocks for all contexts - - # Test contexts - Context -Name "no farm is configured locally and a supported version of SharePoint is installed" -Fixture { - $testParams = @{ - FarmConfigDatabaseName = "SP_Config" - DatabaseServer = "DatabaseServer\Instance" - FarmAccount = $mockFarmAccount - Passphrase = $mockPassphrase - AdminContentDatabaseName = "Admin_Content" - CentralAdministrationAuth = "Kerberos" - CentralAdministrationPort = 1234 - } - - It "Should throw an exception in the get method" { - { Get-TargetResource @testParams } | Should Throw "SPCreateFarm: This resource has been removed. Please update your configuration to use SPFarm instead." - } - - It "Should throw an exception in the test method" { - { Test-TargetResource @testParams } | Should Throw "SPCreateFarm: This resource has been removed. Please update your configuration to use SPFarm instead." - } - - It "Should throw an exception in the set method" { - { Set-TargetResource @testParams } | Should Throw "SPCreateFarm: This resource has been removed. Please update your configuration to use SPFarm instead." - } - } - } -} - -Invoke-Command -ScriptBlock $Global:SPDscHelper.CleanupScript -NoNewScope diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPDesignerSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPDesignerSettings.Tests.ps1 index 29927af3c..ccf22f0aa 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPDesignerSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPDesignerSettings.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -18,15 +18,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope - # Mocks for all contexts - Mock -CommandName Get-SPFarm -MockWith { - return @{} + # Mocks for all contexts + Mock -CommandName Get-SPFarm -MockWith { + return @{} } # Test contexts Context -Name "The server is not part of SharePoint farm" -Fixture { $testParams = @{ - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "WebApplication" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false @@ -37,8 +37,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowSaveDeclarativeWorkflowAsTemplate = $false } - Mock -CommandName Get-SPFarm -MockWith { - throw "Unable to detect local farm" + Mock -CommandName Get-SPFarm -MockWith { + throw "Unable to detect local farm" } It "Should return null from the get method" { @@ -56,7 +56,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm, target web application and the incorrect settings have been applied" -Fixture { $testParams = @{ - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "WebApplication" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false @@ -66,7 +66,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowSavePublishDeclarativeWorkflow = $false AllowSaveDeclarativeWorkflowAsTemplate = $false } - + Mock -CommandName Get-SPDesignerSettings -MockWith { return @{ AllowDesigner = $true AllowRevertFromTemplate = $true @@ -75,21 +75,21 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowCreateDeclarativeWorkflow = $true AllowSavePublishDeclarativeWorkflow = $true AllowSaveDeclarativeWorkflowAsTemplate = $true - } + } } - - Mock -CommandName Get-SPWebapplication -MockWith { + + Mock -CommandName Get-SPWebapplication -MockWith { $result = @{} $result.DisplayName = "Test" $result.Url = "https://intranet.sharepoint.contoso.com" - $result = $result | Add-Member -MemberType ScriptMethod -Name Update -Value { - $Global:SPDscDesignerUpdated = $true + $result = $result | Add-Member -MemberType ScriptMethod -Name Update -Value { + $Global:SPDscDesignerUpdated = $true } -PassThru return $result } - + It "Should return values from the get method" { Get-TargetResource @testParams | Should Not BeNullOrEmpty } @@ -107,7 +107,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm, target site collection and the incorrect settings have been applied" -Fixture { $testParams = @{ - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "SiteCollection" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false @@ -128,7 +128,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowCreateDeclarativeWorkflow = $true AllowSavePublishDeclarativeWorkflow = $true AllowSaveDeclarativeWorkflowAsTemplate = $true - } + } } Mock -CommandName Test-SPDSCRunAsCredential { return $true } @@ -148,7 +148,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm, target site collection and InstallAccount is used" -Fixture { $testParams = @{ - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "SiteCollection" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false @@ -168,7 +168,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowCreateDeclarativeWorkflow = $true AllowSavePublishDeclarativeWorkflow = $true AllowSaveDeclarativeWorkflowAsTemplate = $true - } + } } Mock -CommandName Test-SPDSCRunAsCredential { return $false } @@ -187,7 +187,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm, target is web application and the correct settings have been applied" -Fixture { $testParams = @{ - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "SiteCollection" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false @@ -208,16 +208,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowCreateDeclarativeWorkflow = $false AllowSavePublishDeclarativeWorkflow = $false AllowSaveDeclarativeWorkflowAsTemplate = $false - } - $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { - $Global:SPDscDesignerUpdated = $true + } + $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { + $Global:SPDscDesignerUpdated = $true } -PassThru return $returnVal } Mock -CommandName Test-SPDSCRunAsCredential { return $true } - - Mock -CommandName Get-SPWebApplication -MockWith { + + Mock -CommandName Get-SPWebApplication -MockWith { $result = @{} $result.DisplayName = "Test" $result.Url = "https://intranet.sharepoint.contoso.com" @@ -236,7 +236,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm, target is site collection and the correct settings have been applied" -Fixture { $testParams = @{ - Url = "https://intranet.sharepoint.contoso.com" + WebAppUrl = "https://intranet.sharepoint.contoso.com" SettingsScope = "SiteCollection" AllowSharePointDesigner = $false AllowDetachPagesFromDefinition = $false @@ -257,9 +257,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { AllowCreateDeclarativeWorkflow = $false AllowSavePublishDeclarativeWorkflow = $false AllowSaveDeclarativeWorkflowAsTemplate = $false - } - $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { - $Global:SPDscDesignerUpdated = $true + } + $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { + $Global:SPDscDesignerUpdated = $true } -PassThru return $returnVal } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPDiagnosticLoggingSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPDiagnosticLoggingSettings.Tests.ps1 index 8fbf2a586..a1dcde8c7 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPDiagnosticLoggingSettings.Tests.ps1 @@ -2,7 +2,7 @@ [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -25,6 +25,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "Diagnostic configuration can not be loaded" { $testParams = @{ + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $true @@ -46,7 +47,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-SPDiagnosticConfig -MockWith { - return $null + return $null } It "Should return null from the get method" { @@ -60,6 +61,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Diagnostic configuration can be loaded and it is configured correctly" { $testParams = @{ + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $true @@ -79,7 +81,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { EventLogFloodProtectionQuietPeriod = 5 EventLogFloodProtectionNotifyInterval = 5 } - + Mock -CommandName Get-SPDiagnosticConfig -MockWith { return @{ AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled @@ -100,7 +102,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - } + } } It "Should return values from the get method" { @@ -114,6 +116,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Diagnostic configuration can be loaded and the log path is not set correctly" { $testParams = @{ + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $true @@ -133,7 +136,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { EventLogFloodProtectionQuietPeriod = 5 EventLogFloodProtectionNotifyInterval = 5 } - + Mock -CommandName Get-SPDiagnosticConfig -MockWith { return @{ AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled @@ -154,7 +157,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - } + } } It "Should return false from the test method" { @@ -164,6 +167,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Diagnostic configuration can be loaded and the log size is not set correctly" { $testParams = @{ + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $true @@ -183,7 +187,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { EventLogFloodProtectionQuietPeriod = 5 EventLogFloodProtectionNotifyInterval = 5 } - + Mock -CommandName Get-SPDiagnosticConfig -MockWith { return @{ AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled @@ -204,7 +208,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - } + } } It "Should return false from the test method" { @@ -222,6 +226,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $mockAccount = New-Object -TypeName "System.Management.Automation.PSCredential" ` -ArgumentList @("username", $mockPassword) $testParams = @{ + IsSingleInstance = "Yes" LogPath = "L:\ULSLogs" LogSpaceInGB = 10 AppAnalyticsAutomaticUploadEnabled = $true @@ -242,7 +247,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { EventLogFloodProtectionNotifyInterval = 5 InstallAccount = $mockAccount } - + Mock -CommandName Get-SPDiagnosticConfig -MockWith { return @{ AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled @@ -263,7 +268,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - } + } } It "Should return false from the test method" { diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPExcelServiceApp.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPExcelServiceApp.Tests.ps1 index e62b5acb4..3f4b2c13f 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPExcelServiceApp.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPExcelServiceApp.Tests.ps1 @@ -351,7 +351,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } 16 { - Context -Name "All methods throw exceptions as Excel Services doesn't exist in 2016" -Fixture { + Context -Name "All methods throw exceptions as Excel Services doesn't exist in 2016/2019" -Fixture { It "Should throw on the get method" { { Get-TargetResource @testParams } | Should Throw } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPFarm.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPFarm.Tests.ps1 index 9b8edc6f2..6bb17f8c3 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPFarm.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPFarm.Tests.ps1 @@ -29,24 +29,32 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Import-Module -Name (Join-Path -Path $Global:SPDscHelper.RepoRoot -ChildPath $modulePath -Resolve) # Mocks for all contexts - Mock -CommandName "Add-SPDscConfigDBLock" -MockWith { } - Mock -CommandName "Remove-SPDscConfigDBLock" -MockWith { } - Mock -CommandName "New-SPConfigurationDatabase" -MockWith { } - Mock -CommandName "Connect-SPConfigurationDatabase" -MockWith { } - Mock -CommandName "Install-SPHelpCollection" -MockWith { } - Mock -CommandName "Initialize-SPResourceSecurity" -MockWith { } - Mock -CommandName "Install-SPService" -MockWith { } - Mock -CommandName "Install-SPFeature" -MockWith { } - Mock -CommandName "New-SPCentralAdministration" -MockWith { } - Mock -CommandName "Import-Module" -MockWith { } - Mock -CommandName "Start-Sleep" -MockWith { } - Mock -CommandName "Start-Service" -MockWith { } - Mock -CommandName "Stop-Service" -MockWith { } - Mock -CommandName "Start-SPServiceInstance" -MockWith { } + Mock -CommandName Add-SPDscConfigDBLock -MockWith { } + Mock -CommandName Remove-SPDscConfigDBLock -MockWith { } + Mock -CommandName New-SPConfigurationDatabase -MockWith { } + Mock -CommandName Connect-SPConfigurationDatabase -MockWith { } + Mock -CommandName Install-SPHelpCollection -MockWith { } + Mock -CommandName Initialize-SPResourceSecurity -MockWith { } + Mock -CommandName Install-SPService -MockWith { } + Mock -CommandName Install-SPFeature -MockWith { } + Mock -CommandName New-SPCentralAdministration -MockWith { } + Mock -CommandName Start-Sleep -MockWith { } + Mock -CommandName Start-Service -MockWith { } + Mock -CommandName Stop-Service -MockWith { } + Mock -CommandName Start-SPServiceInstance -MockWith { } + Mock -CommandName Get-SPDSCInstalledProductVersion { + return @{ + FileMajorPart = $Global:SPDscHelper.CurrentStubBuildNumber.Major + FileBuildPart = $Global:SPDscHelper.CurrentStubBuildNumber.Build + ProductBuildPart = $Global:SPDscHelper.CurrentStubBuildNumber.Build + } + } + # Test Contexts - Context -Name "No config databaes exists, and this server should be connected to one" -Fixture { + Context -Name "No config databases exists, and this server should be connected to one" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" CentralAdministrationPort = 80000 @@ -72,6 +80,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "No config databaes exists, and this server should be connected to one" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -90,6 +99,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $false } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPWebApplication" -MockWith { return @{ IsAdministrationWebApplication = $true @@ -112,8 +126,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Context -Name "No config databaes exists, and this server should be connected to one but won't run central admin" -Fixture { + Context -Name "No config databases exists, and this server should be connected to one but won't run central admin" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -132,6 +147,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $false } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPWebApplication" -MockWith { return @{ IsAdministrationWebApplication = $true @@ -147,14 +167,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Test-TargetResource @testParams | Should be $false } - It "Should join the config database in the set method as it wont be running centrl admin" { + It "Should join the config database in the set method as it wont be running central admin" { Set-TargetResource @testParams Assert-MockCalled -CommandName "Connect-SPConfigurationDatabase" } } - Context -Name "A config database exists, and this server should be connected to it but isn't and this sever won't run central admin" -Fixture { + Context -Name "A config database exists, and this server should be connected to it but isn't and this server won't run central admin" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -173,6 +194,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPWebApplication" -MockWith { return @{ IsAdministrationWebApplication = $true @@ -188,7 +214,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { if ($global:SPDscCentralAdminCheckDone -eq $true) { return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" }) } @@ -224,8 +249,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Context -Name "A config database exists, and this server should be connected to it but isn't and this sever will run central admin" -Fixture { + Context -Name "A config database exists, and this server should be connected to it but isn't and this server will run central admin" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -244,6 +270,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPWebApplication" -MockWith { return @{ IsAdministrationWebApplication = $true @@ -264,7 +295,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { if ($global:SPDscCentralAdminCheckDone -eq $true) { return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" }) } @@ -293,6 +323,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "A config and lock database exist, and this server should be connected to it but isn't" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -323,6 +354,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPWebApplication" -MockWith { return @{ IsAdministrationWebApplication = $true @@ -348,6 +384,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Server is connected to farm, but Central Admin isn't started" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -377,6 +414,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName Get-SPDatabase -MockWith { return @(@{ Name = $testParams.FarmConfigDatabaseName @@ -410,7 +452,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $global:SPDscSIRunCount++ return @(@{ TypeName = "Central Administration" - Name = "WSS_Administration" Status = "Online" }) } @@ -441,6 +482,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Server is connected to farm, but CentralAdminPort is different" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -498,7 +540,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-SPServiceInstance -MockWith { return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" Status = "Online" }) @@ -522,6 +563,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "This server is connected to the farm and is running CA, but shouldn't" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -551,6 +593,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPDatabase" -MockWith { return @(@{ Name = $testParams.FarmConfigDatabaseName @@ -578,7 +625,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { $global:SPDscSIRunCount++ return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" Status = "Online" }) @@ -611,6 +657,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "A config database exists, and this server is connected to it and should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -640,6 +687,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPDatabase" -MockWith { return @(@{ Name = $testParams.FarmConfigDatabaseName @@ -663,7 +715,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { if ($global:SPDscCentralAdminCheckDone -eq $true) { return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" Status = "Online" }) @@ -686,6 +737,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Absent is specified for the ensure property" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Absent" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -712,6 +764,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { Context -Name "Only valid parameters for SharePoint 2013 are used" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "DatabaseServer\Instance" @@ -739,6 +792,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "no serverrole is specified and get-targetresource needs to return null" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -768,6 +822,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPDatabase" -MockWith { return @(@{ Name = $testParams.FarmConfigDatabaseName @@ -809,6 +868,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { Context -Name "enhanced minrole options fail when Feature Pack 1 is not installed" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "DatabaseServer\Instance" @@ -843,6 +903,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "enhanced minrole options succeed when Feature Pack 1 is installed" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -862,17 +923,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $false } } - Mock -CommandName "Get-SPWebApplication" -MockWith { + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { return @{ - IsAdministrationWebApplication = $true - Url = "http://localhost:12345" + MaxDOPCorrect = $true } } - - Mock -CommandName Get-SPDSCInstalledProductVersion -MockWith { + Mock -CommandName "Get-SPWebApplication" -MockWith { return @{ - FileMajorPart = 16 - FileBuildPart = 4456 + IsAdministrationWebApplication = $true + Url = "http://localhost:12345" } } @@ -892,6 +951,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "no serverrole is specified but get-targetresource needs to identify and return it" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -920,6 +980,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPDatabase" -MockWith { return @(@{ Name = $testParams.FarmConfigDatabaseName @@ -948,7 +1013,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Get-SPDSCInstalledProductVersion -MockWith { return @{ FileMajorPart = 16 } } + Mock -CommandName Get-SPDSCInstalledProductVersion -MockWith { return @{ FileMajorPart = 16; ProductBuildPart = 4700 } } It "Should return WebFrontEnd from the get method"{ (Get-TargetResource @testParams).ServerRole | Should Be "WebFrontEnd" @@ -957,6 +1022,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "no farm is configured locally and an unsupported version of SharePoint is installed on the server" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -976,6 +1042,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is joined to the farm, but SQL server is unavailable" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -998,6 +1065,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $false } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPDatabase" -MockWith { return $null } @@ -1008,7 +1080,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { if ($global:SPDscCentralAdminCheckDone -eq $true) { return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" Status = "Online" }) @@ -1033,6 +1104,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "A config database exists, and this server is connected (with FQDN) to it and should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" Ensure = "Present" FarmConfigDatabaseName = "SP_Config" DatabaseServer = "sql.contoso.com" @@ -1073,6 +1145,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DatabaseExists = $true } } + Mock -CommandName "Get-SPDSCSQLInstanceStatus" -MockWith { + return @{ + MaxDOPCorrect = $true + } + } Mock -CommandName "Get-SPDatabase" -MockWith { return @(@{ Name = $testParams.FarmConfigDatabaseName @@ -1096,7 +1173,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { if ($global:SPDscCentralAdminCheckDone -eq $true) { return @(@{ - Name = "WSS_Administration" TypeName = "Central Administration" Status = "Online" }) diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmAdministrators.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmAdministrators.Tests.ps1 index 5d3ab6824..31b8b9018 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmAdministrators.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmAdministrators.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -21,7 +21,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "No central admin site exists" { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" Members = @("Demo\User1", "Demo\User2") } @@ -42,11 +42,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Central admin exists and a fixed members list is used which matches" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" Members = @("Demo\User1", "Demo\User2") } - - Mock -CommandName Get-SPwebapplication -MockWith { + + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true Url = "http://admin.shareopoint.contoso.local" @@ -55,7 +55,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { @@ -80,38 +80,38 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Central admin exists and a fixed members list is used which does not match" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" Members = @("Demo\User1", "Demo\User2") } - - Mock -CommandName Get-SPwebapplication -MockWith { + + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true Url = "http://admin.shareopoint.contoso.local" } } - + Mock -CommandName Get-SPWeb -MockWith { $web = @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object -TypeName "Object" | + return New-Object -TypeName "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User1" + UserLogin = "Demo\User1" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -121,8 +121,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return $web } - Mock -CommandName Get-SPUser -MockWith { - return @{} + Mock -CommandName Get-SPUser -MockWith { + return @{} } It "Should return values from the get method" { @@ -134,47 +134,47 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should update the members list" { - Set-TargetResource @testParams + Set-TargetResource @testParams } } - + Context -Name "Central admin exists and a members to include is set where the members are in the group" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" MembersToInclude = @("Demo\User2") } - Mock -CommandName Get-SPwebapplication -MockWith { + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true Url = "http://admin.shareopoint.contoso.local" } } - + Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object "Object" | + return New-Object "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User1" + UserLogin = "Demo\User1" }, @{ - UserLogin = "Demo\User2" + UserLogin = "Demo\User2" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -194,11 +194,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Central admin exists and a members to include is set where the members are not in the group" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" MembersToInclude = @("Demo\User2") } - Mock -CommandName Get-SPwebapplication -MockWith { + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true Url = "http://admin.shareopoint.contoso.local" @@ -208,24 +208,24 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object "Object" | + return New-Object "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User1" + UserLogin = "Demo\User1" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -241,49 +241,49 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should return true from the test method" { Test-TargetResource @testParams | Should Be $false } - + It "Should update the members list" { - Set-TargetResource @testParams + Set-TargetResource @testParams } } Context -Name "Central admin exists and a members to exclude is set where the members are in the group" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" MembersToExclude = @("Demo\User1") } - Mock -CommandName Get-SPwebapplication -MockWith { + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true Url = "http://admin.shareopoint.contoso.local" } } - + Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object "Object" | + return New-Object "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User1" + UserLogin = "Demo\User1" }, @{ UserLogin = "Demo\User2" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -301,13 +301,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should update the members list" { - Set-TargetResource @testParams + Set-TargetResource @testParams } } Context -Name "Central admin exists and a members to exclude is set where the members are not in the group" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" MembersToExclude = @("Demo\User1") } @@ -318,24 +318,24 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object "Object" | + return New-Object "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User2" + UserLogin = "Demo\User2" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -355,39 +355,39 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The resource is called with both an explicit members list as well as members to include/exclude" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" Members = @("Demo\User1") MembersToExclude = @("Demo\User1") } - Mock -CommandName Get-SPwebapplication -MockWith { + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true Url = "http://admin.shareopoint.contoso.local" } } - + Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object "Object" | + return New-Object "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User2" + UserLogin = "Demo\User2" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -397,7 +397,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should throw in the get method" { - { Get-TargetResource @testParams } | Should throw + { Get-TargetResource @testParams } | Should throw } It "Should throw in the test method" { @@ -411,37 +411,37 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The resource is called without either the specific members list or the include/exclude lists" -Fixture { $testParams = @{ - Name = "Farm Administrators" + IsSingleInstance = "Yes" } - Mock -CommandName Get-SPwebapplication -MockWith { + Mock -CommandName Get-SPwebapplication -MockWith { return @{ IsAdministrationWebApplication = $true - Url = "http://admin.shareopoint.contoso.local" + Url = "http://admin.sharepoint.contoso.local" } } - + Mock -CommandName Get-SPWeb -MockWith { return @{ AssociatedOwnerGroup = "Farm Administrators" - SiteGroups = New-Object -TypeName "Object" | + SiteGroups = New-Object -TypeName "Object" | Add-Member -MemberType ScriptMethod ` -Name GetByName ` -Value { - return New-Object "Object" | + return New-Object "Object" | Add-Member -MemberType ScriptProperty ` -Name Users ` -Value { return @( @{ - UserLogin = "Demo\User2" + UserLogin = "Demo\User2" } - ) - } -PassThru | + ) + } -PassThru | Add-Member -MemberType ScriptMethod ` -Name AddUser ` -Value { } ` - -PassThru | + -PassThru | Add-Member -MemberType ScriptMethod ` -Name RemoveUser ` -Value { } ` @@ -451,7 +451,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should throw in the get method" { - { Get-TargetResource @testParams } | Should throw + { Get-TargetResource @testParams } | Should throw } It "Should throw in the test method" { diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmSolution.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmSolution.Tests.ps1 index cd3cfdd0a..0038f3134 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmSolution.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPFarmSolution.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -19,8 +19,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope # Initialize tests - - # Mocks for all contexts + + # Mocks for all contexts Mock -CommandName Update-SPSolution -MockWith { } Mock -CommandName Install-SPFeature -MockWith { } Mock -CommandName Install-SPSolution -MockWith { } @@ -36,23 +36,23 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Present" Version = "1.0.0.0" - WebApplications = @("http://app1", "http://app2") + WebAppUrls = @("http://app1", "http://app2") } $global:SPDscSolutionAdded = $false - Mock -CommandName Get-SPSolution -MockWith { + Mock -CommandName Get-SPSolution -MockWith { if ($global:SPDscSolutionAdded) - { - return [pscustomobject] @{ } + { + return [pscustomobject] @{ } } else { - return $null + return $null } } - Mock -CommandName Add-SPSolution -MockWith { + Mock -CommandName Add-SPSolution -MockWith { $solution = [pscustomobject] @{ Properties = @{ Version = "" }} $solution | Add-Member -Name Update -MemberType ScriptMethod -Value { } $global:SPDscSolutionAdded = $true @@ -73,9 +73,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "uploads and installes the solution to the farm" { Set-TargetResource @testParams - Assert-MockCalled Add-SPSolution + Assert-MockCalled Add-SPSolution Assert-MockCalled Install-SPSolution - + } } @@ -86,13 +86,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Present" Version = "1.0.0.0" - WebApplications = @("http://app1", "http://app2") + WebAppUrls = @("http://app1", "http://app2") } $global:SPDscSolutionAdded = $false $global:SPDscLoopCount = 0 - Mock -CommandName Get-SPSolution -MockWith { + Mock -CommandName Get-SPSolution -MockWith { $global:SPDscLoopCount = $global:SPDscLoopCount + 1 $index = $global:SPDscLoopCount if($global:SPDscSolutionAdded) @@ -103,20 +103,20 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { JobExists = $false } } - else + else { return @{ JobExists = $true - } + } } - } + } else { - return $null + return $null } } - Mock -CommandName Add-SPSolution -MockWith { + Mock -CommandName Add-SPSolution -MockWith { $solution = [pscustomobject] @{ Properties = @{ Version = "" }} $solution | Add-Member -Name Update -MemberType ScriptMethod -Value { } $global:SPDscSolutionAdded = $true @@ -140,9 +140,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "uploads and installes the solution to the farm" { $global:SPDscLoopCount = 0 Set-TargetResource @testParams - Assert-MockCalled Add-SPSolution + Assert-MockCalled Add-SPSolution Assert-MockCalled Install-SPSolution - + } } @@ -153,7 +153,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Absent" Version = "1.0.0.0" - WebApplications = @("http://app1", "http://app2") + WebAppUrls = @("http://app1", "http://app2") } Mock -CommandName Get-SPSolution -MockWith { @@ -180,7 +180,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "uninstalles and removes the solution from the web apps and the farm" { Set-TargetResource @testParams Assert-MockCalled Uninstall-SPSolution - Assert-MockCalled Remove-SPSolution + Assert-MockCalled Remove-SPSolution } } @@ -191,7 +191,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $false Ensure = "Absent" Version = "0.0.0.0" - WebApplications = @() + WebAppUrls = @() } Mock -CommandName Get-SPSolution -MockWith { $null } @@ -216,7 +216,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Present" Version = "1.1.0.0" - WebApplications = @("http://app1", "http://app2") + WebAppUrls = @("http://app1", "http://app2") } Mock -CommandName Get-SPSolution -MockWith { @@ -225,10 +225,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Properties = @{ Version = "1.0.0.0" } DeployedWebApplications = @( [pscustomobject]@{Url="http://app1"}, [pscustomobject]@{Url="http://app2"}) ContainsGlobalAssembly = $true - } + } $s | Add-Member -Name Update -MemberType ScriptMethod -Value { } return $s - } + } $getResults = Get-TargetResource @testParams @@ -256,9 +256,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Present" Version = "1.0.0.0" - WebApplications = @("http://app1", "http://app2") + WebAppUrls = @("http://app1", "http://app2") } - + Mock -CommandName Get-SPSolution -MockWith { return [pscustomobject]@{ Deployed = $true @@ -266,7 +266,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DeployedWebApplications = @( [pscustomobject]@{Url="http://app1"}, [pscustomobject]@{Url="http://app2"}) ContainsGlobalAssembly = $true } - } + } $getResults = Get-TargetResource @testParams @@ -288,7 +288,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Present" Version = "1.1.0.0" - WebApplications = @() + WebAppUrls = @() } $solution = [pscustomobject]@{ @@ -296,7 +296,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Properties = @{ Version = "1.0.0.0" } DeployedWebApplications = @( [pscustomobject]@{Url="http://app1"}, [pscustomobject]@{Url="http://app2"}) ContainsGlobalAssembly = $true - } + } $solution | Add-Member -Name Update -MemberType ScriptMethod -Value { } Mock -CommandName Get-SPSolution -MockWith { $solution } @@ -330,7 +330,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Deployed = $true Ensure = "Present" Version = "1.1.0.0" - WebApplications = @() + WebAppUrls = @() SolutionLevel = "All" } @@ -339,11 +339,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Properties = @{ Version = "1.0.0.0" } DeployedWebApplications = @( [pscustomobject]@{Url="http://app1"}, [pscustomobject]@{Url="http://app2"}) ContainsGlobalAssembly = $true - } + } $solution | Add-Member -Name Update -MemberType ScriptMethod -Value { } - Mock -CommandName Get-SPSolution -MockWith { $solution } - Mock -CommandName Add-SPSolution -MockWith { $solution } + Mock -CommandName Get-SPSolution -MockWith { $solution } + Mock -CommandName Add-SPSolution -MockWith { $solution } It "deploys the solution using the correct compatability level" { Set-TargetResource @testParams diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPInfoPathFormsServiceConfig.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPInfoPathFormsServiceConfig.Tests.ps1 index 88602e985..3239ad3db 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPInfoPathFormsServiceConfig.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPInfoPathFormsServiceConfig.Tests.ps1 @@ -44,7 +44,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" + Ensure = "Present" AllowUserFormBrowserEnabling = $false AllowUserFormBrowserRendering = $true MaxDataConnectionTimeout = 20000 @@ -67,7 +68,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When trying to remove configurations" -Fixture { $testParams = @{ - Ensure = "Absent" + IsSingleInstance = "Yes" + Ensure = "Absent" AllowUserFormBrowserEnabling = $false AllowUserFormBrowserRendering = $true MaxDataConnectionTimeout = 20000 @@ -91,7 +93,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When the InfoPath Form Services is properly configured" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" + Ensure = "Present" AllowUserFormBrowserEnabling = $true AllowUserFormBrowserRendering = $true MaxDataConnectionTimeout = 20000 diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPInstall.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPInstall.Tests.ps1 index eae242cb7..6c91b63d0 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPInstall.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPInstall.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -35,40 +35,41 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return $object } - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName Get-ChildItem -MockWith { $full = @{ Version = "4.5.0.0" Release = "0" PSChildName = "Full" - } + } $client = @{ Version = "4.5.0.0" Release = "0" PSChildName = "Client" - } + } $returnval = @($full, $client) $returnVal = $returnVal | Add-Member ScriptMethod GetValue { return 380000 } -PassThru return $returnval } - Mock -CommandName Get-SPDSCAssemblyVersion -MockWith { - return $Global:SPDscHelper.CurrentStubBuildNumber.Major + Mock -CommandName Get-SPDSCAssemblyVersion -MockWith { + return $Global:SPDscHelper.CurrentStubBuildNumber.Major } - + # Test contexts Context -Name "SharePoint binaries are not installed but should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } - Mock -CommandName Get-ItemProperty -MockWith { - return $null + Mock -CommandName Get-ItemProperty -MockWith { + return $null } It "Should return absent from the get method" { @@ -82,16 +83,17 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "SharePoint binaries are installed and should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } - - Mock -CommandName Get-ItemProperty -MockWith { + + Mock -CommandName Get-ItemProperty -MockWith { return @( (New-SPDscMockPrereq -Name "Microsoft SharePoint Server 2013"), (New-SPDscMockPrereq -Name "Something else") - ) + ) } -ParameterFilter { $null -ne $Path } Mock -CommandName Get-ItemProperty -MockWith { @@ -99,7 +101,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { VersionInfo = @{ FileVersion = "15.0.4709.1000" } - } + } } Mock -CommandName Test-Path -MockWith { @@ -117,14 +119,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "SharePoint installation executes as expected" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } - - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 + + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 } } @@ -136,14 +139,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "SharePoint installation fails" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } - - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = -1 + + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = -1 } } @@ -154,11 +158,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "SharePoint binaries are installed and should not be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Absent" } - + Mock -CommandName Get-ItemProperty -MockWith { return @{} } -ParameterFilter { $null -ne $Path } It "Should throw in the test method because uninstall is unsupported" { @@ -169,9 +174,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { Set-TargetResource @testParams } | Should Throw } } - + Context -Name "SharePoint 2013 is installing on a server with .NET 4.6" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" @@ -182,26 +188,27 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Version = "4.6.0.0" Release = "0" PSChildName = "Full" - } + } $client = @{ Version = "4.6.0.0" Release = "0" PSChildName = "Client" - } + } $returnval = @($full, $client) $returnVal = $returnVal | Add-Member ScriptMethod GetValue { return 391000 } -PassThru return $returnval } - + It "Should throw an error in the set method" { { Set-TargetResource @testParams } | Should Throw } } - + Context -Name "SharePoint is not installed and should be, using custom install directories" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" @@ -209,10 +216,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { DataPath = "C:\somewhere\else" } - Mock -CommandName Get-ItemProperty -MockWith { - return $null - } -ParameterFilter { - $null -ne $Path + Mock -CommandName Get-ItemProperty -MockWith { + return $null + } -ParameterFilter { + $null -ne $Path } It "Should return absent from the get method" { @@ -222,10 +229,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false } - - Mock -CommandName Start-Process { - return @{ - ExitCode = 0 + + Mock -CommandName Start-Process { + return @{ + ExitCode = 0 } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallLanguagePack.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallLanguagePack.Tests.ps1 index 67e62d498..cce66e6a3 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallLanguagePack.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallLanguagePack.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,7 +20,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName Test-Path -MockWith { return $true } @@ -37,6 +37,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } + Mock -CommandName Get-SPDSCInstalledProductVersion { + return @{ + FileMajorPart = $Global:SPDscHelper.CurrentStubBuildNumber.Major + FileBuildPart = $Global:SPDscHelper.CurrentStubBuildNumber.Build + ProductBuildPart = $Global:SPDscHelper.CurrentStubBuildNumber.Build + } + } + # Test contexts Context -Name "Specified update file not found" -Fixture { $testParams = @{ @@ -44,8 +52,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Ensure = "Present" } - Mock -CommandName Test-Path { - return $false + Mock -CommandName Test-Path { + return $false } It "Should throw exception in the get method" { @@ -84,7 +92,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", "Language Pack for SharePoint and Project Server 2013 - Dutch/Nederlands") } 16 { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2010 - Dutch/Nederlands") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -125,7 +140,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Chinese (Taiwan)/中文 (繁體)') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Chinese (Taiwan)/中文 (繁體)') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Chinese (Taiwan)/中文 (繁體)') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Chinese (Taiwan)/中文 (繁體)') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -166,7 +188,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Chinese (PRC)/中文(简体)') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Chinese (PRC)/中文(简体)') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Chinese (PRC)/中文(简体)') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Chinese (PRC)/中文(简体)') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -207,7 +236,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - درى Dari') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - درى Dari') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - درى Dari') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - درى Dari') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -248,7 +284,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Serbian/srpski') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Serbian/srpski') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Serbian/srpski') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Serbian/srpski') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -289,7 +332,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Serbian/српски') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Serbian/српски') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Serbian/српски') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Serbian/српски') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -330,7 +380,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Portuguese/Português (Brasil)') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Portuguese/Português (Brasil)') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Portuguese/Português (Brasil)') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Portuguese/Português (Brasil)') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -371,7 +428,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Portuguese/Português') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Portuguese/Português') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Portuguese/Português') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Portuguese/Português') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -412,7 +476,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", 'Language Pack for SharePoint and Project Server 2013 - Arabic/LOCAL ARABIC') } 16 { - return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Arabic/LOCAL ARABIC') + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", 'Language Pack for SharePoint and Project Server 2016 - Arabic/LOCAL ARABIC') + } + else + { + return @("Microsoft SharePoint Server 2019", 'Language Pack for SharePoint and Project Server 2019 - Arabic/LOCAL ARABIC') + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -435,7 +506,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { BinaryDir = "C:\SPInstall" Ensure = "Present" } - + Mock -CommandName Get-SPDscFarmProductsInfo -MockWith { switch ($Global:SPDscHelper.CurrentStubBuildNumber.Major) { @@ -443,25 +514,39 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013") } 16 { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" } } } - + Mock -CommandName Get-SPDscRegProductsInfo -MockWith { if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 15) { return @("Microsoft SharePoint Server 2013") } - else + else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } - + Mock -CommandName Start-Process -MockWith { return @{ ExitCode = 0 @@ -488,7 +573,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { BinaryDir = "C:\SPInstall" Ensure = "Present" } - + Mock -CommandName Get-SPDscFarmProductsInfo -MockWith { switch ($Global:SPDscHelper.CurrentStubBuildNumber.Major) { @@ -496,25 +581,39 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013") } 16 { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" } } } - + Mock -CommandName Get-SPDscRegProductsInfo -MockWith { if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 15) { return @("Microsoft SharePoint Server 2013") } - else + else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } - + Mock -CommandName Start-Process -MockWith { return @{ ExitCode = 17022 @@ -549,7 +648,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013") } 16 { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -562,9 +668,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @("Microsoft SharePoint Server 2013") } - else + else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -600,7 +713,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "C:\SPInstall\osmui" } } - + Mock -CommandName Get-SPDscFarmProductsInfo { switch ($Global:SPDscHelper.CurrentStubBuildNumber.Major) { @@ -608,7 +721,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", "Language Pack for SharePoint and Project Server 2013 - Dutch/Nederlands") } 16 { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2019 - Dutch/Nederlands") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -621,9 +741,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @("Microsoft SharePoint Server 2013", "Language Pack for SharePoint and Project Server 2013 - Dutch/Nederlands") } - else + else { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2019 - Dutch/Nederlands") + } } } @@ -643,7 +770,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "C:\SPInstall\osmui.xx-xx" } } - + Mock -CommandName Get-SPDscFarmProductsInfo -MockWith { switch ($Global:SPDscHelper.CurrentStubBuildNumber.Major) { @@ -651,7 +778,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @("Microsoft SharePoint Server 2013", "Language Pack for SharePoint and Project Server 2013 - Dutch/Nederlands") } 16 { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2019 - Dutch/Nederlands") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -664,12 +798,19 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @("Microsoft SharePoint Server 2013", "Language Pack for SharePoint and Project Server 2013 - Dutch/Nederlands") } - else + else { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2019 - Dutch/Nederlands") + } } } - + It "Should throw exception in the get method" { { Get-TargetResource @testParams } | Should Throw "Error while converting language information:" } @@ -698,7 +839,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-Date -MockWith { return $testDate } - + It "Should return null from the set method" { Set-TargetResource @testParams | Should BeNullOrEmpty } @@ -717,7 +858,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-Date -MockWith { return $testDate } - + It "Should return null from the set method" { Set-TargetResource @testParams | Should BeNullOrEmpty } @@ -736,7 +877,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-Date -MockWith { return $testDate } - + It "Should throw exception in the set method" { { Set-TargetResource @testParams } | Should Throw "Time window incorrectly formatted." } @@ -755,7 +896,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-Date -MockWith { return $testDate } - + It "Should throw exception in the set method" { { Set-TargetResource @testParams } | Should Throw "Error converting start time" } @@ -774,7 +915,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-Date -MockWith { return $testDate } - + It "Should throw exception in the set method" { { Set-TargetResource @testParams } | Should Throw "Error converting end time" } @@ -793,7 +934,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-Date -MockWith { return $testDate } - + It "Should throw exception in the set method" { { Set-TargetResource @testParams } | Should Throw "Error: Start time cannot be larger than end time" } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallPrereqs.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallPrereqs.Tests.ps1 index 906031e1e..b7b55c2ac 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallPrereqs.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPInstallPrereqs.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -25,52 +25,68 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ( [Parameter(Mandatory = $true)] [String] - $Name + $Name, + + [Parameter()] + [String[]] + $BundleUpgradeCode, + + [Parameter()] + [String] + $DisplayVersion ) $object = New-Object -TypeName System.Object - $object = $object | Add-Member -Type NoteProperty ` + $object | Add-Member -Type NoteProperty ` -Name "DisplayName" ` - -Value $Name ` - -PassThru + -Value $Name + + $object | Add-Member -Type NoteProperty ` + -Name "BundleUpgradeCode" ` + -Value $BundleUpgradeCode + + $object | Add-Member -Type NoteProperty ` + -Name "DisplayVersion" ` + -Value $DisplayVersion + return $object } - if ($null -eq (Get-Command Get-WindowsFeature -ErrorAction SilentlyContinue)) + if ($null -eq (Get-Command Get-WindowsFeature -ErrorAction SilentlyContinue)) { function Get-WindowsFeature { } } - if ($null -eq (Get-Command Install-WindowsFeature -ErrorAction SilentlyContinue)) + if ($null -eq (Get-Command Install-WindowsFeature -ErrorAction SilentlyContinue)) { function Install-WindowsFeature { } } - # Mocks for all contexts - Mock -CommandName Get-ItemProperty -ParameterFilter { - $Path -eq "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" + # Mocks for all contexts + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" } -MockWith { return @() } - + Mock -CommandName Get-ChildItem { $full = @{ Version = "4.5.0.0" Release = "0" PSChildName = "Full" - } + } $client = @{ Version = "4.5.0.0" Release = "0" PSChildName = "Client" - } + } $returnval = @($full, $client) $returnVal = $returnVal | Add-Member ScriptMethod GetValue { return 380000 } -PassThru return $returnval } - Mock -CommandName Get-ItemProperty -ParameterFilter { - $Path -eq "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" } -MockWith { return @() } @@ -80,27 +96,49 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-SPDscOSVersion -MockWith { - return @{ - Major = 6 - Minor = 3 + if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 16 -and + $Global:SPDscHelper.CurrentStubBuildNumber.Build -gt 10000) + { + # SharePoint 2019 + return @{ + Major = 10 + Minor = 0 + } + } + else + { + # SharePoint 2013 / 2016 + return @{ + Major = 6 + Minor = 3 + } } } - Mock -CommandName Get-WindowsFeature -MockWith { - return @(@{ + Mock -CommandName Get-WindowsFeature -MockWith { + return @(@{ Name = "ExampleFeature" Installed = $false - }) + }) + } + + Mock -CommandName Get-SPDSCAssemblyVersion { + return $Global:SPDscHelper.CurrentStubBuildNumber.Major + } + + Mock -CommandName Get-SPDSCBuildVersion { + return $Global:SPDscHelper.CurrentStubBuildNumber.Build } # Test contexts Context -Name "Prerequisites are not installed but should be and are to be installed in online mode" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true Ensure = "Present" } - + Mock -CommandName Get-ItemProperty -MockWith { return @() } -ParameterFilter { $null -ne $Path } @@ -155,6 +193,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Prerequisites are installed and should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true Ensure = "Present" @@ -163,39 +202,60 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { switch ($Global:SPDscHelper.CurrentStubBuildNumber.Major) { 15 { - Mock -CommandName Get-ItemProperty -ParameterFilter { - $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" } -MockWith { return @( - (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), - (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), - (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), - (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), - (New-SPDscMockPrereq -Name "WCF Data Services 5.0 (for OData v3) Primary Components"), - (New-SPDscMockPrereq -Name "Microsoft SQL Server 2008 R2 Native Client"), - (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.0"), + (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), + (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), + (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.0 (for OData v3) Primary Components"), + (New-SPDscMockPrereq -Name "Microsoft SQL Server 2008 R2 Native Client"), + (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.0"), (New-SPDscMockPrereq -Name "Microsoft Identity Extensions" ) ) } } 16 { - Mock -CommandName Get-ItemProperty -ParameterFilter { - $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" - } -MockWith { - return @( - (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), - (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), - (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), - (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), - (New-SPDscMockPrereq -Name "Microsoft ODBC Driver 11 for SQL Server"), - (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030"), - (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030"), - (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.23026"), - (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2015 x64 Additional Runtime - 14.0.23026"), - (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), - (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.1"), - (New-SPDscMockPrereq -Name "Microsoft Identity Extensions") - ) + if ($Global:SPDscHelper.CurrentStubBuildNumber.Build -lt 10000) + { + # SharePoint 2016 + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" + } -MockWith { + return @( + (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), + (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), + (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), + (New-SPDscMockPrereq -Name "Microsoft ODBC Driver 11 for SQL Server"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23026" -BundleUpgradeCode @("{C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B}") -DisplayVersion "14.0.23026.0"), + (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), + (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.1"), + (New-SPDscMockPrereq -Name "Microsoft Identity Extensions") + ) + } + } + else + { + # SharePoint 2019 + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" + } -MockWith { + return @( + (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), + (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), + (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), + (New-SPDscMockPrereq -Name "Microsoft Identity Extensions"), + (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.1"), + (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2017 Redistributable (x64) - 14.13.26020" -BundleUpgradeCode @("{C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B}") -DisplayVersion "14.13.26020.0") + ) + } } } Default { @@ -203,13 +263,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Get-WindowsFeature -MockWith { - return @(@{ + Mock -CommandName Get-WindowsFeature -MockWith { + return @(@{ Name = "ExampleFeature" Installed = $true - }) + }) } - + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" } @@ -219,35 +279,103 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } + if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 16) + { + Context -Name "Microsoft Visual C++ 2015/2017 prerequisite is installed with lower version than required" -Fixture { + $testParams = @{ + IsSingleInstance = "Yes" + InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" + OnlineMode = $true + Ensure = "Present" + } + + if ($Global:SPDscHelper.CurrentStubBuildNumber.Build -lt 10000) + { + # SharePoint 2016 + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" + } -MockWith { + return @( + (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), + (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), + (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), + (New-SPDscMockPrereq -Name "Microsoft ODBC Driver 11 for SQL Server"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23026" -BundleUpgradeCode @("{C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B}") -DisplayVersion "14.0.0.0"), + (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), + (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.1"), + (New-SPDscMockPrereq -Name "Microsoft Identity Extensions") + ) + } + } + else + { + # SharePoint 2019 + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" + } -MockWith { + return @( + (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), + (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), + (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), + (New-SPDscMockPrereq -Name "Microsoft Identity Extensions"), + (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.1"), + (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), + (New-SPDscMockPrereq -Name "Microsoft Visual C++ 2017 Redistributable (x64) - 14.13.26020" -BundleUpgradeCode @("{C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B}") -DisplayVersion "14.10.0.0") + ) + } + } + + Mock -CommandName Get-WindowsFeature -MockWith { + return @(@{ + Name = "ExampleFeature" + Installed = $true + }) + } + + It "Should return absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" + } + + It "Should return false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + } + } + if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 15) { Context -Name "Prerequisites are installed and should be (with SQL 2012 native client for SP2013)" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true Ensure = "Present" } - Mock -CommandName Get-ItemProperty -ParameterFilter { - $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" + Mock -CommandName Get-ItemProperty -ParameterFilter { + $Path -eq "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" } -MockWith { return @( - (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), - (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), - (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), - (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), - (New-SPDscMockPrereq -Name "WCF Data Services 5.0 (for OData v3) Primary Components"), - (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), - (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.0"), + (New-SPDscMockPrereq -Name "Microsoft CCR and DSS Runtime 2008 R3"), + (New-SPDscMockPrereq -Name "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"), + (New-SPDscMockPrereq -Name "AppFabric 1.1 for Windows Server"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.6.0 Runtime"), + (New-SPDscMockPrereq -Name "WCF Data Services 5.0 (for OData v3) Primary Components"), + (New-SPDscMockPrereq -Name "Microsoft SQL Server 2012 Native Client"), + (New-SPDscMockPrereq -Name "Active Directory Rights Management Services Client 2.0"), (New-SPDscMockPrereq -Name "Microsoft Identity Extensions") ) } - Mock -CommandName Get-WindowsFeature -MockWith { - return @(@{ + Mock -CommandName Get-WindowsFeature -MockWith { + return @(@{ Name = "ExampleFeature" Installed = $true - }) + }) } It "Should return present from the get method" { @@ -259,9 +387,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } } - + Context -Name "Prerequisites are installed but should not be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true Ensure = "Absent" @@ -278,6 +407,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Prerequisites are not installed but should be and are to be installed in offline mode" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false Ensure = "Present" @@ -287,13 +417,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @() } -ParameterFilter { $null -ne $Path } - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 - } + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 + } } - Mock -CommandName Test-Path -MockWith { - return $true + Mock -CommandName Test-Path -MockWith { + return $true } It "Should throw an exception in the set method if required parameters are not set" { @@ -306,7 +436,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $requiredParams = @("SQLNCli","PowerShell","NETFX","IDFX","Sync","AppFabric","IDFX11","MSIPCClient","WCFDataServices","KB2671763","WCFDataServices56") } 16 { - $requiredParams = @("SQLNCli","Sync","AppFabric","IDFX11","MSIPCClient","KB3092423","WCFDataServices56","DotNetFx","MSVCRT11","MSVCRT14","ODBC") + if ($Global:SPDscHelper.CurrentStubBuildNumber.Build -lt 10000) + { + # SharePoint 2016 + $requiredParams = @("SQLNCli","Sync","AppFabric","IDFX11","MSIPCClient","KB3092423","WCFDataServices56","DotNetFx","MSVCRT11","MSVCRT14","ODBC") + } + else + { + # SharePoint 2019 + $requiredParams = @("SQLNCli","Sync","AppFabric","IDFX11","MSIPCClient","KB3092423","WCFDataServices56","DotNet472","MSVCRT141") + } } Default { throw [Exception] "A supported version of SharePoint was not used in testing" @@ -324,29 +463,30 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Prerequisites are not installed but should be and are to be installed in offline mode, but invalid paths have been passed" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false Ensure = "Present" } - Mock -CommandName Get-WindowsFeature -MockWith { - return @( @{ + Mock -CommandName Get-WindowsFeature -MockWith { + return @( @{ Name = "ExampleFeature" - Installed = $false - }) + Installed = $false + }) } - + Mock -CommandName Get-ItemProperty -MockWith { return @() } - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 - } + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 + } } - Mock -CommandName Test-Path -MockWith { - return $false + Mock -CommandName Test-Path -MockWith { + return $false } It "Should throw an exception in the set method if required parameters are not set" { @@ -373,11 +513,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { {Set-TargetResource @testParams} | Should Throw } } - + if ($majorBuildNumber -eq 15) { Context -Name "SharePoint 2013 is installing on a server with .NET 4.6" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true Ensure = "Present" @@ -388,13 +529,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Version = "4.6.0.0" Release = "0" PSChildName = "Full" - } + } $client = @{ Version = "4.6.0.0" Release = "0" PSChildName = "Client" - } + } $returnval = @($full, $client) $returnVal = $returnVal | Add-Member ScriptMethod GetValue { return 391000 } -PassThru @@ -407,10 +548,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { FileVersion = "15.0.4600.1000" } } - } -ParameterFilter { + } -ParameterFilter { $Path -eq "C:\SPInstall\updates\svrsetup.dll" } - + It "throws an error in the set method" { { Set-TargetResource @testParams } | Should Throw ("A known issue prevents installation of SharePoint 2013 on " + ` "servers that have .NET 4.6 already installed") @@ -419,6 +560,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "SharePoint 2013 is installing on a server with .NET 4.6 with compatibility update" { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $true Ensure = "Present" @@ -429,13 +571,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Version = "4.6.0.0" Release = "0" PSChildName = "Full" - } + } $client = @{ Version = "4.6.0.0" Release = "0" PSChildName = "Client" - } + } $returnval = @($full, $client) $returnVal = $returnVal | Add-Member ScriptMethod GetValue { return 391000 } -PassThru @@ -448,22 +590,23 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { FileVersion = "15.0.4709.1000" } } - } -ParameterFilter { + } -ParameterFilter { $Path -eq "C:\SPInstall\updates\svrsetup.dll" } - + It "should install prereqs" { Mock Start-Process { return @{ ExitCode = 0 } } Mock Test-Path { return $true } Set-TargetResource @testParams - Assert-MockCalled Start-Process -Scope It + Assert-MockCalled Start-Process -Scope It } } - } - + } + Context -Name "Prerequisites are not installed but should be and are to be installed in offline mode, with SXSstore specified" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" OnlineMode = $false SXSpath = "C:\SPInstall\SXS" @@ -474,14 +617,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @() } - Mock -CommandName Start-Process -MockWith { - return @{ - ExitCode = 0 - } + Mock -CommandName Start-Process -MockWith { + return @{ + ExitCode = 0 + } } - Mock -CommandName Test-Path -MockWith { - return $true + Mock -CommandName Test-Path -MockWith { + return $true } switch ($Global:SPDscHelper.CurrentStubBuildNumber.Major) @@ -501,43 +644,86 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "installs required Windows features from specified path" { - Mock -CommandName Install-WindowsFeature -MockWith { - return @( @{ - Name = "ExampleFeature" - Success = $true + Mock -CommandName Install-WindowsFeature -MockWith { + return @( @{ + Name = "ExampleFeature" + Success = $true RestartNeeded = "No" - }) + }) } Set-TargetResource @testParams - Assert-MockCalled Install-WindowsFeature + Assert-MockCalled Install-WindowsFeature } - + It "feature install requires a reboot" { - Mock -CommandName Install-WindowsFeature -MockWith { - return @( @{ - Name = "ExampleFeature" - Success = $true + Mock -CommandName Install-WindowsFeature -MockWith { + return @( @{ + Name = "ExampleFeature" + Success = $true RestartNeeded = "Yes" - }) + }) } Set-TargetResource @testParams - $global:DSCMachineStatus | Should Be 1 + $global:DSCMachineStatus | Should Be 1 } - + It "feature install failure throws an error" { - Mock -CommandName Install-WindowsFeature -MockWith { - return @( @{ - Name = "ExampleFeature" - Success = $false + Mock -CommandName Install-WindowsFeature -MockWith { + return @( @{ + Name = "ExampleFeature" + Success = $false RestartNeeded = "No" - }) + }) } - {Set-TargetResource @testParams} | should Throw "Error installing ExampleFeature" + {Set-TargetResource @testParams} | should Throw "Error installing ExampleFeature" } - } + } + + if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 16) + { + Context -Name "Unsupported OS is used" -Fixture { + $testParams = @{ + IsSingleInstance = "Yes" + InstallerPath = "C:\SPInstall\Prerequisiteinstaller.exe" + OnlineMode = $true + Ensure = "Present" + } + + Mock -CommandName Get-SPDscOSVersion -MockWith { + if ($Global:SPDscHelper.CurrentStubBuildNumber.Build -lt 10000) + { + # SharePoint 2016 + return @{ + Major = 6 + Minor = 2 + } + } + else + { + # SharePoint 2019 + return @{ + Major = 6 + Minor = 3 + } + } + } + + It "Should throw an exception from the get method" { + {Get-TargetResource @testParams} | Should Throw + } + + It "Should throw an exception from the test method" { + {Test-TargetResource @testParams} | Should Throw + } + + It "Should throw an exception from the set method" { + {Set-TargetResource @testParams} | Should Throw + } + } + } } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPIrmSettings.tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPIrmSettings.tests.ps1 index 67223c9e5..c9ed21104 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPIrmSettings.tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPIrmSettings.tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,22 +20,23 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts - Mock -CommandName Get-SPFarm -MockWith { - return @{} + # Mocks for all contexts + Mock -CommandName Get-SPFarm -MockWith { + return @{} } # Test contexts Context -Name "The server is not part of SharePoint farm" -Fixture { $testParams = @{ - Ensure = "Present" - RMSserver = "https://myRMSserver.local" + IsSingleInstance = "Yes" + Ensure = "Present" + RMSserver = "https://myRMSserver.local" } - Mock -CommandName Get-SPFarm -MockWith { - throw "Unable to detect local farm" + Mock -CommandName Get-SPFarm -MockWith { + throw "Unable to detect local farm" } - + It "Should return null from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Absent" } @@ -48,77 +49,79 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { Set-TargetResource @testParams } | Should throw "No local SharePoint farm was detected" } } - - Context -Name "IRM settings match desired settings" -Fixture { + + Context -Name "IRM settings match desired settings" -Fixture { $testParams = @{ - Ensure = "Present" - RMSserver = "https://myRMSserver.local" + IsSingleInstance = "Yes" + Ensure = "Present" + RMSserver = "https://myRMSserver.local" } Mock -CommandName Get-SPDSCContentService -MockWith { $returnVal = @{ IrmSettings = @{ - IrmRMSEnabled = $true + IrmRMSEnabled = $true IrmRMSUseAD = $false IrmRMSCertServer = "https://myRMSserver.local" } - } + } $returnVal = $returnVal | Add-Member -MemberType ScriptMethod ` -Name Update ` - -Value { - $Global:SPDscIRMUpdated = $true + -Value { + $Global:SPDscIRMUpdated = $true } -PassThru return $returnVal } - + It "Should return present in the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" } - + It "Should return true in the test method" { Test-TargetResource @testParams | Should Be $true } } - + Context -Name "IRM settings do not match desired settings" -Fixture { $testParams = @{ - Ensure = "Present" - RMSserver = "https://myRMSserver.local" + IsSingleInstance = "Yes" + Ensure = "Present" + RMSserver = "https://myRMSserver.local" } Mock -CommandName Get-SPDSCContentService -MockWith { $returnVal = @{ IrmSettings = @{ - IrmRMSEnabled = $false + IrmRMSEnabled = $false IrmRMSUseAD = $false - IrmRMSCertServer = $null + IrmRMSCertServer = $null } - } + } $returnVal = $returnVal | Add-Member -MemberType ScriptMethod ` -Name Update ` - -Value { - $Global:SPDscIRMUpdated = $true + -Value { + $Global:SPDscIRMUpdated = $true } -PassThru return $returnVal } - + It "Should return absent in the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - + It "Should return false in the test method" { - Test-TargetResource @testParams | Should Be $false + Test-TargetResource @testParams | Should Be $false } - + $Global:SPDscIRMUpdated = $false It "Should apply the settings in the set method" { Set-TargetResource @testParams $Global:SPDscIRMUpdated | Should Be $true } - + It "Should throw when UseAD and RMSserver are both supplied" { $testParams.Add("UseADRMS",$true) - { Set-TargetResource @testParams } | Should Throw + { Set-TargetResource @testParams } | Should Throw } } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPJoinFarm.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPJoinFarm.Tests.ps1 deleted file mode 100644 index 56f1e6a1f..000000000 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPJoinFarm.Tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -[CmdletBinding()] -[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] -param( - [Parameter()] - [string] - $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` - -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` - -Resolve) -) - -Import-Module -Name (Join-Path -Path $PSScriptRoot ` - -ChildPath "..\UnitTestHelper.psm1" ` - -Resolve) - -$Global:SPDscHelper = New-SPDscUnitTestHelper -SharePointStubModule $SharePointCmdletModule ` - -DscResource "SPJoinFarm" - -Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { - InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { - Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope - - # Initialize tests - $mockPassphrase = ConvertTo-SecureString -String "MyFarmPassphrase" -AsPlainText -Force - $mockPassphraseCredential = New-Object -TypeName System.Management.Automation.PSCredential ` - -ArgumentList @("passphrase", $mockPassphrase) - - $modulePath = "Modules\SharePointDsc\Modules\SharePointDsc.Farm\SPFarm.psm1" - Import-Module -Name (Join-Path -Path $Global:SPDscHelper.RepoRoot -ChildPath $modulePath -Resolve) - - # Mocks for all contexts - - # Test contexts - Context -Name "no farm is configured locally and a supported version of SharePoint is installed" { - $testParams = @{ - FarmConfigDatabaseName = "SP_Config" - DatabaseServer = "DatabaseServer\Instance" - Passphrase = $mockPassphraseCredential - } - - It "Should throw an exception in the get method" { - { Get-TargetResource @testParams } | Should Throw "SPCreateFarm: This resource has been removed. Please update your configuration to use SPFarm instead." - } - - It "Should throw an exception in the test method" { - { Test-TargetResource @testParams } | Should Throw "SPCreateFarm: This resource has been removed. Please update your configuration to use SPFarm instead." - } - - It "Should throw an exception in the set method" { - { Set-TargetResource @testParams } | Should Throw "SPCreateFarm: This resource has been removed. Please update your configuration to use SPFarm instead." - } - } - } -} - -Invoke-Command -ScriptBlock $Global:SPDscHelper.CleanupScript -NoNewScope diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPMinRoleCompliance.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPMinRoleCompliance.Tests.ps1 index ae109e145..14274f7ee 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPMinRoleCompliance.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPMinRoleCompliance.Tests.ps1 @@ -52,6 +52,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { 16 { Context -Name "The farm is not compliant as services aren't running but should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" State = "Compliant" } @@ -105,6 +106,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The farm is not compliant as services are running that shouldn't be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" State = "Compliant" } @@ -158,10 +160,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The farm is compliant and should be" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" State = "Compliant" } $testParams = @{ + IsSingleInstance = "Yes" State = "Compliant" } @@ -209,6 +213,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "NonCompliant is requested in any function" -Fixture { $testParams = @{ + IsSingleInstance = "Yes" State = "NonCompliant" } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPOutgoingEmailSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPOutgoingEmailSettings.Tests.ps1 index f37fbfd74..7928ab289 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPOutgoingEmailSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPOutgoingEmailSettings.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -28,12 +28,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { CharacterSet= "65001" } - Mock -CommandName Get-SPWebApplication -MockWith { + Mock -CommandName Get-SPWebApplication -MockWith { return $null } It "Should return null from the get method" { - Get-TargetResource @testParams | Should BeNullOrEmpty + Get-TargetResource @testParams | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -53,8 +53,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ReplyToAddress = "reply@email.com" CharacterSet= "65001" } - - Mock -CommandName Get-SPWebapplication -MockWith { + + Mock -CommandName Get-SPWebapplication -MockWith { return @{ Url= "http://sharepoint.contoso.com" OutboundMailServiceInstance= @{ @@ -67,15 +67,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { OutboundMailCodePage= "65001" } } - + It "Should return web app properties from the get method" { - Get-TargetResource @testParams | Should Not BeNullOrEmpty + Get-TargetResource @testParams | Should Not BeNullOrEmpty } It "Should return true from the test method" { Test-TargetResource @testParams | Should Be $true } - } + } Context -Name "The web application exists and the properties don't match" -Fixture { $testParams = @{ @@ -85,8 +85,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ReplyToAddress = "reply@email.com" CharacterSet= "65001" } - - Mock -CommandName Get-SPWebapplication -MockWith { + + Mock -CommandName Get-SPWebapplication -MockWith { $result = @{ Url= "http://sharepoint.contoso.com" OutboundMailServiceInstance= @{ @@ -101,15 +101,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $result = $result | Add-Member -MemberType ScriptMethod ` -Name UpdateMailSettings ` -Value { - param( + param( [string] - $SMTPServer, - + $SMTPServer, + [string] - $FromAddress, - + $FromAddress, + [string] - $ReplyToAddress, + $ReplyToAddress, [string] $CharacterSet ) @@ -146,15 +146,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should throw an exception in the get method" { - { Get-TargetResource @testParams } | Should Throw "UseTLS is only supported in SharePoint 2016." + { Get-TargetResource @testParams } | Should Throw "UseTLS is only supported in SharePoint 2016 and SharePoint 2019." } It "Should throw an exception in the test method" { - { Test-TargetResource @testParams } | Should Throw "UseTLS is only supported in SharePoint 2016." + { Test-TargetResource @testParams } | Should Throw "UseTLS is only supported in SharePoint 2016 and SharePoint 2019." } It "Should throw an exception in the set method" { - { Set-TargetResource @testParams } | Should Throw "UseTLS is only supported in SharePoint 2016." + { Set-TargetResource @testParams } | Should Throw "UseTLS is only supported in SharePoint 2016 and SharePoint 2019." } } @@ -169,22 +169,22 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should throw an exception in the get method" { - { Get-TargetResource @testParams } | Should Throw "SMTPPort is only supported in SharePoint 2016." + { Get-TargetResource @testParams } | Should Throw "SMTPPort is only supported in SharePoint 2016 and SharePoint 2019." } It "Should throw an exception in the test method" { - { Test-TargetResource @testParams } | Should Throw "SMTPPort is only supported in SharePoint 2016." + { Test-TargetResource @testParams } | Should Throw "SMTPPort is only supported in SharePoint 2016 and SharePoint 2019." } It "Should throw an exception in the set method" { - { Set-TargetResource @testParams } | Should Throw "SMTPPort is only supported in SharePoint 2016." + { Set-TargetResource @testParams } | Should Throw "SMTPPort is only supported in SharePoint 2016 and SharePoint 2019." } } } if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 16) { - Context -Name "The web application exists and the properties match - SharePoint 2016" -Fixture { + Context -Name "The web application exists and the properties match - SharePoint 2016/2019" -Fixture { $testParams = @{ WebAppUrl = "http://sharepoint.contoso.com" SMTPServer = "smtp.contoso.com" @@ -194,8 +194,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { UseTLS = $false SMTPPort = 25 } - - Mock -CommandName Get-SPWebapplication -MockWith { + + Mock -CommandName Get-SPWebapplication -MockWith { return @{ Url= "http://sharepoint.contoso.com" OutboundMailServiceInstance= @{ @@ -210,17 +210,17 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { OutboundMailPort = 25 } } - + It "Should return web app properties from the get method" { - Get-TargetResource @testParams | Should Not BeNullOrEmpty + Get-TargetResource @testParams | Should Not BeNullOrEmpty } It "Should return true from the test method" { Test-TargetResource @testParams | Should Be $true } - } + } - Context -Name "The web application exists and the properties don't match - SharePoint 2016" -Fixture { + Context -Name "The web application exists and the properties don't match - SharePoint 2016/2019" -Fixture { $testParams = @{ WebAppUrl = "http://sharepoint.contoso.com" SMTPServer = "smtp.contoso.com" @@ -230,8 +230,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { UseTLS = $true SMTPPort = 25 } - - Mock -CommandName Get-SPWebapplication -MockWith { + + Mock -CommandName Get-SPWebapplication -MockWith { $result = @{ Url= "http://sharepoint.contoso.com" OutboundMailServiceInstance= @{ @@ -248,16 +248,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $result = $result | Add-Member -MemberType ScriptMethod ` -Name UpdateMailSettings ` -Value { - param( + param( [string] - $SMTPServer, - + $SMTPServer, + [string] - $FromAddress, - + $FromAddress, + [string] $ReplyToAddress, - + [string] $CharacterSet, diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPPasswordChangeSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPPasswordChangeSettings.Tests.ps1 index 7fff7851b..370acaed8 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPPasswordChangeSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPPasswordChangeSettings.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -21,17 +21,18 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "No local SharePoint farm is available" { $testParams = @{ + IsSingleInstance = "Yes" MailAddress = "e@mail.com" DaysBeforeExpiry = 7 PasswordChangeWaitTimeSeconds = 60 } - Mock -CommandName Get-SPFarm -MockWith { - return $null + Mock -CommandName Get-SPFarm -MockWith { + return $null } It "Should return null from the get method" { - Get-TargetResource @testParams | Should BeNullOrEmpty + Get-TargetResource @testParams | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -42,12 +43,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "There is a local SharePoint farm and the properties are set correctly" { $testParams = @{ + IsSingleInstance = "Yes" MailAddress = "e@mail.com" DaysBeforeExpiry = 7 PasswordChangeWaitTimeSeconds = 60 } - - Mock -CommandName Get-SPFarm -MockWith { + + Mock -CommandName Get-SPFarm -MockWith { return @{ PasswordChangeEmailAddress = "e@mail.com" DaysBeforePasswordExpirationToSendEmail = 7 @@ -55,9 +57,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { PasswordChangeMaximumTries = 3 } } - + It "Should return farm properties from the get method" { - Get-TargetResource @testParams | Should Not BeNullOrEmpty + Get-TargetResource @testParams | Should Not BeNullOrEmpty } It "Should return true from the test method" { @@ -67,28 +69,29 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "There is a local SharePoint farm and the properties are not set correctly" { $testParams = @{ + IsSingleInstance = "Yes" MailAddress = "e@mail.com" DaysBeforeExpiry = 7 PasswordChangeWaitTimeSeconds = 60 } - - Mock -CommandName Get-SPFarm -MockWith { + + Mock -CommandName Get-SPFarm -MockWith { $result = @{ PasswordChangeEmailAddress = "" PasswordChangeGuardTime = 0 PasswordChangeMaximumTries = 0 DaysBeforePasswordExpirationToSendEmail = 0 } - $result = $result | Add-Member ScriptMethod Update { + $result = $result | Add-Member ScriptMethod Update { $Global:SPDscFarmUpdateCalled = $true return $true; - + } -PassThru return $result } It "Should return farm properties from the get method" { - Get-TargetResource @testParams | Should Not BeNullOrEmpty + Get-TargetResource @testParams | Should Not BeNullOrEmpty } It "Should return false from the test method" { diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPProductUpdate.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPProductUpdate.Tests.ps1 index e1e881c74..443b90162 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPProductUpdate.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPProductUpdate.Tests.ps1 @@ -45,6 +45,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return $service } + Mock -CommandName Get-SPDSCInstalledProductVersion { + return @{ + FileMajorPart = $Global:SPDscHelper.CurrentStubBuildNumber.Major + FileBuildPart = $Global:SPDscHelper.CurrentStubBuildNumber.Build + ProductBuildPart = $Global:SPDscHelper.CurrentStubBuildNumber.Build + } + } + Mock -CommandName Set-Service { return $null } @@ -183,7 +191,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -219,7 +234,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Cumulative Update" } Name = "serverlpksp2016-kb2880554-fullfile-x64-en-us.exe" @@ -234,7 +249,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -275,7 +297,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Cumulative Update" } Name = "serverlpksp2016-kb2880554-fullfile-x64-en-us.exe" @@ -290,7 +312,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -337,7 +366,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Cumulative Update" } Name = "serverlpksp2016-kb2880554-fullfile-x64-en-us.exe" @@ -352,7 +381,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -414,7 +450,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -450,7 +493,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Service Pack" } Name = "serverlpksp2016-kb2880554-fullfile-x64-en-us.exe" @@ -465,7 +508,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016") + } + else + { + return @("Microsoft SharePoint Server 2019") + } } } @@ -549,7 +599,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2019 - Dutch/Nederlands") + } } } @@ -585,7 +642,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Service Pack Language Pack" } Name = "serverlpksp2016-kb2880554-fullfile-x64-nl-nl.exe" @@ -600,7 +657,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } else { - return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + if($Global:SPDscHelper.CurrentStubBuildNumber.Minor.ToString().Length -le 4) + { + return @("Microsoft SharePoint Server 2016", "Language Pack for SharePoint and Project Server 2016 - Dutch/Nederlands") + } + else + { + return @("Microsoft SharePoint Server 2019", "Language Pack for SharePoint and Project Server 2016\9 - Dutch/Nederlands") + } } } @@ -641,7 +705,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Service Pack Language Pack" } Name = "serverlpksp2016-kb2880554-fullfile-x64.exe" @@ -687,7 +751,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Service Pack Language Pack" } Name = "serverlpksp2016-kb2880554-fullfile-x64-ab-yz.exe" @@ -733,7 +797,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Service Pack Language Pack" } Name = "serverlpksp2016-kb2880554-fullfile-x64-fr-fr.exe" @@ -779,7 +843,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { return @{ VersionInfo = @{ - FileVersion = "16.0.8000" + FileVersion = "16.0.15000" FileDescription = "Service Pack Language Pack" } Name = "serverlpksp2016-kb2880554-fullfile-x64-fr-fr.exe" diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.ProjectServerConnector.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPProjectServerConnector.Tests.ps1 similarity index 100% rename from Tests/Unit/SharePointDsc/SharePointDsc.ProjectServerConnector.Tests.ps1 rename to Tests/Unit/SharePointDsc/SharePointDsc.SPProjectServerConnector.Tests.ps1 diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPProjectServerLicense.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPProjectServerLicense.Tests.ps1 index ddb9e9241..77f7f9ec2 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPProjectServerLicense.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPProjectServerLicense.Tests.ps1 @@ -41,8 +41,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Project server license is not enabled, but it should be" -Fixture { $testParams = @{ - Ensure = "Present" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + Ensure = "Present" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } Mock -CommandName Get-ProjectServerLicense -MockWith { @@ -65,8 +66,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Project server license is enabled, and it should be" -Fixture { $testParams = @{ - Ensure = "Present" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + Ensure = "Present" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } Mock -CommandName Get-ProjectServerLicense -MockWith { @@ -84,7 +86,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Project server license is enabled, but it should not be" -Fixture { $testParams = @{ - Ensure = "Absent" + IsSingleInstance = "Yes" + Ensure = "Absent" } Mock -CommandName Get-ProjectServerLicense -MockWith { @@ -107,7 +110,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Project server license is not enabled, and it should not be" -Fixture { $testParams = @{ - Ensure = "Absent" + IsSingleInstance = "Yes" + Ensure = "Absent" } Mock -CommandName Get-ProjectServerLicense -MockWith { @@ -125,8 +129,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The farm is not in a state to determine the license status" -Fixture { $testParams = @{ - Ensure = "Present" - ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + IsSingleInstance = "Yes" + Ensure = "Present" + ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } Mock -CommandName Get-ProjectServerLicense -MockWith { @@ -140,7 +145,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The license should be enabled but no product key was provided" -Fixture { $testParams = @{ - Ensure = "Present" + IsSingleInstance = "Yes" + Ensure = "Present" } Mock -CommandName Get-ProjectServerLicense -MockWith { diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchContentSource.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchContentSource.Tests.ps1 index 02a8926ea..022ef3d86 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchContentSource.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchContentSource.Tests.ps1 @@ -111,11 +111,11 @@ namespace Microsoft.Office.Server.Search.Administration { } It "Should create the content source in the test method" { - { Test-TargetResource @testParams } | Should Throw "Parameter 'CrawlSetting' can only be set to custom for website content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" } It "Should create the content source in the set method" { - { Set-TargetResource @testParams } | Should Throw "Parameter 'CrawlSetting' can only be set to custom for website content sources" + { Set-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" } } @@ -236,11 +236,11 @@ namespace Microsoft.Office.Server.Search.Administration { } It "Should create the content source in the test method" { - { Test-TargetResource @testParams } | Should Throw "Parameter 'CrawlSetting' can only be set to custom for website content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" } It "Should create the content source in the set method" { - { Set-TargetResource @testParams } | Should Throw "Parameter 'CrawlSetting' can only be set to custom for website content sources" + { Set-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" } } @@ -298,14 +298,14 @@ namespace Microsoft.Office.Server.Search.Administration { ServiceAppName = "Search Service Application" ContentSourceType = "SharePoint" Addresses = @("http://site.contoso.com") - CrawlSetting = "CrawlEverything" + CrawlSetting = "CrawlFirstOnly" Ensure = "Present" } Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { return @{ Name = "Example content source" Type = "SharePoint" - SharePointCrawlBehavior = "CrawlVirtualServers" + SharePointCrawlBehavior = "CrawlSites" StartAddresses = @( @{ AbsoluteUri = "http://site.contoso.com" @@ -1018,6 +1018,404 @@ namespace Microsoft.Office.Server.Search.Administration { Test-TargetResource @testParams | Should Be $true } } + + Context -Name "A business content source does exist and should" -Fixture { + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + LOBSystemSet = @("MyDataSource", "MyDataSourceInstance") + Ensure = "Present" + } + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return @{ + Name = "Example content source" + Type = "Business" + IncrementalCrawlSchedule = $null + FullCrawlSchedule = $null + StartAddresses = @( + @{ + AbsoluteUri = "bdc3://segment1/segment2/segment3/MyDataSource/MyDataSourceInstance&fakevalue=1" + Segments = @("bdc3", "segment1", "segment2", "segment3", "MyDataSource", "MyDataSourceInstance&fakevalue=1") + } + ) + } + } + + It "Should return present from the get method" { + $result = Get-TargetResource @testParams + $result.Ensure | Should Be "Present" + } + + It "Should return the correct LOBSystemSet from the get method" { + $result = Get-TargetResource @testParams + $result.LOBSystemSet | Should Be $testParams.LOBSystemSet + } + + It "Should return true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context -Name "A business content source does not exist and should" -Fixture { + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + LOBSystemSet = @("MyDataSource", "MyDataSourceInstance") + Ensure = "Present" + } + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return $null + } + + Mock -CommandName New-SPEnterpriseSearchCrawlContentSource -MockWith { + return @{ + Type = "Business" + SearchApplication = $testParams.ServiceAppName + IncrementalCrawlSchedule = $null + FullCrawlSchedule = $null + LOBSystemSet = $testParams.LOBSystemSet + CrawlStatus = "Idle" + } + } + + Mock -CommandName Get-SPServiceApplicationProxyGroup -MockWith { + return @{ + Name = "Default Proxy Group" + } + } + + It "Should return absent from the get method" { + $result = Get-TargetResource @testParams + $result.Ensure | Should Be "Absent" + } + + It "Should return false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "Should create the new content source in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled -CommandName New-SPEnterpriseSearchCrawlContentSource + } + } + + Context -Name "A business content source does exist and shouldn't" -Fixture { + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + LOBSystemSet = @("MyDataSource", "MyDataSourceInstance") + Ensure = "Absent" + } + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return @{ + Name = "Example content source" + Type = "Business" + IncrementalCrawlSchedule = $null + FullCrawlSchedule = $null + StartAddresses = @( + @{ + AbsoluteUri = "bdc3://segment1/segment2/segment3/MyDataSource/MyDataSourceInstance&fakevalue=1" + Segments = @("bdc3", "segment1", "segment2", "segment3", "MyDataSource", "MyDataSourceInstance&fakevalue=1") + } + ) + } + } + + It "Should return present from the get method" { + $result = Get-TargetResource @testParams + $result.Ensure | Should Be "Present" + } + + It "Should return false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "Should remove the content source in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled -CommandName Remove-SPEnterpriseSearchCrawlContentSource + } + } + + Context -Name "A business content source doesn't exist and shouldn't" -Fixture { + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + LOBSystemSet = @("MyDataSource", "MyDataSourceInstance") + Ensure = "Absent" + } + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return $null + } + + It "Should return absent from the get method" { + $result = Get-TargetResource @testParams + $result.Ensure | Should Be "Absent" + } + + It "Should return true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context -Name "Invalid Content Source Type" { + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + Ensure = "Present" + } + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return @{ + Name = "Example content source" + Type = "FakeType" + } + } + + It "Should throw unsupported type error" { + { Get-TargetResource @testParams } | Should Throw "SharePointDsc does not currently support 'FakeType' content sources. Please use only 'SharePoint', 'FileShare', 'Website' or 'Business'." + } + } + + Context -Name "SharePoint Content Source with Invalid Parameters" { + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return $null + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "SharePoint" + LimitPageDepth = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitPageDepth is not valid for SharePoint content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitPageDepth is not valid for SharePoint content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "SharePoint" + LimitServerHops = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for SharePoint content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for SharePoint content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "SharePoint" + IncrementalSchedule = (New-CimInstance -ClassName MSFT_SPSearchCrawlSchedule -Property @{ + ScheduleType = "Weekly" + StartHour = "0" + StartMinute = "0" + CrawlScheduleDaysOfWeek = @("Monday", "Wednesday", "Friday") + } -ClientOnly) + ContinuousCrawl = $true + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "You can not specify an incremental crawl schedule on a content source that will use continous crawl" + { Test-TargetResource @testParams } | Should Throw "You can not specify an incremental crawl schedule on a content source that will use continous crawl" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "SharePoint" + CrawlSetting = "Custom" + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" + } + } + + Context -Name "Website Content Source with Invalid Parameters" { + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return $null + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Website" + ContinuousCrawl = $true + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter ContinuousCrawl is not valid for website content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter ContinuousCrawl is not valid for website content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Website" + LimitServerHops = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for website content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for website content sources" + } + } + + Context -Name "FileShare Content Source with Invalid Parameters" { + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return $null + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "FileShare" + LimitPageDepth = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitPageDepth is not valid for file share content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitPageDepth is not valid for file share content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "FileShare" + LimitServerHops = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for file share content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for file share content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "FileShare" + CrawlSetting = "Custom" + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter CrawlSetting can only be set to custom for website content sources" + } + } + + Context -Name "Business Content Source with Invalid Parameters" { + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + return $null + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + LimitPageDepth = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitPageDepth is not valid for Business content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitPageDepth is not valid for Business content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + LimitServerHops = 1 + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for Business content sources" + { Test-TargetResource @testParams } | Should Throw "Parameter LimitServerHops is not valid for Business content sources" + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "Business" + ContinuousCrawl = $true + Ensure = "Present" + } + + It "Should throw Invalid parameter error" { + { Set-TargetResource @testParams } | Should Throw "Parameter ContinuousCrawl is not valid for Business content sources" + } + } + + Context -Name "Trying to change Content Source Type" { + + Mock -CommandName Get-SPEnterpriseSearchCrawlContentSource -MockWith { + $returnval = @{ + Name = "Example content source" + } + $returnval = $returnval | Add-Member -MemberType NoteProperty ` + -Name Type ` + -Value "Business" ` + -PassThru | + Add-Member -MemberType ScriptMethod ` + -Name StopCrawl ` + -Value { + $null + } -PassThru -Force + return $returnval + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "FileShare" + Ensure = "Present" + } + + It "Should throw error complaining cannot change type without the force parameter" { + { Set-TargetResource @testParams } | Should Throw "The type of the a search content source can not be changed from 'Business' to 'FileShare' without deleting and adding it again. Specify 'Force = `$true' in order to allow DSC to do this, or manually remove the existing content source and re-run the configuration." + } + + $testParams = @{ + Name = "Example content source" + ServiceAppName = "Search Service Application" + ContentSourceType = "FileShare" + Force = $true + Ensure = "Present" + } + + It "Should change the Content Source Type" { + Set-TargetResource @testParams + + Assert-MockCalled -CommandName Remove-SPEnterpriseSearchCrawlContentSource + } + } } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchMetadataCategory.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchMetadataCategory.Tests.ps1 new file mode 100644 index 000000000..8f5db8237 --- /dev/null +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchMetadataCategory.Tests.ps1 @@ -0,0 +1,133 @@ +[CmdletBinding()] +param( + [Parameter()] + [string] + $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` + -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` + -Resolve) +) + +Import-Module -Name (Join-Path -Path $PSScriptRoot ` + -ChildPath "..\UnitTestHelper.psm1" ` + -Resolve) + +$Global:SPDscHelper = New-SPDscUnitTestHelper -SharePointStubModule $SharePointCmdletModule ` + -DscResource "SPSearchMetadataCategory" + +Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { + InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { + Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope + + # Mocks for all contexts + Mock -CommandName Get-SPEnterpriseSearchServiceApplication { + return @{ + SearchCenterUrl = "http://example.sharepoint.com/pages" + } + } + + Mock -CommandName New-SPEnterpriseSearchMetadataCategory { + return @{ + Name = "Test Category" + } + } + + Mock -CommandName Set-SPEnterpriseSearchMetadataCategory { + return @{} + } + + Mock -CommandName Remove-SPEnterpriseSearchMetadataCategory { + return @{} + } + + # Test contexts + Context -Name "A search metadata category doesn't exist and should" -Fixture { + Mock -CommandName Get-SPEnterpriseSearchMetadataCategory { + return $null + } + + $testParams = @{ + Name = "Test Category" + ServiceAppName = "Search Service Application" + AutoCreateNewManagedProperties = $true + DiscoverNewProperties = $true + MapToContents = $true + Ensure = "Present" + } + + It "Should return absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" + } + + It "Should return false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "Should create the result source in the set method" { + Set-TargetResource @testParams + } + } + + Context -Name "A search metadata category exists and shouldn't" -Fixture { + Mock -CommandName Get-SPEnterpriseSearchMetadataCategory { + return @{ + Name = "Test Category" + } + } + + $testParams = @{ + Name = "Test Category" + ServiceAppName = "Search Service Application" + Ensure = "Absent" + } + + It "Should return Present from the Get Method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "Should delete the content source within the Set Method" { + Set-TargetResource @testParams + } + } + + Context -Name "Trying to delete a non-empty metadata category" -Fixture { + Mock -CommandName Get-SPEnterpriseSearchMetadataCategory { + return @{ + Name = "Test Category" + CrawledPropertyCount = 1 + } + } + + $testParams = @{ + Name = "Test Category" + ServiceAppName = "Search Service Application" + Ensure = "Absent" + } + + It "Should throw an error from the Set Method" { + { Set-TargetResource @testParams } | Should Throw + } + } + + Context -Name "An invalid Search Service Aplication was specified" -Fixture { + $testParams = @{ + Name = "Test Category" + ServiceAppName = "Search Service Application" + Ensure = "Absent" + } + + Mock -CommandName Get-SPEnterpriseSearchServiceApplication { + return $null + } + + It "Should throw an error in the Get Method" { + { Get-TargetResource @testParams } | Should Throw + } + + It "Should throw an error in the Set Method" { + { Set-TargetResource @testParams } | Should Throw + } + } + } +} + +Invoke-Command -ScriptBlock $Global:SPDscHelper.CleanupScript -NoNewScope diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchResultSource.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchResultSource.Tests.ps1 index 247785119..6d0d3c727 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchResultSource.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchResultSource.Tests.ps1 @@ -12,27 +12,27 @@ Import-Module -Name (Join-Path -Path $PSScriptRoot ` -Resolve) $Global:SPDscHelper = New-SPDscUnitTestHelper -SharePointStubModule $SharePointCmdletModule ` - -DscResource "SPSearchresultSource" + -DscResource "SPSearchResultSource" Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope try { # Initialize tests - Add-Type -TypeDefinition @" -namespace Microsoft.Office.Server.Search.Administration { - public enum SearchObjectLevel - { - SPWeb, - SPSite, - SPSiteSubscription, - Ssa - } -} + Add-Type -TypeDefinition @" + namespace Microsoft.Office.Server.Search.Administration { + public enum SearchObjectLevel + { + SPWeb, + SPSite, + SPSiteSubscription, + Ssa + } + } "@ -ErrorAction SilentlyContinue } catch { - + Write-Verbose "Could not instantiante the enum Microsoft.Office.Server.Search.Administration.SearchObjectLevel" } # Mocks for all contexts @@ -91,6 +91,16 @@ catch { -Value { return $Global:SPDscResultSourceProviders } ` + | Add-Member -Name ListSources ` + -MemberType ScriptMethod ` + -PassThru ` + -Value { + return @( + @{ + Name = "Test source" + } + ) + } ` | Add-Member -Name CreateSource ` -MemberType ScriptMethod ` -PassThru ` @@ -114,10 +124,6 @@ catch { -MemberType ScriptMethod ` -PassThru ` -Value { } ` - | Add-Member -Name ListSources ` - -MemberType ScriptMethod ` - -PassThru ` - -Value { } } "Microsoft.Office.Server.Search.Administration.SearchObjectFilter" { return [System.Object]::new() | Add-Member -Name IncludeHigherLevel ` @@ -138,7 +144,9 @@ catch { # Test contexts Context -Name "A search result source doesn't exist and should" -Fixture { $testParams = @{ - Name = "Test source" + Name = "New source" + ScopeName = "SSA" + ScopeUrl = "Global" SearchServiceAppName = "Search Service Application" ProviderType = "Remote SharePoint Provider" Query = "{searchTerms}" @@ -164,6 +172,8 @@ catch { Context -Name "A search result source exists and should" -Fixture { $testParams = @{ Name = "Test source" + ScopeName = "SSA" + ScopeUrl = "https://sharepoint.contoso.com" SearchServiceAppName = "Search Service Application" ProviderType = "Remote SharePoint Provider" Query = "{searchTerms}" @@ -191,9 +201,11 @@ catch { Context -Name "A search result source exists and shouldn't" -Fixture { $testParams = @{ Name = "Test source" + ScopeUrl = "Global" SearchServiceAppName = "Search Service Application" ProviderType = "Remote SharePoint Provider" Query = "{searchTerms}" + ScopeName = "SSA" ConnectionUrl = "https://sharepoint.contoso.com" Ensure = "Absent" } @@ -221,7 +233,9 @@ catch { Context -Name "A search result source doesn't exist and shouldn't" -Fixture { $testParams = @{ - Name = "Test source" + Name = "Non-Existing source" + ScopeName = "SSA" + ScopeUrl = "Global" SearchServiceAppName = "Search Service Application" ProviderType = "Remote SharePoint Provider" Query = "{searchTerms}" @@ -240,9 +254,11 @@ catch { } } - Context -Name "The search centre site collection does not exist when trying to set a result source" -Fixture { + Context -Name "Valid SPWeb ScopeName was provided" -Fixture { $testParams = @{ - Name = "Test source" + Name = "New source" + ScopeName = "SPWeb" + ScopeUrl = "https://SharePoint.contoso.com" SearchServiceAppName = "Search Service Application" ProviderType = "Remote SharePoint Provider" Query = "{searchTerms}" @@ -250,10 +266,6 @@ catch { Ensure = "Present" } - Mock -CommandName Get-SPWeb -MockWith { - return $null - } - It "Should return absent from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Absent" } @@ -262,19 +274,20 @@ catch { Test-TargetResource @testParams | Should Be $false } - It "Should throw an exception trying to create the result source in the set method" { - { Set-TargetResource @testParams } | Should throw + It "Should create the result source in the set method" { + Set-TargetResource @testParams } } Context -Name "Local Result Source" -Fixture { $testParams = @{ - Name = "Test source" + Name = "Test source Local" SearchServiceAppName = "Search Service Application" ProviderType = "Remote SharePoint Provider" Query = "{searchTerms}" ConnectionUrl = "https://sharepoint.contoso.com" - ScopeUrl = "https://sharepoint.contoso.com" + ScopeName = "SSA" + ScopeUrl = "Global" Ensure = "Present" } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchServiceApp.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchServiceApp.Tests.ps1 index a1eeb0344..73d76b788 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchServiceApp.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPSearchServiceApp.Tests.ps1 @@ -203,6 +203,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name GetType -Value { return @{ FullName = $getTypeFullName } } -PassThru -Force + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name IsConnected -Value { + return $true + } -PassThru -Force return $spServiceApp } @@ -212,6 +215,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } + Mock -CommandName Get-SPServiceApplicationProxy -MockWith { + return @{ + Name = "$($testParams.Name) Proxy" + } + } + It "Should return false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } @@ -224,6 +233,107 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } + Context -Name "When a service application exists and the Proxy Name is not configured correctly" -Fixture { + $testParams = @{ + Name = "Search Service Application" + ProxyName = "Search SA Proxy" + ApplicationPool = "SharePoint Search Services" + Ensure = "Present" + } + + Mock -CommandName Get-SPServiceApplication -MockWith { + $spServiceApp = [PSCustomObject]@{ + TypeName = "Search Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + NormalizedDataSource = $testParams.DatabaseServer + } + } + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name GetType -Value { + return @{ FullName = $getTypeFullName } + } -PassThru -Force + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name IsConnected -Value { + return $true + } -PassThru -Force + return $spServiceApp + } + + Mock -CommandName Get-SPServiceApplicationPool -MockWith { + return @{ + Name = $testParams.ApplicationPool + } + } + + Mock -CommandName Get-SPServiceApplicationProxy -MockWith { + $returnval = @{ + Name = "$($testParams.Name) Proxy" + } + $returnval = $returnval | Add-Member -MemberType ScriptMethod -Name Update -Value { + $global:SPDscProxyUpdateCalled = $true + } -PassThru -Force + return $returnval + } + + It "Should return false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + + $global:SPDscProxyUpdateCalled = $false + It "Should update the service app proxy name in the set method" { + Set-TargetResource @testParams + $global:SPDscProxyUpdateCalled | Should Be $true + } + } + + Context -Name "When a service application exists, but the Proxy doesn't" -Fixture { + $testParams = @{ + Name = "Search Service Application" + ProxyName = "Search SA Proxy" + ApplicationPool = "SharePoint Search Services" + Ensure = "Present" + } + + Mock -CommandName Get-SPServiceApplication -MockWith { + $spServiceApp = [PSCustomObject]@{ + TypeName = "Search Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + NormalizedDataSource = $testParams.DatabaseServer + } + } + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name GetType -Value { + return @{ FullName = $getTypeFullName } + } -PassThru -Force + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name IsConnected -Value { + return $false + } -PassThru -Force + return $spServiceApp + } + + Mock -CommandName Get-SPServiceApplicationPool -MockWith { + return @{ + Name = $testParams.ApplicationPool + } + } + + Mock -CommandName Get-SPServiceApplicationProxy -MockWith { + return $null + } + + It "Should return false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + + It "Should create a new proxy in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPEnterpriseSearchServiceApplicationProxy + } + } + Context -Name "When the default content access account does not match" -Fixture { $testParams = @{ Name = "Search Service Application" @@ -245,6 +355,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name GetType -Value { return @{ FullName = $getTypeFullName } } -PassThru -Force + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name IsConnected -Value { + return $true + } -PassThru -Force return $spServiceApp } @@ -256,6 +369,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $TypeName -eq "Microsoft.Office.Server.Search.Administration.Content" } + Mock -CommandName Get-SPServiceApplicationProxy -MockWith { + return @{ + Name = "$($testParams.Name) Proxy" + } + } + It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false } @@ -334,6 +453,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name GetType -Value { return @{ FullName = $getTypeFullName } } -PassThru -Force + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name IsConnected -Value { + return $true + } -PassThru -Force return $spServiceApp } @@ -351,6 +473,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $TypeName -eq "Microsoft.Office.Server.Search.Administration.Content" } + Mock -CommandName Get-SPServiceApplicationProxy -MockWith { + return @{ + Name = "$($testParams.Name) Proxy" + } + } + It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false } @@ -570,11 +698,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return $spServiceApp } - it "Should return the current value in the get method" { + It "Should return the current value in the get method" { (Get-TargetResource @testParams).WindowsServiceAccount | Should Not BeNullOrEmpty } - it "Should return true in the test method" { + It "Should return true in the test method" { Test-TargetResource @testParams | Should Be $true } } @@ -600,6 +728,9 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name GetType -Value { return @{ FullName = $getTypeFullName } } -PassThru -Force + $spServiceApp = $spServiceApp | Add-Member -MemberType ScriptMethod -Name IsConnected -Value { + return $true + } -PassThru -Force return $spServiceApp } @@ -609,15 +740,21 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - it "Should return the current value in the get method" { + Mock -CommandName Get-SPServiceApplicationProxy -MockWith { + return @{ + Name = "$($testParams.Name) Proxy" + } + } + + It "Should return the current value in the get method" { (Get-TargetResource @testParams).WindowsServiceAccount | Should Not BeNullOrEmpty } - it "Should return false in the test method" { + It "Should return false in the test method" { Test-TargetResource @testParams | Should Be $false } - it "Should update the account in the set method" { + It "Should update the account in the set method" { Set-TargetResource @testParams Assert-MockCalled -CommandName "Set-SPEnterpriseSearchService" diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPSecurityTokenServiceConfig.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPSecurityTokenServiceConfig.Tests.ps1 index 59fafdeaa..5925f4794 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPSecurityTokenServiceConfig.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPSecurityTokenServiceConfig.Tests.ps1 @@ -24,6 +24,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } $testParams = @{ + IsSingleInstance = "Yes" Name = "Security Token Service" } @@ -34,6 +35,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When setting the configurations for the Security Token Service" { $params = @{ + IsSingleInstance = "Yes" Name = "New name" Ensure = "Present" } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPSelfServiceSiteCreation.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPSelfServiceSiteCreation.Tests.ps1 index 2c4dc12d8..1f43d64f7 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPSelfServiceSiteCreation.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPSelfServiceSiteCreation.Tests.ps1 @@ -46,7 +46,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Self service site creation settings matches the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Enabled = $true OnlineEnabled = $false QuotaTemplate = "SSCQoutaTemplate" @@ -79,7 +79,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should return the current data from the get method" { $result = Get-TargetResource @testParams - $result.Url | Should Be "http://sites.sharepoint.com" + $result.WebAppUrl | Should Be "http://sites.sharepoint.com" $result.Enabled | Should Be $true $result.OnlineEnabled | Should Be $false $result.QuotaTemplate | Should Be "SSCQoutaTemplate" @@ -103,7 +103,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Self service site creation settings does not matches the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Enabled = $true OnlineEnabled = $false QuotaTemplate = "SSCQoutaTemplate" @@ -144,7 +144,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Disabling self service site creation does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Enabled = $false } @@ -181,7 +181,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Disabling self service site creation and enabling show start a site menu item" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Enabled = $false ShowStartASiteMenuItem = $true } @@ -216,7 +216,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Web application does not exist" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Enabled = $true } @@ -227,7 +227,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should return a valid object with null on all properties" { $result = Get-TargetResource @testParams $result | Should Not BeNullOrEmpty - $result.Url | Should Be $null + $result.WebAppUrl | Should Be $null $result.Enabled | Should Be $null $result.OnlineEnabled | Should Be $null $result.QuotaTemplate | Should Be $null diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPServiceAppSecurity.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPServiceAppSecurity.Tests.ps1 index 68717ff97..09e076fda 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPServiceAppSecurity.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPServiceAppSecurity.Tests.ps1 @@ -60,13 +60,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }), (New-CimInstance -ClassName "MSFT_SPServiceAppSecurityEntry" ` -ClientOnly ` -Property @{ Username = "CONTOSO\user2" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) } @@ -112,7 +112,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) MembersToInclude = @( @@ -120,7 +120,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) MembersToExclude = @("CONTOSO\user2") @@ -140,17 +140,17 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { ServiceAppName = "Example Service App" SecurityType = "SharingPermissions" Members = @( - (New-CimInstance -ClassName "MSFT_SPServiceAppSecurityEntry" ` + (New-CimInstance -ClassName "MSFT_SPSearchServiceAppSecurityEntry" ` -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }), - (New-CimInstance -ClassName "MSFT_SPServiceAppSecurityEntry" ` + (New-CimInstance -ClassName "MSFT_SPSearchServiceAppSecurityEntry" ` -ClientOnly ` -Property @{ Username = "CONTOSO\user2" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) } @@ -180,8 +180,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should call the update cmdlet from the set method" { Set-TargetResource @testParams - Assert-MockCalled Grant-SPObjectSecurity - Assert-MockCalled Revoke-SPObjectSecurity + Assert-MockCalled Grant-SPObjectSecurity -ParameterFilter {$Replace -eq $true} Assert-MockCalled Set-SPServiceApplicationSecurity } } @@ -195,13 +194,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }), (New-CimInstance -ClassName "MSFT_SPServiceAppSecurityEntry" ` -ClientOnly ` -Property @{ Username = "CONTOSO\user2" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) } @@ -210,19 +209,42 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @{} } - Mock -CommandName Get-SPServiceApplicationSecurity -MockWith { - return @{ + Mock -CommandName Get-SPServiceApplicationSecurity { + $security = @{ + NamedAccessRights = @( + @{ + Name = "Full Control" + Rights = @{ + RightsFlags = 0xff + } + } + ) AccessRules = @( @{ Name = "CONTOSO\user1" - AllowedRights = "FullControl" - }, + AllowedObjectRights = + @{ + RightsFlags = 0xff + } + } @{ Name = "CONTOSO\user2" - AllowedRights = "FullControl" + AllowedObjectRights = + @{ + RightsFlags = 0xff + } } ) } + + $security.NamedAccessRights | ForEach-Object { $_.Rights } | Add-Member -MemberType ScriptMethod ` + -Name IsSubsetOf ` + -Value { + param($objectRights) + return ($objectRights.RightsFlags -band $this.RightsFlags) -eq $this.RightsFlags + } + + return $security } It "Should return a list of current members from the get method" { @@ -243,7 +265,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) MembersToExclude = @("CONTOSO\user2") @@ -326,7 +348,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) MembersToExclude = @("CONTOSO\user2") @@ -336,15 +358,35 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @{} } - Mock -CommandName Get-SPServiceApplicationSecurity -MockWith { - return @{ + Mock -CommandName Get-SPServiceApplicationSecurity { + $security = @{ + NamedAccessRights = @( + @{ + Name = "Full Control" + Rights = @{ + RightsFlags = 0xff + } + } + ) AccessRules = @( @{ Name = "CONTOSO\user1" - AllowedRights = "FullControl" + AllowedObjectRights = + @{ + RightsFlags = 0xff + } } ) } + + $security.NamedAccessRights | ForEach-Object { $_.Rights } | Add-Member -MemberType ScriptMethod ` + -Name IsSubsetOf ` + -Value { + param($objectRights) + return ($objectRights.RightsFlags -band $this.RightsFlags) -eq $this.RightsFlags + } + + return $security } It "Should return a list of current members from the get method" { @@ -365,7 +407,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Read" + AccessLevels = "Read" }) ) } @@ -399,7 +441,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Read" + AccessLevels = "Read" }) ) } @@ -425,8 +467,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should call the update cmdlet from the set method" { Set-TargetResource @testParams - Assert-MockCalled Grant-SPObjectSecurity -Times 1 - Assert-MockCalled Revoke-SPObjectSecurity -Times 1 + Assert-MockCalled Grant-SPObjectSecurity -Times 1 -ParameterFilter {$Replace -eq $true} Assert-MockCalled Set-SPServiceApplicationSecurity -Times 1 } } @@ -440,7 +481,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Read" + AccessLevels = "Read" }) ) } @@ -466,8 +507,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should call the update cmdlet from the set method" { Set-TargetResource @testParams - Assert-MockCalled Grant-SPObjectSecurity -Times 1 - Assert-MockCalled Revoke-SPObjectSecurity -Times 1 + Assert-MockCalled Grant-SPObjectSecurity -Times 1 -ParameterFilter {$Replace -eq $true} Assert-MockCalled Set-SPServiceApplicationSecurity -Times 1 } } @@ -495,7 +535,6 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should call the update cmdlet from the set method" { Set-TargetResource @testParams Assert-MockCalled Grant-SPObjectSecurity -Times 0 - Assert-MockCalled Revoke-SPObjectSecurity -Times 0 Assert-MockCalled Set-SPServiceApplicationSecurity -Times 1 } } @@ -542,7 +581,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "CONTOSO\user1" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) MembersToExclude = @("CONTOSO\user2") @@ -552,14 +591,35 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @{} } Mock -CommandName Get-SPServiceApplicationSecurity { - return @{ + $security = @{ + NamedAccessRights = @( + @{ + Name = "Full Control" + Rights = @{ + RightsFlags = 0xff + } + + } + ) AccessRules = @( @{ Name = "i:0#.w|s-1-5-21-2753725054-2932589700-2007370523-2138" - AllowedRights = "FullControl" + AllowedObjectRights = + @{ + RightsFlags = 0xff + } } ) } + + $security.NamedAccessRights | ForEach-Object { $_.Rights } | Add-Member -MemberType ScriptMethod ` + -Name IsSubsetOf ` + -Value { + param($objectRights) + return ($objectRights.RightsFlags -band $this.RightsFlags) -eq $this.RightsFlags + } + + return $security } Mock Resolve-SPDscSecurityIdentifier { @@ -584,7 +644,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "{LocalFarm}" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) } @@ -593,15 +653,36 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { return @{} } - Mock -CommandName Get-SPServiceApplicationSecurity -MockWith { - return @{ + Mock -CommandName Get-SPServiceApplicationSecurity { + $security = @{ + NamedAccessRights = @( + @{ + Name = "Full Control" + Rights = @{ + RightsFlags = 0xff + } + + } + ) AccessRules = @( @{ Name = "c:0%.c|system|02a0cea2-d4e0-4e4e-ba2e-e532a433cfef" - AllowedRights = "FullControl" + AllowedObjectRights = + @{ + RightsFlags = 0xff + } } ) } + + $security.NamedAccessRights | ForEach-Object { $_.Rights } | Add-Member -MemberType ScriptMethod ` + -Name IsSubsetOf ` + -Value { + param($objectRights) + return ($objectRights.RightsFlags -band $this.RightsFlags) -eq $this.RightsFlags + } + + return $security } It "Should return local farm token in the list of current members from the get method" { @@ -623,7 +704,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "{LocalFarm}" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) } @@ -660,7 +741,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { -ClientOnly ` -Property @{ Username = "{LocalFarm}" - AccessLevel = "Full Control" + AccessLevels = "Full Control" }) ) } @@ -759,6 +840,77 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Assert-MockCalled Set-SPServiceApplicationSecurity } } + Context -Name "Access level that includes other access levels is specified when multiple named access rights exists" -Fixture { + $testParams = @{ + ServiceAppName = "Example Service App" + SecurityType = "SharingPermissions" + MembersToInclude = @( + (New-CimInstance -ClassName "MSFT_SPServiceAppSecurityEntry" ` + -ClientOnly ` + -Property @{ + Username = "CONTOSO\user1" + AccessLevels = "Contribute" + }) + ) + } + + Mock -CommandName Get-SPServiceApplication -MockWith { + return @{} + } + + Mock -CommandName Get-SPServiceApplicationSecurity { + $security = @{ + NamedAccessRights = @( + @{ + Name = "Full Control" + Rights = @{ + RightsFlags = 0xff + } + } + @{ + Name = "Contribute" + Rights = @{ + RightsFlags = 0x0f + } + } + @{ + Name = "Read" + Rights = @{ + RightsFlags = 0x01 + } + } + ) + AccessRules = @( + @{ + Name = "CONTOSO\user1" + AllowedObjectRights = + @{ + RightsFlags = 0x0f + } + } + ) + } + + $security.NamedAccessRights | ForEach-Object { $_.Rights } | Add-Member -MemberType ScriptMethod ` + -Name IsSubsetOf ` + -Value { + param($objectRights) + return ($objectRights.RightsFlags -band $this.RightsFlags) -eq $this.RightsFlags + } + + return $security + } + + It "Should return list of all named access rights included for user" { + $result = Get-TargetResource @testParams + $result.Members | Should Not BeNullOrEmpty + $result.Members[0].AccessLevels | Should Be @("Contribute", "Read") + } + + It "Should return true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPShellAdmins.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPShellAdmins.Tests.ps1 index 3fdb48fef..07b8e8fc7 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPShellAdmins.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPShellAdmins.Tests.ps1 @@ -25,8 +25,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "The server is not part of SharePoint farm" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Members = "contoso\user1", "contoso\user2" + IsSingleInstance = "Yes" + Members = "contoso\user1", "contoso\user2" } Mock -CommandName Get-SPFarm -MockWith { @@ -34,7 +34,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should return null from the get method" { - (Get-TargetResource @testParams).Name | Should BeNullOrEmpty + $result = Get-TargetResource @testParams + $result.Members | Should BeNullOrEmpty + $result.MembersToInclude | Should BeNullOrEmpty + $result.MembersToExclude | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -48,7 +51,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "ContentDatabases and AllContentDatabases parameters used simultaneously" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Members = "contoso\user1", "contoso\user2" Databases = @( (New-CimInstance -ClassName MSFT_SPContentDatabasePermissions -Property @{ @@ -60,7 +63,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should return null from the get method" { - (Get-TargetResource @testParams).Name | Should BeNullOrEmpty + $result = Get-TargetResource @testParams + $result.Members | Should BeNullOrEmpty + $result.MembersToInclude | Should BeNullOrEmpty + $result.MembersToExclude | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -74,13 +80,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Members and MembersToInclude parameters used simultaneously - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Members = "contoso\user1", "contoso\user2" MembersToInclude = "contoso\user1", "contoso\user2" } It "Should return null from the get method" { - (Get-TargetResource @testParams).Name | Should BeNullOrEmpty + $result = Get-TargetResource @testParams + $result.Members | Should BeNullOrEmpty + $result.MembersToInclude | Should BeNullOrEmpty + $result.MembersToExclude | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -94,11 +103,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "None of the Members, MembersToInclude and MembersToExclude parameters are used - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" } It "Should return null from the get method" { - (Get-TargetResource @testParams).Name | Should BeNullOrEmpty + $result = Get-TargetResource @testParams + $result.Members | Should BeNullOrEmpty + $result.MembersToInclude | Should BeNullOrEmpty + $result.MembersToExclude | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -112,7 +124,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Members and MembersToInclude parameters used simultaneously - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" @@ -123,7 +135,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should return null from the get method" { - (Get-TargetResource @testParams).Name | Should BeNullOrEmpty + $result = Get-TargetResource @testParams + $result.Members | Should BeNullOrEmpty + $result.MembersToInclude | Should BeNullOrEmpty + $result.MembersToExclude | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -137,7 +152,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Databases and ExcludeDatabases parameters used simultaneously" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" @@ -162,7 +177,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "None of the Members, MembersToInclude and MembersToExclude parameters are used - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" @@ -171,7 +186,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should return null from the get method" { - (Get-TargetResource @testParams).Name | Should BeNullOrEmpty + $result = Get-TargetResource @testParams + $result.Members | Should BeNullOrEmpty + $result.MembersToInclude | Should BeNullOrEmpty + $result.MembersToExclude | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -185,7 +203,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Specified content database does not exist - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso3" @@ -212,7 +230,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should return false from the test method" { - { Test-TargetResource @testParams } | Should throw "Specified database does not exist" + Test-TargetResource @testParams | Should Be $false } It "Should throw an exception in the set method" { @@ -222,7 +240,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "AllDatabases parameter is used and permissions do not match" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Members = "contoso\user1", "contoso\user2" AllDatabases = $true } @@ -232,14 +250,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { { # Database parameter used, return database permissions return @{ - UserName = "contoso\user1","contoso\user2" + UserName = "contoso\user3","contoso\user4" } } else { # Database parameter not used, return general permissions return @{ - UserName = "contoso\user1","contoso\user2" + UserName = "contoso\user3","contoso\user4" } } } @@ -262,13 +280,19 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should return false from the test method" { - Test-TargetResource @testParams | Should Be $true + Test-TargetResource @testParams | Should Be $false + } + + It "Should throw an exception in the set method" { + Set-TargetResource @testParams + Assert-MockCalled Add-SPShellAdmin + Assert-MockCalled Remove-SPShellAdmin } } Context -Name "AllDatabases parameter is used with ExcludeDatabases and permissions do not match" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" Members = "contoso\user1", "contoso\user2" AllDatabases = $true ExcludeDatabases = "SharePoint_Content_Contoso3" @@ -325,8 +349,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured Members do not match the actual members - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Members = "contoso\user1", "contoso\user2" + IsSingleInstance = "Yes" + Members = "contoso\user1", "contoso\user2" } Mock -CommandName Get-SPShellAdmin -MockWith { @@ -359,8 +383,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured Members match the actual members - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Members = "contoso\user1", "contoso\user2" + IsSingleInstance = "Yes" + Members = "contoso\user1", "contoso\user2" } Mock -CommandName Get-SPShellAdmin -MockWith { @@ -389,8 +413,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured Members do not match the actual members - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Databases = @( + IsSingleInstance = "Yes" + Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" Members = "contoso\user1", "contoso\user2" @@ -449,8 +473,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured Members match the actual members - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Databases = @( + IsSingleInstance = "Yes" + Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" Members = "contoso\user1", "contoso\user2" @@ -503,7 +527,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToInclude do not match the actual members - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" MembersToInclude = "contoso\user1", "contoso\user2" } @@ -538,7 +562,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToInclude match the actual members - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" MembersToInclude = "contoso\user1", "contoso\user2" } @@ -568,8 +592,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToInclude do not match the actual members - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Databases = @( + IsSingleInstance = "Yes" + Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" MembersToInclude = "contoso\user1", "contoso\user2" @@ -627,8 +651,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToInclude match the actual members - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Databases = @( + IsSingleInstance = "Yes" + Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" MembersToInclude = "contoso\user1", "contoso\user2" @@ -681,7 +705,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToExclude do not match the actual members - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" MembersToExclude = "contoso\user1", "contoso\user2" } @@ -716,7 +740,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToExclude match the actual members - General permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" + IsSingleInstance = "Yes" MembersToExclude = "contoso\user1", "contoso\user2" } @@ -746,8 +770,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToExclude do not match the actual members - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Databases = @( + IsSingleInstance = "Yes" + Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" MembersToExclude = "contoso\user1", "contoso\user2" @@ -805,8 +829,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "Configured MembersToExclude match the actual members - Database permissions" -Fixture { $testParams = @{ - Name = "ShellAdmins" - Databases = @( + IsSingleInstance = "Yes" + Databases = @( (New-CimInstance -ClassName MSFT_SPDatabasePermissions -Property @{ Name = "SharePoint_Content_Contoso1" MembersToExclude = "contoso\user3", "contoso\user4" diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPUserProfileProperty.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPUserProfileProperty.Tests.ps1 index 8c6eb1d09..05bfc9404 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPUserProfileProperty.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPUserProfileProperty.Tests.ps1 @@ -4,16 +4,16 @@ param( [Parameter()] [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` - -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` - -Resolve) + -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` + -Resolve) ) Import-Module -Name (Join-Path -Path $PSScriptRoot ` - -ChildPath "..\UnitTestHelper.psm1" ` - -Resolve) + -ChildPath "..\UnitTestHelper.psm1" ` + -Resolve) $Global:SPDscHelper = New-SPDscUnitTestHelper -SharePointStubModule $SharePointCmdletModule ` - -DscResource "SPUserProfileProperty" + -DscResource "SPUserProfileProperty" Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { @@ -23,327 +23,391 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # here it is. Will resolve later when I can understand what is going on here. - Brian $mockPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force $farmAccount = New-Object -TypeName "System.Management.Automation.PSCredential" ` - -ArgumentList @("username", $mockPassword) + -ArgumentList @("username", $mockPassword) InModuleScope -ModuleName $Global:SPDscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope $testParamsNewProperty = @{ - Name = "WorkEmailNew" - UserProfileService = "User Profile Service Application" - DisplayName = "WorkEmailNew" - Type = "String (Single Value)" - Description = "" - PolicySetting = "Mandatory" - PrivacySetting = "Public" - MappingConnectionName = "contoso" - MappingPropertyName = "department" - MappingDirection = "Import" - Length = 30 - DisplayOrder = 5496 - IsEventLog =$false - IsVisibleOnEditor=$true - IsVisibleOnViewer = $true - IsUserEditable = $true - IsAlias = $false - IsSearchable = $false - TermStore = "Managed Metadata service" - TermGroup = "People" - TermSet = "Department" - UserOverridePrivacy = $false + Name = "WorkEmailNew" + UserProfileService = "User Profile Service Application" + DisplayName = "WorkEmailNew" + Type = "String (Single Value)" + Description = "" + PolicySetting = "Mandatory" + PrivacySetting = "Public" + PropertyMappings = @( + (New-CimInstance -ClassName MSFT_SPUserProfilePropertyMapping -ClientOnly -Property @{ + ConnectionName = "contoso" + PropertyName = "department" + Direction = "Import" + }) + ) + Length = 30 + DisplayOrder = 5496 + IsEventLog = $false + IsVisibleOnEditor = $true + IsVisibleOnViewer = $true + IsUserEditable = $true + IsAlias = $false + IsSearchable = $false + TermStore = "Managed Metadata service" + TermGroup = "People" + TermSet = "Department" + UserOverridePrivacy = $false } $testParamsUpdateProperty = @{ - Name = "WorkEmailUpdate" - UserProfileService = "User Profile Service Application" - DisplayName = "WorkEmailUpdate" - Type = "String (Single Value)" - Description = "" - PolicySetting = "Optin" - PrivacySetting = "Private" - Ensure ="Present" - MappingConnectionName = "contoso" - MappingPropertyName = "mail" - MappingDirection = "Import" - Length = 25 - DisplayOrder = 5401 - IsEventLog =$true - IsVisibleOnEditor=$True - IsVisibleOnViewer = $true - IsUserEditable = $true - IsAlias = $true - IsSearchable = $true - TermStore = "Managed Metadata service" - TermGroup = "People" - TermSet = "Location" - UserOverridePrivacy = $false + Name = "WorkEmailUpdate" + UserProfileService = "User Profile Service Application" + DisplayName = "WorkEmailUpdate" + Type = "String (Single Value)" + Description = "" + PolicySetting = "Optin" + PrivacySetting = "Private" + Ensure = "Present" + PropertyMappings = @( + (New-CimInstance -ClassName MSFT_SPUserProfilePropertyMapping -ClientOnly -Property @{ + ConnectionName = "contoso" + PropertyName = "department" + Direction = "Import" + }) + ) + Length = 25 + DisplayOrder = 5401 + IsEventLog = $true + IsVisibleOnEditor = $True + IsVisibleOnViewer = $true + IsUserEditable = $true + IsAlias = $true + IsSearchable = $true + TermStore = "Managed Metadata service" + TermGroup = "People" + TermSet = "Location" + UserOverridePrivacy = $false } - try { [Microsoft.Office.Server.UserProfiles] } - catch { + try + { + [Microsoft.Office.Server.UserProfiles] + } + catch + { Add-Type @" namespace Microsoft.Office.Server.UserProfiles { - public enum ConnectionType { ActiveDirectory, BusinessDataCatalog }; - public enum ProfileType { User}; + public enum ConnectionType { + ActiveDirectory, + BusinessDataCatalog + }; + public enum ProfileType { + User + }; } "@ -ErrorAction SilentlyContinue } $corePropertyUpdate = @{ - DisplayName = "WorkEmailUpdate" - Name = "WorkEmailUpdate" - IsMultiValued=$false - Type = "String (Single Value)" - TermSet = @{Name= $testParamsUpdateProperty.TermSet - Group= @{Name =$testParamsUpdateProperty.TermGroup} - TermStore = @{Name =$testParamsUpdateProperty.TermStore} } - Length=25 - IsSearchable =$true - } | Add-Member ScriptMethod Commit { - $Global:SPUPSPropertyCommitCalled = $true - } -PassThru | Add-Member ScriptMethod Delete { - $Global:SPUPSPropertyDeleteCalled = $true - } -PassThru + DisplayName = "WorkEmailUpdate" + Name = "WorkEmailUpdate" + IsMultiValued = $false + Type = "String (Single Value)" + TermSet = @{ + Name = $testParamsUpdateProperty.TermSet + Group = @{ + Name = $testParamsUpdateProperty.TermGroup + } + TermStore = @{ + Name = $testParamsUpdateProperty.TermStore + } + } + Length = 25 + IsSearchable = $true + } | Add-Member ScriptMethod Commit { + $Global:SPUPSPropertyCommitCalled = $true + } -PassThru -Force | Add-Member ScriptMethod Delete { + $Global:SPUPSPropertyDeleteCalled = $true + } -PassThru -Force + $corePropertyUpdate.Type = $corePropertyUpdate.Type | Add-Member ScriptMethod GetTypeCode { - $Global:SPUPSPropertyGetTypeCodeCalled = $true - return $corePropertyUpdate.Type - } -PassThru -Force - $coreProperties = @{WorkEmailUpdate = $corePropertyUpdate} + $Global:SPUPSPropertyGetTypeCodeCalled = $true + return $corePropertyUpdate.Type + } -PassThru -Force + + $coreProperties = @{ + WorkEmailUpdate = $corePropertyUpdate + } $coreProperties = $coreProperties | Add-Member ScriptMethod Create { - $Global:SPUPCoreCreateCalled = $true - return @{ - Name=""; - DisplayName="" - Type="" - TermSet=$null - Length=10 - } - } -PassThru | Add-Member ScriptMethod RemovePropertyByName { - $Global:SPUPCoreRemovePropertyByNameCalled = $true - } -PassThru | Add-Member ScriptMethod Add { - $Global:SPUPCoreAddCalled = $true - } -PassThru -Force + $Global:SPUPCoreCreateCalled = $true + return @{ + Name = "" + DisplayName = "" + Type = "" + TermSet = $null + Length = 10 + } + } -PassThru | Add-Member ScriptMethod RemovePropertyByName { + $Global:SPUPCoreRemovePropertyByNameCalled = $true + } -PassThru | Add-Member ScriptMethod Add { + $Global:SPUPCoreAddCalled = $true + } -PassThru -Force $typePropertyUpdate = @{ - IsVisibleOnViewer=$true - IsVisibleOnEditor=$true - IsEventLog=$true - }| Add-Member ScriptMethod Commit { - $Global:SPUPPropertyCommitCalled = $true - } -PassThru - - $subTypePropertyUpdate = @{ - Name= "WorkEmailUpdate" - DisplayName="WorkEmailUpdate" - Description = "" - PrivacyPolicy = "Optin" - DefaultPrivacy = "Private" - DisplayOrder =5401 - IsUserEditable= $true - IsAlias = $true - CoreProperty = $corePropertyUpdate - TypeProperty = $typePropertyUpdate - UserOverridePrivacy=$false; - }| Add-Member ScriptMethod Commit { - $Global:SPUPPropertyCommitCalled = $true - } -PassThru + IsVisibleOnViewer = $true + IsVisibleOnEditor = $true + IsEventLog = $true + } | Add-Member ScriptMethod Commit { + $Global:SPUPPropertyCommitCalled = $true + } -PassThru + $subTypePropertyUpdate = @{ + Name = "WorkEmailUpdate" + DisplayName = "WorkEmailUpdate" + Description = "" + PrivacyPolicy = "Optin" + DefaultPrivacy = "Private" + DisplayOrder = 5401 + IsUserEditable = $true + IsAlias = $true + CoreProperty = $corePropertyUpdate + TypeProperty = $typePropertyUpdate + UserOverridePrivacy = $false + }| Add-Member ScriptMethod Commit { + $Global:SPUPPropertyCommitCalled = $true + } -PassThru $coreProperty = @{ - DisplayName = $testParamsNewProperty.DisplayName - Name = $testParamsNewProperty.Name - IsMultiValued=$testParamsNewProperty.Type -eq "String (Multi Value)" - Type = $testParamsNewProperty.Type - TermSet = @{Name= $testParamsNewProperty.TermSet - Group= @{Name =$testParamsNewProperty.TermGroup} - TermStore = @{Name =$testParamsNewProperty.TermStore} } - Length=$testParamsNewProperty.Length - IsSearchable =$testParamsNewProperty.IsSearchable - } | Add-Member ScriptMethod Commit { - $Global:SPUPSPropertyCommitCalled = $true - } -PassThru | Add-Member ScriptMethod Delete { - $Global:SPUPSPropertyDeleteCalled = $true - } -PassThru + DisplayName = $testParamsNewProperty.DisplayName + Name = $testParamsNewProperty.Name + IsMultiValued = $testParamsNewProperty.Type -eq "String (Multi Value)" + Type = $testParamsNewProperty.Type + TermSet = @{ + Name = $testParamsNewProperty.TermSet + Group = @{ + Name = $testParamsNewProperty.TermGroup + } + TermStore = @{ + Name = $testParamsNewProperty.TermStore + } + } + Length = $testParamsNewProperty.Length + IsSearchable = $testParamsNewProperty.IsSearchable + } | Add-Member ScriptMethod Commit { + $Global:SPUPSPropertyCommitCalled = $true + } -PassThru | Add-Member ScriptMethod Delete { + $Global:SPUPSPropertyDeleteCalled = $true + } -PassThru $typeProperty = @{ - IsVisibleOnViewer=$testParamsNewProperty.IsVisibleOnViewer - IsVisibleOnEditor=$testParamsNewProperty.IsVisibleOnEditor - IsEventLog=$testParamsNewProperty.IsEventLog - }| Add-Member ScriptMethod Commit { - $Global:SPUPPropertyCommitCalled = $true - } -PassThru + IsVisibleOnViewer = $testParamsNewProperty.IsVisibleOnViewer + IsVisibleOnEditor = $testParamsNewProperty.IsVisibleOnEditor + IsEventLog = $testParamsNewProperty.IsEventLog + } | Add-Member ScriptMethod Commit { + $Global:SPUPPropertyCommitCalled = $true + } -PassThru $subTypeProperty = @{ - Name= $testParamsNewProperty.Name - DisplayName= $testParamsNewProperty.DisplayName - Description = $testParamsNewProperty.Description - PrivacyPolicy = $testParamsNewProperty.PolicySetting - DefaultPrivacy = $testParamsNewProperty.PrivateSetting - DisplayOrder =$testParamsNewProperty.DisplayOrder - IsUserEditable= $testParamsNewProperty.IsUserEditable - IsAlias = $testParamsNewProperty.IsAlias - CoreProperty = $coreProperty - TypeProperty = $typeProperty - AllowPolicyOverride=$true; - }| Add-Member ScriptMethod Commit { - $Global:SPUPPropertyCommitCalled = $true - } -PassThru - $userProfileSubTypePropertiesNoProperty = @{} | Add-Member ScriptMethod Create { - $Global:SPUPSubTypeCreateCalled = $true - } -PassThru | Add-Member ScriptMethod GetPropertyByName { - $result = $null - if($Global:SPUPGetPropertyByNameCalled -eq $TRUE){ - $result = $subTypeProperty - } - $Global:SPUPGetPropertyByNameCalled = $true - return $result - } -PassThru| Add-Member ScriptMethod Add { - $Global:SPUPSubTypeAddCalled = $true - } -PassThru -Force - - $userProfileSubTypePropertiesUpdateProperty = @{"WorkEmailUpdate" = $subTypePropertyUpdate } | Add-Member ScriptMethod Create { - $Global:SPUPSubTypeCreateCalled = $true - } -PassThru | Add-Member ScriptMethod Add { - $Global:SPUPSubTypeAddCalled = $true - } -PassThru -Force | Add-Member ScriptMethod GetPropertyByName { - $Global:SPUPGetPropertyByNameCalled = $true - return $subTypePropertyUpdate - } -PassThru - #$userProfileSubTypePropertiesValidProperty.Add($subTypeProperty); + Name = $testParamsNewProperty.Name + DisplayName = $testParamsNewProperty.DisplayName + Description = $testParamsNewProperty.Description + PrivacyPolicy = $testParamsNewProperty.PolicySetting + DefaultPrivacy = $testParamsNewProperty.PrivateSetting + DisplayOrder = $testParamsNewProperty.DisplayOrder + IsUserEditable = $testParamsNewProperty.IsUserEditable + IsAlias = $testParamsNewProperty.IsAlias + CoreProperty = $coreProperty + TypeProperty = $typeProperty + AllowPolicyOverride = $true + } | Add-Member ScriptMethod Commit { + $Global:SPUPPropertyCommitCalled = $true + } -PassThru + + $userProfileSubTypePropertiesNoProperty = @{ + } | Add-Member ScriptMethod Create { + $Global:SPUPSubTypeCreateCalled = $true + } -PassThru | Add-Member ScriptMethod GetPropertyByName { + $result = $null + if ($Global:SPUPGetPropertyByNameCalled -eq $true) + { + $result = $subTypeProperty + } + $Global:SPUPGetPropertyByNameCalled = $true + return $result + } -PassThru| Add-Member ScriptMethod Add { + $Global:SPUPSubTypeAddCalled = $true + } -PassThru -Force + + $userProfileSubTypePropertiesUpdateProperty = @{ + "WorkEmailUpdate" = $subTypePropertyUpdate + } | Add-Member ScriptMethod Create { + $Global:SPUPSubTypeCreateCalled = $true + } -PassThru | Add-Member ScriptMethod Add { + $Global:SPUPSubTypeAddCalled = $true + } -PassThru -Force | Add-Member ScriptMethod GetPropertyByName { + $Global:SPUPGetPropertyByNameCalled = $true + return $subTypePropertyUpdate + } -PassThru + + Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { - $result = @{}| Add-Member ScriptMethod GetProfileSubtype { - $Global:SPUPGetProfileSubtypeCalled = $true - return @{ - Properties = $userProfileSubTypePropertiesNoProperty - } - } -PassThru - - return $result - } + $result = @{ + }| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesNoProperty + } + } -PassThru + return $result + } Mock -CommandName Get-SPWebApplication -MockWith { return @( - @{ - IsAdministrationWebApplication=$true - Url ="caURL" - }) + @{ + IsAdministrationWebApplication = $true + Url = "caURL" + } + ) } #IncludeCentralAdministration - $TermSets =@{Department = @{Name="Department" - } - Location = @{Name="Location" - } - } + $TermSets = @{ + Department = @{ + Name = "Department" + } + Location = @{ + Name = "Location" + } + } - $TermGroups = @{People = @{Name="People" - TermSets = $TermSets - }} + $TermGroups = @{ + People = @{ + Name = "People" + TermSets = $TermSets + } + } - $TermStoresList = @{"Managed Metadata service" = @{Name="Managed Metadata service" - Groups = $TermGroups - }} + $TermStoresList = @{ + "Managed Metadata service" = @{ + Name = "Managed Metadata service" + Groups = $TermGroups + } + } Mock -CommandName New-Object -MockWith { return (@{ - TermStores = $TermStoresList - }) - } -ParameterFilter { $TypeName -eq "Microsoft.SharePoint.Taxonomy.TaxonomySession" } + TermStores = $TermStoresList + }) + } -ParameterFilter { + $TypeName -eq "Microsoft.SharePoint.Taxonomy.TaxonomySession" } Mock -CommandName New-Object -MockWith { return (@{ - Properties = @{} | Add-Member ScriptMethod SetDisplayOrderByPropertyName { - $Global:UpsSetDisplayOrderByPropertyNameCalled=$true; - return $false; - } -PassThru | Add-Member ScriptMethod CommitDisplayOrder { - $Global:UpsSetDisplayOrderByPropertyNameCalled=$true; - return $false; - } -PassThru }) - } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileManager" } + Properties = @{ + + } | Add-Member ScriptMethod SetDisplayOrderByPropertyName { + $Global:UpsSetDisplayOrderByPropertyNameCalled = $true + return $false + } -PassThru | Add-Member ScriptMethod CommitDisplayOrder { + $Global:UpsSetDisplayOrderByPropertyNameCalled = $true + return $false + } -PassThru + }) + } -ParameterFilter { + $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileManager" } Mock Invoke-SPDSCCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } - $propertyMappingItem = @{ - DataSourcePropertyName="mail" - IsImport=$true - IsExport=$false - } | Add-Member ScriptMethod Delete { - $Global:UpsMappingDeleteCalled=$true; - return $true; - } -PassThru - - $propertyMapping = @{}| Add-Member ScriptMethod Item { - param( [string]$property ) - $Global:SPUPSMappingItemCalled = $true - if($property="WorkEmailUpdate"){ - return $propertyMappingItem} - } -PassThru -force | Add-Member ScriptMethod AddNewExportMapping { - $Global:UpsMappingAddNewExportCalled=$true; - return $true; - } -PassThru | Add-Member ScriptMethod AddNewMapping { - $Global:UpsMappingAddNewMappingCalled=$true; - return $true; - } -PassThru + $propertyMappingItem = @{ + DataSourcePropertyName = "mail" + IsImport = $true + IsExport = $false + } | Add-Member ScriptMethod Delete { + $Global:UpsMappingDeleteCalled = $true + return $true + } -PassThru + + $propertyMapping = @{} | Add-Member ScriptMethod Item { + param( + [string] + $property + ) + $Global:SPUPSMappingItemCalled = $true + if ($property -eq "WorkEmailUpdate") + { + return $propertyMappingItem + } + } -PassThru -Force | Add-Member ScriptMethod AddNewExportMapping { + $Global:UpsMappingAddNewExportCalled = $true + return $true + } -PassThru -Force | Add-Member ScriptMethod AddNewMapping { + $Global:UpsMappingAddNewMappingCalled = $true + return $true + } -PassThru -Force + $connection = @{ - DisplayName = "Contoso" - Server = "contoso.com" - AccountDomain = "Contoso" + DisplayName = "Contoso" + Server = "contoso.com" + AccountDomain = "Contoso" AccountUsername = "TestAccount" - Type= "ActiveDirectory" + Type = "ActiveDirectory" PropertyMapping = $propertyMapping } - $connection = $connection | Add-Member ScriptMethod Update { - $Global:SPUPSSyncConnectionUpdateCalled = $true - } -PassThru | Add-Member ScriptMethod AddPropertyMapping { - $Global:SPUPSSyncConnectionAddPropertyMappingCalled = $true - } -PassThru - - - $ConnnectionManager = @($connection) | Add-Member ScriptMethod AddActiveDirectoryConnection{ ` - param([Microsoft.Office.Server.UserProfiles.ConnectionType] $connectionType, ` - $name, ` - $forest, ` - $useSSL, ` - $userName, ` - $pwd, ` - $namingContext, ` - $p1, $p2 ` - ) - - $Global:SPUPSAddActiveDirectoryConnectionCalled =$true + $connection = $connection | Add-Member ScriptMethod Update { + $Global:SPUPSSyncConnectionUpdateCalled = $true + } -PassThru | Add-Member ScriptMethod AddPropertyMapping { + $Global:SPUPSSyncConnectionAddPropertyMappingCalled = $true } -PassThru - Mock -CommandName New-Object -MockWith { - $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { - $Global:UpsConfigManagerGetCorePropertiesCalled=$true; + $ConnnectionManager = @{ + $($connection.DisplayName) = @($connection) | Add-Member ScriptMethod AddActiveDirectoryConnection { + param( + [Microsoft.Office.Server.UserProfiles.ConnectionType] + $connectionType, + $name, + $forest, + $useSSL, + $userName, + $pwd, + $namingContext, + $p1, + $p2 + ) + $Global:SPUPSAddActiveDirectoryConnectionCalled = $true + } -PassThru + } - return ($coreProperties); + Mock -CommandName New-Object -MockWith { + $ProfilePropertyManager = @{ + "Contoso" = $connection + } | Add-Member ScriptMethod GetCoreProperties { + $Global:UpsConfigManagerGetCorePropertiesCalled = $true + return ($coreProperties) } -PassThru | Add-Member ScriptMethod GetProfileTypeProperties { - $Global:UpsConfigManagerGetProfileTypePropertiesCalled=$true; - return $userProfileSubTypePropertiesUpdateProperty; + $Global:UpsConfigManagerGetProfileTypePropertiesCalled = $true + return $userProfileSubTypePropertiesUpdateProperty } -PassThru return (@{ - ProfilePropertyManager = $ProfilePropertyManager - ConnectionManager = $ConnnectionManager - } | Add-Member ScriptMethod IsSynchronizationRunning { - $Global:UpsSyncIsSynchronizationRunning=$true; - return $false; - } -PassThru ) - } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } - - $userProfileServiceValidConnection = @{ - Name = "User Profile Service Application" - TypeName = "User Profile Service Application" - ApplicationPool = "SharePoint Service Applications" - FarmAccount = $farmAccount + ProfilePropertyManager = $ProfilePropertyManager + ConnectionManager = $ConnnectionManager + } | Add-Member ScriptMethod IsSynchronizationRunning { + $Global:UpsSyncIsSynchronizationRunning = $true + return $false + } -PassThru ) + } -ParameterFilter { + $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } + + $userProfileServiceValidConnection = @{ + Name = "User Profile Service Application" + TypeName = "User Profile Service Application" + ApplicationPool = "SharePoint Service Applications" + FarmAccount = $farmAccount ServiceApplicationProxyGroup = "Proxy Group" - ConnectionManager= @($connection) + ConnectionManager = @($connection) } Context -Name "Non-Existing User Profile Service Application" { @@ -392,22 +456,21 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When property doesn't exist, connection doesn't exist" { Mock -CommandName New-Object -MockWith { - $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { - $Global:UpsConfigManagerGetCorePropertiesCalled=$true; - - return ($coreProperties); - } -PassThru | Add-Member ScriptMethod GetProfileTypeProperties { - $Global:UpsConfigManagerGetProfileTypePropertiesCalled=$true; - return $userProfileSubTypePropertiesUpdateProperty; - } -PassThru - return (@{ - ProfilePropertyManager = $ProfilePropertyManager - ConnectionManager = $() - } | Add-Member ScriptMethod IsSynchronizationRunning { - $Global:UpsSyncIsSynchronizationRunning=$true; - return $false; - } -PassThru ) - } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } + $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { + $Global:UpsConfigManagerGetCorePropertiesCalled = $true + return ($coreProperties) + } -PassThru | Add-Member ScriptMethod GetProfileTypeProperties { + $Global:UpsConfigManagerGetProfileTypePropertiesCalled = $true + return $userProfileSubTypePropertiesUpdateProperty + } -PassThru + return (@{ + ProfilePropertyManager = $ProfilePropertyManager + ConnectionManager = @{} + } | Add-Member ScriptMethod IsSynchronizationRunning { + $Global:UpsSyncIsSynchronizationRunning = $true + return $false + } -PassThru ) + } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } It "Should return null from the Get method" { $Global:SPUPGetProfileSubtypeCalled = $false @@ -483,48 +546,48 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When ConfigurationManager is null" { Mock -CommandName New-Object -MockWith { - $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { - $Global:UpsConfigManagerGetCorePropertiesCalled=$true; - - return ($coreProperties); + $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { + $Global:UpsConfigManagerGetCorePropertiesCalled = $true + return ($coreProperties) } -PassThru | Add-Member ScriptMethod GetProfileTypeProperties { - $Global:UpsConfigManagerGetProfileTypePropertiesCalled=$true; - return $userProfileSubTypePropertiesUpdateProperty; + $Global:UpsConfigManagerGetProfileTypePropertiesCalled = $true + return $userProfileSubTypePropertiesUpdateProperty } -PassThru - return (@{ - ProfilePropertyManager = $ProfilePropertyManager - ConnectionManager = $null - } | Add-Member ScriptMethod IsSynchronizationRunning { - $Global:UpsSyncIsSynchronizationRunning=$true; - return $false; - } -PassThru ) + return ( + @{ + ProfilePropertyManager = $ProfilePropertyManager + ConnectionManager = $null + } | Add-Member ScriptMethod IsSynchronizationRunning { + $Global:UpsSyncIsSynchronizationRunning = $true + return $false + } -PassThru + ) } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } - It "Should return Ensure = Absent from the Get method"{ + It "Should return Ensure = Absent from the Get method" { (Get-TargetResource @testParamsNewProperty).Ensure | Should Be "Absent" } } Context -Name "When Sync Connection is set to Export" { Mock -CommandName New-Object -MockWith { - $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { - $Global:UpsConfigManagerGetCorePropertiesCalled=$true; - - return ($coreProperties); + $ProfilePropertyManager = @{"Contoso" = $connection} | Add-Member ScriptMethod GetCoreProperties { + $Global:UpsConfigManagerGetCorePropertiesCalled = $true + return ($coreProperties) } -PassThru | Add-Member ScriptMethod GetProfileTypeProperties { - $Global:UpsConfigManagerGetProfileTypePropertiesCalled=$true; - return $userProfileSubTypePropertiesUpdateProperty; + $Global:UpsConfigManagerGetProfileTypePropertiesCalled = $true + return $userProfileSubTypePropertiesUpdateProperty } -PassThru return (@{ - ProfilePropertyManager = $ProfilePropertyManager - ConnectionManager = $null - } | Add-Member ScriptMethod IsSynchronizationRunning { - $Global:UpsSyncIsSynchronizationRunning=$true; - return $false; - } -PassThru ) + ProfilePropertyManager = $ProfilePropertyManager + ConnectionManager = $null + } | Add-Member ScriptMethod IsSynchronizationRunning { + $Global:UpsSyncIsSynchronizationRunning = $true + return $false + } -PassThru ) } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } - It "Should return Ensure = Absent from the Get method"{ + It "Should return Ensure = Absent from the Get method" { (Get-TargetResource @testParamsNewProperty).Ensure | Should Be "Absent" } } @@ -599,14 +662,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When property exists and all properties match" { Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { - $result = @{}| Add-Member ScriptMethod GetProfileSubtype { - $Global:SPUPGetProfileSubtypeCalled = $true - return @{ - Properties = $userProfileSubTypePropertiesUpdateProperty - } - } -PassThru + $result = @{}| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesUpdateProperty + } + } -PassThru - return $result + return $result } It "Should return valid value from the Get method" { @@ -622,7 +685,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should return false when the Test method is called" { $Global:SPUPGetPropertyByNameCalled = $false - Test-TargetResource @testParamsUpdateProperty | Should Be $true + Test-TargetResource @testParamsUpdateProperty | Should Be $false $Global:SPUPGetPropertyByNameCalled | Should be $true } @@ -637,7 +700,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should throw an error if the MappingDirection is set to Export" { $testParamsExport = $testParamsUpdateProperty $connection.Type = "ActiveDirectoryImport" - $testParamsExport.MappingDirection = "Export" + $testParamsExport.PropertyMappings[0].Direction = "Export" $propertyMappingItem.IsImport = $true { Set-TargetResource @testParamsExport } | Should throw "not implemented" @@ -649,14 +712,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $currentType = $testParamsUpdateProperty.Type $testParamsUpdateProperty.Type = "String (Multi Value)" Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { - $result = @{}| Add-Member ScriptMethod GetProfileSubtype { - $Global:SPUPGetProfileSubtypeCalled = $true - return @{ - Properties = $userProfileSubTypePropertiesUpdateProperty - } - } -PassThru + $result = @{}| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesUpdateProperty + } + } -PassThru - return $result + return $result } It "Should return valid value from the Get method" { @@ -692,17 +755,17 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When property exists and mapping exists, mapping config does not match" { - $propertyMappingItem.DataSourcePropertyName = "property" + #$propertyMappingItem.DataSourcePropertyName = "property" Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { - $result = @{}| Add-Member ScriptMethod GetProfileSubtype { - $Global:SPUPGetProfileSubtypeCalled = $true - return @{ - Properties = $userProfileSubTypePropertiesUpdateProperty - } - } -PassThru + $result = @{}| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesUpdateProperty + } + } -PassThru - return $result + return $result } It "Should return valid value from the Get method" { @@ -734,17 +797,18 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $Global:SPUPSMappingItemCalled | Should be $true } } + Context -Name "When property exists and mapping does not exist" { - $propertyMappingItem=$null - Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { - $result = @{}| Add-Member ScriptMethod GetProfileSubtype { - $Global:SPUPGetProfileSubtypeCalled = $true - return @{ - Properties = $userProfileSubTypePropertiesUpdateProperty - } - } -PassThru + $propertyMappingItem = $null + Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { + $result = @{}| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesUpdateProperty + } + } -PassThru - return $result + return $result } It "Should return valid value from the Get method" { @@ -779,21 +843,23 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "When property exists and ensure equals Absent" { Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { - $result = @{}| Add-Member ScriptMethod GetProfileSubtype { - $Global:SPUPGetProfileSubtypeCalled = $true - return @{ - Properties = $userProfileSubTypePropertiesUpdateProperty - } - } -PassThru + $result = @{}| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesUpdateProperty + } + } -PassThru - return $result + return $result } - $testParamsUpdateProperty.Ensure = "Absent" + + $testParamsUpdateProperty.Ensure = "Absent" + It "deletes an user profile property in the set method" { $Global:SPUPGetProfileSubtypeCalled = $false $Global:SPUPGetPropertyByNameCalled = $false $Global:SPUPSMappingItemCalled = $false - $Global:SPUPCoreRemovePropertyByNameCalled=$false + $Global:SPUPCoreRemovePropertyByNameCalled = $false Set-TargetResource @testParamsUpdateProperty @@ -803,6 +869,116 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { $Global:SPUPCoreRemovePropertyByNameCalled | Should be $true } } + + Context -Name "When a AD Import Connection should be configured" { + + # Mocks for AD Import Connection + + Mock -CommandName Get-SPDSCUserProfileSubTypeManager -MockWith { + $result = @{}| Add-Member ScriptMethod GetProfileSubtype { + $Global:SPUPGetProfileSubtypeCalled = $true + return @{ + Properties = $userProfileSubTypePropertiesUpdateProperty + } + } -PassThru + + return $result + } + + $propertyMapping = ([PSCustomObject]@{}) | Add-Member ScriptMethod Item { + param( + [string] + $property + ) + $Global:SPUPSMappingItemCalled = $true + } -PassThru -Force | Add-Member ScriptMethod AddNewExportMapping { + $Global:UpsMappingAddNewExportCalled = $true + return $true + } -PassThru -Force | Add-Member ScriptMethod AddNewMapping { + $Global:UpsMappingAddNewMappingCalled = $true + return $true + } -PassThru -Force + + $connection = [PSCustomObject]@{ + DisplayName = "Contoso" + IsDirectorySerivce = $true + Type = "ActiveDirectoryImport" + PropertyMapping = $propertyMapping + } | Add-Member -MemberType ScriptMethod -Name GetType -Value { + return @{ + FullName = "Microsoft.Office.Server.UserProfiles.ActiveDirectoryImportConnection" + } | Add-Member -MemberType ScriptMethod -Name GetMethods -Value { + return @{ + Name = "ADImportPropertyMappings" + } | Add-Member -MemberType ScriptMethod -Name Invoke -Value { + return @( + (([PSCustomObject]"Microsoft.Office.Server.UserProfiles.ADImport.UserProfileADImportPropertyMapping") ` + | Add-Member -MemberType ScriptMethod -Name GetType -Value { + return @{ + FullName = "" + } | Add-Member -MemberType ScriptMethod -Name GetMembers -Value { + return @( + (@{ + MemberType = "Property" + Name = "ProfileProperty" + } | Add-Member -MemberType ScriptMethod -Name GetValue -Value { + return "WorkEmailUpdate" + } -PassThru -Force), + (@{ + MemberType = "Property" + Name = "ADAttribute" + } | Add-Member -MemberType ScriptMethod -Name GetValue -Value { + return "department" + } -PassThru -Force) + ) + } -PassThru -Force + } -PassThru -Force + ), + (([PSCustomObject]"Microsoft.Office.Server.UserProfiles.ADImport.UserProfileADImportPropertyMapping") ` + | Add-Member -MemberType ScriptMethod -Name GetType -Value { + return @{ + FullName = "" + } | Add-Member -MemberType ScriptMethod -Name GetMembers -Value { + return @() + } -PassThru -Force + } -PassThru -Force + ) + ) + } -PassThru -Force + } -PassThru -Force + } -PassThru -Force + + $ConnnectionManager = @{ + $($connection.DisplayName) = $connection + } + Mock -CommandName New-Object -MockWith { + $ProfilePropertyManager = @{ + "Contoso" = $connection + } | Add-Member ScriptMethod GetCoreProperties { + $Global:UpsConfigManagerGetCorePropertiesCalled = $true + return ($coreProperties) + } -PassThru | Add-Member ScriptMethod GetProfileTypeProperties { + $Global:UpsConfigManagerGetProfileTypePropertiesCalled = $true + return $userProfileSubTypePropertiesUpdateProperty + } -PassThru + return (@{ + ProfilePropertyManager = $ProfilePropertyManager + ConnectionManager = $ConnnectionManager + } | Add-Member ScriptMethod IsSynchronizationRunning { + $Global:UpsSyncIsSynchronizationRunning = $true + return $false + } -PassThru ) + } -ParameterFilter { + $TypeName -eq "Microsoft.Office.Server.UserProfiles.UserProfileConfigManager" } + + + It "Should return true when the Test method is called" { + $testParamsUpdateProperty.Ensure = "Present" + $testParamsUpdateProperty.PropertyMappings[0].Direction = "Import" + $testresults = Test-TargetResource @testParamsUpdateProperty + $testresults | Should be $true + } + } } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppBlockedFileTypes.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppBlockedFileTypes.Tests.ps1 index 95e0dc17d..88f7de2da 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppBlockedFileTypes.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppBlockedFileTypes.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,28 +20,28 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName New-SPAuthenticationProvider -MockWith { } Mock -CommandName New-SPWebApplication -MockWith { } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisableKerberos = $true - AllowAnonymous = $false - } + AllowAnonymous = $false + } } # Test contexts Context -Name "The web appliation exists and a specific blocked file type list matches" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Blocked = @("exe", "dll", "ps1") } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { [Collections.Generic.List[String]]$CurrentBlockedFiles = @("exe", "ps1", "dll") $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -51,15 +51,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl BlockedFileExtensions = $CurrentBlockedFiles } $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscWebApplicationUpdateCalled = $true - } -PassThru + } -PassThru return @($webApp) } @@ -74,15 +74,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The web appliation exists and a specific blocked file type list does not match" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Blocked = @("exe", "dll", "ps1") } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { [Collections.Generic.List[String]]$CurrentBlockedFiles = @("exe", "pdf", "dll") $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -92,15 +92,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl BlockedFileExtensions = $CurrentBlockedFiles } $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscWebApplicationUpdateCalled = $true - } -PassThru + } -PassThru return @($webApp) } @@ -121,16 +121,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The web appliation exists and a list of types to include and exclude both match" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" EnsureBlocked = @("exe") EnsureAllowed = @("pdf") } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { [Collections.Generic.List[String]]$CurrentBlockedFiles = @("exe", "ps1", "dll") $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -140,15 +140,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl BlockedFileExtensions = $CurrentBlockedFiles } $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscWebApplicationUpdateCalled = $true - } -PassThru + } -PassThru return @($webApp) } @@ -163,16 +163,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The web appliation exists and a list of types to include and exclude both failed" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" EnsureBlocked = @("exe") EnsureAllowed = @("pdf") } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { [Collections.Generic.List[String]]$CurrentBlockedFiles = @("pdf", "dll") $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -182,15 +182,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl BlockedFileExtensions = $CurrentBlockedFiles } $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscWebApplicationUpdateCalled = $true - } -PassThru + } -PassThru return @($webApp) } @@ -211,17 +211,17 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "All blocked file type parameters are passed to the methods" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Blocked = @("exe", "dll", "ps1") EnsureBlocked = @("exe", "dll") EnsureAllowed = @("ps1") } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { [Collections.Generic.List[String]]$CurrentBlockedFiles = @("pdf", "dll") $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -231,15 +231,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl BlockedFileExtensions = $CurrentBlockedFiles } $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscWebApplicationUpdateCalled = $true - } -PassThru + } -PassThru return @($webApp) } @@ -254,14 +254,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "No blocked file type parameters are passed to the methods" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { [Collections.Generic.List[String]]$CurrentBlockedFiles = @("pdf", "dll") $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -271,19 +271,19 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl BlockedFileExtensions = $CurrentBlockedFiles } $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscWebApplicationUpdateCalled = $true - } -PassThru + } -PassThru return @($webApp) } - + It "Should throw an exception on the test method" { { Test-TargetResource @testParams } | Should throw } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppClientCallableSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppClientCallableSettings.Tests.ps1 index e4702e7be..53848ff94 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppClientCallableSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppClientCallableSettings.Tests.ps1 @@ -68,7 +68,7 @@ namespace Microsoft.SharePoint.Administration { # Test contexts Context -Name "Client callable settings and a specific proxy library list matches current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -112,7 +112,7 @@ namespace Microsoft.SharePoint.Administration { It "Should return the current data from the get method" { $result = Get-TargetResource @testParams - $result.Url | Should Be "http://sites.sharepoint.com" + $result.WebAppUrl | Should Be "http://sites.sharepoint.com" $result.MaxResourcesPerRequest | Should Be 16 $result.MaxObjectPaths | Should Be 256 $result.ExecutionTimeout | Should Be 90 @@ -136,7 +136,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Client callable settings does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" MaxResourcesPerRequest = 8 MaxObjectPaths = 128 ExecutionTimeout = 45 @@ -166,7 +166,7 @@ namespace Microsoft.SharePoint.Administration { It "Should return the current data from the get method" { $result = Get-TargetResource @testParams - $result.Url | Should Be "http://sites.sharepoint.com" + $result.WebAppUrl | Should Be "http://sites.sharepoint.com" $result.MaxResourcesPerRequest | Should Be 16 $result.MaxObjectPaths | Should Be 256 $result.ExecutionTimeout | Should Be 90 @@ -200,7 +200,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "A proxy library does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -239,7 +239,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "A proxy library to include does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToInclude = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -278,7 +278,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy libraries does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -317,7 +317,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Multiple proxy libraries matches the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -368,7 +368,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy libraries to include does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToInclude = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -409,7 +409,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy library to include matches the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToInclude = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -448,7 +448,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "A proxy library to exclude does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToExclude = @("Assembly") } @@ -485,7 +485,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy library to exclude matches the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToExclude = @("Assembly") } @@ -517,7 +517,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy libraries does not match the current state of empty proxy libraries" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -541,7 +541,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Empty proxy libraries matches the current state of empty proxy libraries" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @() } @@ -558,7 +558,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Empty proxy libraries does not match the current state" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @() } @@ -588,7 +588,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy libraries to include does not match the current state of empty proxy libraries" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToInclude = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -612,7 +612,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "Proxy libraries to exclude matches the current state of empty proxy libraries" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibrariesToExclude = @("Assembly") } @@ -629,7 +629,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "ProxyLibraries and ProxyLibrariesToInclude properties are provided" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -667,7 +667,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "ProxyLibraries and ProxyLibrariesToExclude properties are provided" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -698,7 +698,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "All of the proxy libraries properties are provided" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ProxyLibraries = @( (New-CimInstance -ClassName "MSFT_SPProxyLibraryEntry" ` -ClientOnly ` @@ -737,7 +737,7 @@ namespace Microsoft.SharePoint.Administration { Context -Name "The web appliation does not exist" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" } Mock -CommandName Get-SPWebapplication -MockWith { @@ -747,7 +747,7 @@ namespace Microsoft.SharePoint.Administration { It "Should return a valid object with null on all properties" { $result = Get-TargetResource @testParams $result | Should Not BeNullOrEmpty - $result.Url | Should Be $null + $result.WebAppUrl | Should Be $null $result.ProxyLibraries | Should Be $null $result.ProxyLibrariesToInclude | Should Be $null $result.ProxyLibrariesToExclude | Should Be $null diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppGeneralSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppGeneralSettings.Tests.ps1 index 673ed269c..558cf3586 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppGeneralSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppGeneralSettings.Tests.ps1 @@ -33,7 +33,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "The web application exists and has the correct general settings" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" TimeZone = 3081 Alerts = $true AlertsLimit = 10 @@ -70,7 +70,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl DefaultTimeZone = $testParams.TimeZone AlertsEnabled = $testParams.Alerts AlertsMaximum = $testParams.AlertsLimit @@ -109,7 +109,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The web application exists and uses incorrect general settings" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" TimeZone = 3081 Alerts = $true AlertsLimit = 10 @@ -160,7 +160,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl DefaultTimeZone = 1 AlertsEnabled = $false AlertsMaximum = 1 @@ -202,7 +202,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The specified web application does not exist" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" TimeZone = 3081 Alerts = $true AlertsLimit = 10 @@ -238,7 +238,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The specified Quota Template does not exist" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" TimeZone = 3081 Alerts = $true AlertsLimit = 10 @@ -289,7 +289,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl DefaultTimeZone = 1 AlertsEnabled = $false AlertsMaximum = 1 diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSiteUseAndDeletion.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSiteUseAndDeletion.Tests.ps1 index a079c0b59..db8d0b1ae 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSiteUseAndDeletion.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSiteUseAndDeletion.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,12 +20,12 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts + # Mocks for all contexts # Test contexts Context -Name "The server is not part of SharePoint farm" -Fixture { $testParams = @{ - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true @@ -49,19 +49,19 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The Web Application isn't available" -Fixture { $testParams = @{ - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true UnusedSiteNotificationsBeforeDeletion = 30 } - Mock -CommandName Get-SPWebApplication -MockWith { + Mock -CommandName Get-SPWebApplication -MockWith { return $null } It "Should return null from the get method" { - Get-TargetResource @testParams | Should BeNullOrEmpty + Get-TargetResource @testParams | Should BeNullOrEmpty } It "Should return false from the test method" { @@ -75,7 +75,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "UnusedSiteNotificationsBeforeDeletion is out of range" -Fixture { $testParams = @{ - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true @@ -101,7 +101,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Schedule = @{ Description = "Daily" } - } + } } $testParams.UnusedSiteNotificationsBeforeDeletion = 24 @@ -114,7 +114,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Schedule = @{ Description = "Weekly" } - } + } } $testParams.UnusedSiteNotificationsBeforeDeletion = 28 @@ -127,7 +127,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Schedule = @{ Description = "Monthly" } - } + } } $testParams.UnusedSiteNotificationsBeforeDeletion = 12 @@ -137,7 +137,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The Dead Site Delete timer job does not exist" -Fixture { $testParams = @{ - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true @@ -150,7 +150,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { UnusedSiteNotificationPeriod = @{ TotalDays = 45; } AutomaticallyDeleteUnusedSiteCollections = $false UnusedSiteNotificationsBeforeDeletion = 28 - } + } return $returnVal } @@ -164,7 +164,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm and the incorrect settings have been applied" -Fixture { $testParams = @{ - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true @@ -177,7 +177,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { UnusedSiteNotificationPeriod = @{ TotalDays = 45; } AutomaticallyDeleteUnusedSiteCollections = $false UnusedSiteNotificationsBeforeDeletion = 28 - } + } $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscSiteUseUpdated = $true } -PassThru return $returnVal } @@ -188,7 +188,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Schedule = @{ Description = "Daily" } - } + } } It "Should return values from the get method" { @@ -208,7 +208,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The server is in a farm and the correct settings have been applied" -Fixture { $testParams = @{ - Url = "http://example.contoso.local" + WebAppUrl = "http://example.contoso.local" SendUnusedSiteCollectionNotifications = $true UnusedSiteNotificationPeriod = 90 AutomaticallyDeleteUnusedSiteCollections = $true @@ -221,7 +221,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { UnusedSiteNotificationPeriod = @{ TotalDays = 90; } AutomaticallyDeleteUnusedSiteCollections = $true UnusedSiteNotificationsBeforeDeletion = 30 - } + } $returnVal = $returnVal | Add-Member -MemberType ScriptMethod -Name Update -Value { $Global:SPDscSiteUseUpdated = $true } -PassThru return $returnVal } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSuiteBar.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSuiteBar.Tests.ps1 index 9855f6201..1d97e53f6 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSuiteBar.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppSuiteBar.Tests.ps1 @@ -258,7 +258,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { })} It "return error that sp2016 parameters are required" { - { Set-TargetResource @testParams } | Should Throw "You need to specify a value for either SuiteNavBrandingLogoNavigationUrl, SuiteNavBrandingLogoTitle, SuiteNavBrandingLogoUrl, SuiteNavBrandingText, and SuiteBarBrandingElementHtml with SharePoint 2016" + { Set-TargetResource @testParams } | Should Throw "You need to specify a value for either SuiteNavBrandingLogoNavigationUrl, SuiteNavBrandingLogoTitle, SuiteNavBrandingLogoUrl, SuiteNavBrandingText or SuiteBarBrandingElementHtml with SharePoint 2016 or 2019" } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppThrottlingSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppThrottlingSettings.Tests.ps1 index b98630657..9453e1ca7 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppThrottlingSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppThrottlingSettings.Tests.ps1 @@ -33,7 +33,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Test contexts Context -Name "The web appliation exists and has the correct throttling settings" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ListViewThreshold = 1000 AllowObjectModelOverride = $true AdminThreshold = 2000 @@ -66,7 +66,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl MaxItemsPerThrottledOperation = $testParams.ListViewThreshold AllowOMCodeOverrideThrottleSettings = $testParams.AllowObjectModelOverride MaxItemsPerThrottledOperationOverride = $testParams.AdminThreshold @@ -97,7 +97,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The web appliation exists and uses incorrect throttling settings" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ListViewThreshold = 1000 AllowObjectModelOverride = $true AdminThreshold = 2000 @@ -138,7 +138,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl MaxItemsPerThrottledOperation = 1 AllowOMCodeOverrideThrottleSettings = $testParams.AllowObjectModelOverride MaxItemsPerThrottledOperationOverride = $testParams.AdminThreshold @@ -179,7 +179,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ListViewThreshold = 1000 AllowObjectModelOverride = $true AdminThreshold = 2000 @@ -209,7 +209,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" ThrottlingSettings = (New-CimInstance -ClassName MSFT_SPWebApplicationThrottling -Property @{ HappyHourEnabled = $true @@ -226,7 +226,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" ThrottlingSettings = (New-CimInstance -ClassName MSFT_SPWebApplicationThrottling -Property @{ HappyHourEnabled = $true @@ -243,7 +243,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" ThrottlingSettings = (New-CimInstance -ClassName MSFT_SPWebApplicationThrottling -Property @{ HappyHourEnabled = $true diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppWorkflowSettings.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppWorkflowSettings.Tests.ps1 index 901a6df1b..72500e6fa 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppWorkflowSettings.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebAppWorkflowSettings.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,20 +20,20 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName New-SPAuthenticationProvider -MockWith { } Mock -CommandName New-SPWebApplication -MockWith { } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisableKerberos = $true - AllowAnonymous = $false - } + AllowAnonymous = $false + } } # Test contexts Context -Name "The web appliation exists and has the correct workflow settings" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ExternalWorkflowParticipantsEnabled = $true UserDefinedWorkflowsEnabled = $true EmailToNoPermissionWorkflowParticipantsEnable = $true @@ -41,7 +41,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Mock -CommandName Get-SPWebapplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -51,10 +51,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl UserDefinedWorkflowsEnabled = $true EmailToNoPermissionWorkflowParticipantsEnabled = $true ExternalWorkflowParticipantsEnabled = $true @@ -71,16 +71,16 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The web appliation exists and uses incorrect workflow settings" -Fixture { $testParams = @{ - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" ExternalWorkflowParticipantsEnabled = $true UserDefinedWorkflowsEnabled = $true EmailToNoPermissionWorkflowParticipantsEnable = $true } - Mock -CommandName Get-SPWebapplication -MockWith { + Mock -CommandName Get-SPWebapplication -MockWith { $webApp = @{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -90,15 +90,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl UserDefinedWorkflowsEnabled = $false EmailToNoPermissionWorkflowParticipantsEnabled = $false ExternalWorkflowParticipantsEnabled = $false } - $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value {} -PassThru | + $webApp = $webApp | Add-Member -MemberType ScriptMethod -Name Update -Value {} -PassThru | Add-Member -MemberType ScriptMethod -Name UpdateWorkflowConfigurationSettings -Value { $Global:SPDscWebApplicationUpdateWorkflowCalled = $true } -PassThru diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplication.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplication.Tests.ps1 index fdd78eab5..15c3b06aa 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplication.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplication.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,7 +20,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName New-SPAuthenticationProvider -MockWith { } Mock -CommandName New-SPWebApplication -MockWith { } Mock -CommandName Remove-SPWebApplication -MockWith { } @@ -32,8 +32,8 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" - Ensure = "Present" + WebAppUrl = "http://sites.sharepoint.com" + Ensure = "Present" } Mock -CommandName Get-SPWebapplication -MockWith { return $null } @@ -54,10 +54,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" - Ensure = "Present" + WebAppUrl = "http://sites.sharepoint.com" + Ensure = "Present" } - + Mock -CommandName Get-SPWebapplication -MockWith { return $null } Mock -CommandName Get-SPDSCContentService -MockWith { return @{ Name = "PlaceHolder" } @@ -76,7 +76,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } @@ -112,7 +112,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } @@ -142,18 +142,18 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" UseClassic = $true Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { + Mock -CommandName Get-SPAuthenticationProvider -MockWith { return $null } - + Mock -CommandName Get-SPWebapplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -163,10 +163,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl })} It "Should return present from the get method" { @@ -177,7 +177,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Test-TargetResource @testParams | Should Be $true } - + } Context -Name "The web application does exist and should that uses NTLM" -Fixture { @@ -185,20 +185,20 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ - DisableKerberos = $true - AllowAnonymous = $false - } + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ + DisableKerberos = $true + AllowAnonymous = $false + } } - + Mock -CommandName Get-SPWebapplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -208,10 +208,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl })} It "Should return present from the get method" { @@ -222,7 +222,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Test-TargetResource @testParams | Should Be $true } - + } Context -Name "The web application does exist and should that uses Kerberos" -Fixture { @@ -230,20 +230,20 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ - DisableKerberos = $false - AllowAnonymous = $false - } + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ + DisableKerberos = $false + AllowAnonymous = $false + } } - + Mock -CommandName Get-SPWebapplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -253,10 +253,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl })} It "Should return present from the get method" { @@ -267,27 +267,27 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Test-TargetResource @testParams | Should Be $true } } - + Context -Name "A web application exists but shouldn't" -Fixture { $testParams = @{ Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Absent" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" DisableKerberos = $true - AllowAnonymous = $false - } + AllowAnonymous = $false + } } - + Mock -CommandName Get-SPWebapplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -297,69 +297,69 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl })} - + It "Should return present from the Get method" { - (Get-TargetResource @testParams).Ensure | Should Be "Present" + (Get-TargetResource @testParams).Ensure | Should Be "Present" } - + It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false } - + It "Should remove the web application in the set method" { Set-TargetResource @testParams Assert-MockCalled Remove-SPWebApplication } } - + Context -Name "A web application doesn't exist and shouldn't" -Fixture { $testParams = @{ Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Absent" } Mock -CommandName Get-SPWebapplication -MockWith { return $null } - + It "Should return absent from the Get method" { - (Get-TargetResource @testParams).Ensure | Should Be "Absent" + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - + It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $true } } - - + + Context -Name "The web application does exist and should that uses Claims" -Fixture { $testParams = @{ Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "TestProvider" LoginProviderName = "TestProvider" ClaimProviderName = "TestClaimProvider" AuthenticationRedirectUrl = "/_trust/default.aspx?trust=TestProvider" - } + } } Mock -CommandName Get-SPWebApplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -370,10 +370,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl } )} @@ -391,23 +391,23 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Absent" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "TestProvider" LoginProviderName = "TestProvider" ClaimProviderName = "TestClaimProvider" AuthenticationRedirectUrl = "/_trust/default.aspx?trust=TestProvider" - } + } } Mock -CommandName Get-SPWebApplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -418,10 +418,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl } )} @@ -439,7 +439,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" DatabaseServer = "sql.domain.local" DatabaseName = "SP_Content_01" @@ -447,21 +447,21 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Path = "C:\inetpub\wwwroot\something" Port = 80 } - + Mock -CommandName Get-SPTrustedIdentityTokenIssuer -MockWith { return @{ Name = $testParams.AuthenticationProvider } } - - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = $testParams.AuthenticationProvider LoginProviderName = $testParams.AuthenticationProvider ClaimProviderName = "TestClaimProvider" AuthenticationRedirectUrl = "/_trust/default.aspx?trust=$($testParams.AuthenticationProvider)" - } + } } Mock -CommandName Get-SPDSCContentService -MockWith { @@ -480,14 +480,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Get-SPWebApplication -MockWith { + Mock -CommandName Get-SPWebApplication -MockWith { return $null } Mock -CommandName New-SPWebApplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -498,14 +498,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl } ) } - + It "Should return absent from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Absent" @@ -518,31 +518,31 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Set-TargetResource @testParams Assert-MockCalled New-SPWebApplication } - - + + } - + Context -Name "The web application doesn't exist and shouldn't that uses Claims" -Fixture { $testParams = @{ Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Absent" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "TestProvider" LoginProviderName = "TestProvider" ClaimProviderName = "TestClaimProvider" AuthenticationRedirectUrl = "/_trust/default.aspx?trust=TestProvider" - } + } } - Mock -CommandName Get-SPWebApplication -MockWith { + Mock -CommandName Get-SPWebApplication -MockWith { return $null } @@ -555,25 +555,25 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } } - + Context -Name "The web application doesn't exists authentication method is specified with NTLM provider" -Fixture { $testParams = @{ Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $true - AllowAnonymous = $false - } + DisableKerberos = $true + AllowAnonymous = $false + } } - Mock -CommandName Get-SPWebApplication -MockWith { + Mock -CommandName Get-SPWebApplication -MockWith { return $null } @@ -591,23 +591,23 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $false - AllowAnonymous = $false - } - + DisableKerberos = $false + AllowAnonymous = $false + } + } - + Mock -CommandName Get-SPWebApplication -MockWith { return @(@{ DisplayName = $testParams.Name - ApplicationPool = @{ + ApplicationPool = @{ Name = $testParams.ApplicationPool Username = $testParams.ApplicationPoolAccount } @@ -618,10 +618,10 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Server = "sql.domain.local" } ) - IisSettings = @( + IisSettings = @( @{ Path = "C:\inetpub\wwwroot\something" } ) - Url = $testParams.Url + Url = $testParams.WebAppUrl } )} @@ -639,7 +639,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Name = "SharePoint Sites" ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" - Url = "http://sites.sharepoint.com" + WebAppUrl = "http://sites.sharepoint.com" Ensure = "Present" DatabaseServer = "sql.domain.local" DatabaseName = "SP_Content_01" @@ -648,7 +648,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Port = 80 } - + Mock -CommandName Get-SPDSCContentService -MockWith { ApplicationPools = @( @{ @@ -662,15 +662,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } ) } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $true - AllowAnonymous = $false - } + DisableKerberos = $true + AllowAnonymous = $false + } } - - Mock -CommandName Get-SPWebapplication -MockWith { + + Mock -CommandName Get-SPWebapplication -MockWith { return $null } @@ -680,14 +680,14 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false - } - + } + It "Should return false from the set method" { Test-TargetResource @testParams | Should Be $false - } + } } - - + + } } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationAppDomain.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationAppDomain.Tests.ps1 index ae09bc7bf..bebecc5e2 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationAppDomain.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationAppDomain.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,7 +20,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName New-SPWebApplicationAppDomain -MockWith { } Mock -CommandName Remove-SPWebApplicationAppDomain -MockWith { } Mock -CommandName Start-Sleep -MockWith { } @@ -29,7 +29,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "No app domain settings have been configured for the specified web app and zone" -Fixture { $testParams = @{ AppDomain = "contosointranetapps.com" - WebApplication ="http://portal.contoso.com" + WebAppUrl ="http://portal.contoso.com" Zone = "Default" Port = 80; SSL = $false @@ -54,13 +54,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "An app domain has been configured for the specified web app and zone but it's not correct" -Fixture { $testParams = @{ AppDomain = "contosointranetapps.com" - WebApplication ="http://portal.contoso.com" + WebAppUrl ="http://portal.contoso.com" Zone = "Default" Port = 80; SSL = $false } - Mock -CommandName Get-SPWebApplicationAppDomain -MockWith { + Mock -CommandName Get-SPWebApplicationAppDomain -MockWith { return @{ AppDomain = "wrong.domain" UrlZone = $testParams.Zone @@ -87,13 +87,13 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The correct app domain has been configued for the requested web app and zone" -Fixture { $testParams = @{ AppDomain = "contosointranetapps.com" - WebApplication ="http://portal.contoso.com" + WebAppUrl ="http://portal.contoso.com" Zone = "Default" Port = 80; SSL = $false } - Mock -CommandName Get-SPWebApplicationAppDomain -MockWith { + Mock -CommandName Get-SPWebApplicationAppDomain -MockWith { return @{ AppDomain = $testParams.AppDomain UrlZone = $testParams.Zone @@ -114,11 +114,11 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { Context -Name "The functions operate without optional parameters included" -Fixture { $testParams = @{ AppDomain = "contosointranetapps.com" - WebApplication ="http://portal.contoso.com" + WebAppUrl ="http://portal.contoso.com" Zone = "Default" } - Mock -CommandName Get-SPWebApplicationAppDomain -MockWith { + Mock -CommandName Get-SPWebApplicationAppDomain -MockWith { return @{ AppDomain = "invalid.domain" UrlZone = $testParams.Zone diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationExtension.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationExtension.Tests.ps1 index 72e6eaefa..4cf5ea354 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationExtension.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWebApplicationExtension.Tests.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [Parameter()] - [string] + [string] $SharePointCmdletModule = (Join-Path -Path $PSScriptRoot ` -ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" ` -Resolve) @@ -20,28 +20,28 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { # Initialize tests - try - { - [Microsoft.SharePoint.Administration.SPUrlZone] + try + { + [Microsoft.SharePoint.Administration.SPUrlZone] } - catch + catch { Add-Type -TypeDefinition @" namespace Microsoft.SharePoint.Administration { public enum SPUrlZone { Default, Intranet, Internet, Custom, Extranet }; -} +} "@ } - # Mocks for all contexts + # Mocks for all contexts Mock -CommandName New-SPAuthenticationProvider -MockWith { } Mock -CommandName New-SPWebApplicationExtension -MockWith { } Mock -CommandName Remove-SPWebApplication -MockWith { } Mock -CommandName Get-SPTrustedIdentityTokenIssuer -MockWith { } Mock -CommandName Set-SPWebApplication -MockWith { } - - + + # Test contexts Context -Name "The parent web application does not exist" -Fixture { $testParams = @{ @@ -61,7 +61,7 @@ namespace Microsoft.SharePoint.Administration { It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false } - + It "retrieving non-existent web application fails in the set method" { { Set-TargetResource @testParams } | Should Throw "Web Application with URL $($testParams.WebAppUrl) does not exist" } @@ -77,11 +77,11 @@ namespace Microsoft.SharePoint.Administration { } Mock -CommandName Get-SPWebapplication -MockWith { - return @{ + return @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" - IISSettings = @() - } + IISSettings = @() + } } It "Should return absent from the get method" { @@ -116,14 +116,14 @@ namespace Microsoft.SharePoint.Administration { } Mock -CommandName Get-SPWebapplication -MockWith { - return @{ + return @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = @() - } + } } - + It "Should return absent from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Absent" } @@ -139,7 +139,7 @@ namespace Microsoft.SharePoint.Administration { } } - Context -Name "The web appliation extension does exist and should that uses NTLM without AllowAnonymous" -Fixture { + Context -Name "The web application extension does exist and should use NTLM without AllowAnonymous" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" Name = "Intranet Zone" @@ -149,15 +149,15 @@ namespace Microsoft.SharePoint.Administration { Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $true - } + DisableKerberos = $true + } } - + Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{} @@ -165,25 +165,25 @@ namespace Microsoft.SharePoint.Administration { HostHeader = "intranet.sharepoint.com" Port = 80 } - AllowAnonymous = $false + AllowAnonymous = $false }) return ( - @{ + @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru - ) + } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru + ) } Mock -CommandName Get-SPAlternateUrl -MockWith { return @{ - PublicURL = $testParams.Url + PublicURL = $testParams.Url } } - + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" @@ -198,7 +198,7 @@ namespace Microsoft.SharePoint.Administration { } } - Context -Name "The web appliation extension does exist and should that uses NTLM without AllowAnonymous and HTTPS" -Fixture { + Context -Name "The web application extension does exist and should use NTLM without AllowAnonymous and with HTTPS" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" Name = "Intranet Zone" @@ -209,15 +209,15 @@ namespace Microsoft.SharePoint.Administration { Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $true - } + DisableKerberos = $true + } } - + Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{ @@ -225,25 +225,25 @@ namespace Microsoft.SharePoint.Administration { Port = 443 } ServerBindings = @{} - AllowAnonymous = $false + AllowAnonymous = $false }) return ( - @{ + @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru - ) + } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru + ) } Mock -CommandName Get-SPAlternateUrl -MockWith { return @{ - PublicURL = $testParams.Url + PublicURL = $testParams.Url } } - + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" @@ -258,7 +258,7 @@ namespace Microsoft.SharePoint.Administration { } } - Context -Name "The web appliation extension does exist and should that uses NTLM and AllowAnonymous" -Fixture { + Context -Name "The web application extension does exist and should use NTLM and AllowAnonymous" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" Name = "Intranet Zone" @@ -268,16 +268,16 @@ namespace Microsoft.SharePoint.Administration { Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $true - AllowAnonymous = $true - } + DisableKerberos = $true + AllowAnonymous = $true + } } - + Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{} @@ -285,25 +285,25 @@ namespace Microsoft.SharePoint.Administration { HostHeader = "intranet.sharepoint.com" Port = 80 } - AllowAnonymous = $true + AllowAnonymous = $true }) return ( - @{ + @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru - ) + } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru + ) } Mock -CommandName Get-SPAlternateUrl -MockWith { return @{ - PublicURL = $testParams.Url + PublicURL = $testParams.Url } } - - + + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" @@ -318,7 +318,7 @@ namespace Microsoft.SharePoint.Administration { } } - Context -Name "The web appliation extension does exist and should that uses Kerberos without AllowAnonymous" -Fixture { + Context -Name "The web application extension does exist and should use Kerberos without AllowAnonymous" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" Name = "Intranet Zone" @@ -328,15 +328,15 @@ namespace Microsoft.SharePoint.Administration { Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $false - } + DisableKerberos = $false + } } - + Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{} @@ -344,25 +344,25 @@ namespace Microsoft.SharePoint.Administration { HostHeader = "intranet.sharepoint.com" Port = 80 } - AllowAnonymous = $false + AllowAnonymous = $false }) return ( - @{ + @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru - ) + } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru + ) } Mock -CommandName Get-SPAlternateUrl -MockWith { return @{ - PublicURL = $testParams.Url + PublicURL = $testParams.Url } } - + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" @@ -377,7 +377,7 @@ namespace Microsoft.SharePoint.Administration { } } - Context -Name "The web appliation extension does exist and should that uses Kerberos and AllowAnonymous" -Fixture { + Context -Name "The web application extension does exist and should use Kerberos and AllowAnonymous" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" Name = "Intranet Zone" @@ -387,16 +387,16 @@ namespace Microsoft.SharePoint.Administration { Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $false - AllowAnonymous = $true - } + DisableKerberos = $false + AllowAnonymous = $true + } } - + Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{} @@ -404,24 +404,24 @@ namespace Microsoft.SharePoint.Administration { HostHeader = "intranet.sharepoint.com" Port = 80 } - AllowAnonymous = $true + AllowAnonymous = $true }) return ( - @{ + @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru - ) + } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru + ) } Mock -CommandName Get-SPAlternateUrl -MockWith { return @{ - PublicURL = $testParams.Url + PublicURL = $testParams.Url } } - + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" @@ -436,26 +436,26 @@ namespace Microsoft.SharePoint.Administration { } } - Context -Name "The web appliation extension does exist and should with mismatched AllowAnonymous" -Fixture { + Context -Name "The web application extension does exist and should with mismatched AllowAnonymous" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" Name = "Intranet Zone" Url = "http://intranet.sharepoint.com" HostHeader = "intranet.sharepoint.com" Zone = "Intranet" - AllowAnonymous = $true + AllowAnonymous = $true Ensure = "Present" } - Mock -CommandName Get-SPAuthenticationProvider -MockWith { - return @{ + Mock -CommandName Get-SPAuthenticationProvider -MockWith { + return @{ DisplayName = "Windows Authentication" - DisableKerberos = $true - } + DisableKerberos = $true + } } - + Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{} @@ -463,25 +463,25 @@ namespace Microsoft.SharePoint.Administration { HostHeader = "intranet.sharepoint.com" Port = 80 } - AllowAnonymous = $false + AllowAnonymous = $false }) return ( - @{ + @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru - ) + } | add-member ScriptMethod Update { $Global:WebAppUpdateCalled = $true} -PassThru + ) } Mock -CommandName Get-SPAlternateUrl -MockWith { return @{ - PublicURL = $testParams.Url + PublicURL = $testParams.Url } } - + It "Should return present from the get method" { (Get-TargetResource @testParams).Ensure | Should Be "Present" } @@ -497,7 +497,7 @@ namespace Microsoft.SharePoint.Administration { It "Should update the web application extension settings in the set method" { $Global:WebAppUpdateCalled = $false Set-TargetResource @testParams - $Global:WebAppUpdateCalled | Should Be $true + $Global:WebAppUpdateCalled | Should Be $true } } @@ -511,7 +511,7 @@ namespace Microsoft.SharePoint.Administration { } Mock -CommandName Get-SPWebapplication -MockWith { - $IISSettings = @( + $IISSettings = @( @{} @{ SecureBindings = @{} @@ -521,28 +521,28 @@ namespace Microsoft.SharePoint.Administration { } }) - return @{ + return @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = $IISSettings - } + } } - + It "Should return present from the Get method" { - (Get-TargetResource @testParams).Ensure | Should Be "Present" + (Get-TargetResource @testParams).Ensure | Should Be "Present" } - + It "Should return false from the test method" { Test-TargetResource @testParams | Should Be $false } - + It "Should remove the web application in the set method" { Set-TargetResource @testParams Assert-MockCalled Remove-SPWebApplication } } - + Context -Name "A web application extension doesn't exist and shouldn't" -Fixture { $testParams = @{ WebAppUrl = "http://company.sharepoint.com" @@ -553,20 +553,20 @@ namespace Microsoft.SharePoint.Administration { } Mock -CommandName Get-SPWebapplication -MockWith { - - return @{ + + return @{ DisplayName = "Company SharePoint" URL = "http://company.sharepoint.com" IISSettings = @() - } + } } - - + + It "Should return absent from the Get method" { - (Get-TargetResource @testParams).Ensure | Should Be "Absent" + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - + It "Should return true from the test method" { Test-TargetResource @testParams | Should Be $true } diff --git a/Tests/Unit/SharePointDsc/SharePointDsc.SPWorkManagementServiceApp.Tests.ps1 b/Tests/Unit/SharePointDsc/SharePointDsc.SPWorkManagementServiceApp.Tests.ps1 index b2fd14d1e..b63f59ba2 100644 --- a/Tests/Unit/SharePointDsc/SharePointDsc.SPWorkManagementServiceApp.Tests.ps1 +++ b/Tests/Unit/SharePointDsc/SharePointDsc.SPWorkManagementServiceApp.Tests.ps1 @@ -212,7 +212,7 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { if ($Global:SPDscHelper.CurrentStubBuildNumber.Major -eq 16) { - Context -Name "Trying to use SPWorkManagementServiceApp in SP2016, not available" -Fixture { + Context -Name "Trying to use SPWorkManagementServiceApp in SP2016/SP2019, not available" -Fixture { $testParams = @{ Name = "Test Work Management App" ApplicationPool = "Test App Pool" @@ -225,15 +225,15 @@ Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { } It "Should throw an exception in the Get method" { - { Get-TargetResource @testParams } | Should throw "Work Management Service Application is no longer available in SharePoint 2016" + { Get-TargetResource @testParams } | Should throw "Work Management Service Application is no longer available in SharePoint 2016/2019" } It "Should throw an exception in the Test method" { - { Test-TargetResource @testParams } | Should throw "Work Management Service Application is no longer available in SharePoint 2016" + { Test-TargetResource @testParams } | Should throw "Work Management Service Application is no longer available in SharePoint 2016/2019" } It "Should throw an exception in the Set method" { - { Set-TargetResource @testParams } | Should throw "Work Management Service Application is no longer available in SharePoint 2016" + { Set-TargetResource @testParams } | Should throw "Work Management Service Application is no longer available in SharePoint 2016/2019" } } } diff --git a/Tests/Unit/Stubs/SharePoint/16.0.10337.12109/Microsoft.SharePoint.PowerShell.psm1 b/Tests/Unit/Stubs/SharePoint/16.0.10337.12109/Microsoft.SharePoint.PowerShell.psm1 new file mode 100644 index 000000000..ce701a8bd --- /dev/null +++ b/Tests/Unit/Stubs/SharePoint/16.0.10337.12109/Microsoft.SharePoint.PowerShell.psm1 @@ -0,0 +1,21681 @@ +function Add-DatabaseToAvailabilityGroup { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AGName}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='AllDatabases', Mandatory=$true)] + [switch] + ${ProcessAllDatabases}, + + [string] + ${FileShare}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPAppDeniedEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Endpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPClaimTypeMapping { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [ValidateNotNull()] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPDiagnosticsPerformanceCounter { + [CmdletBinding(DefaultParameterSetName='AddCounter', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AddCounter', Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(ParameterSetName='AddCounter', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ParameterSetName='AddMultipleCounters', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [string[]] + ${CounterList}, + + [Parameter(ParameterSetName='AddInstance', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [switch] + ${AllInstances}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPDistributedCacheServiceInstance { + [CmdletBinding(DefaultParameterSetName='NoArgumentsDefaultSet')] + param( + [Parameter(ParameterSetName='LocalServerRoleSet')] + [ValidateSet('DistributedCache','SingleServerFarm','WebFrontEndWithDistributedCache')] + [object] + ${Role}, + + [Parameter(ParameterSetName='CacheSizeSet')] + [ValidateRange(1, 2147483647)] + [int] + ${CacheSizeInMB}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPInfoPathUserAgent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPPluggableSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(Mandatory=$true)] + [int] + ${PlugInId}, + + [string] + ${QualifiedTypeName}, + + [System.Collections.Specialized.NameValueCollection] + ${CustomProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPProfileLeader { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPProfileSyncConnection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionForestName}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionDomain}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionUserName}, + + [Parameter(Mandatory=$true)] + [securestring] + ${ConnectionPassword}, + + [string] + ${ConnectionServerName}, + + [int] + ${ConnectionPort}, + + [bool] + ${ConnectionUseSSL}, + + [bool] + ${ConnectionUseDisabledFilter}, + + [string] + ${ConnectionNamingContext}, + + [string] + ${ConnectionSynchronizationOU}, + + [string] + ${ConnectionClaimProviderTypeValue}, + + [string] + ${ConnectionClaimProviderIdValue}, + + [string] + ${ConnectionClaimIDMapAttribute}, + + [bool] + ${ConnectionFilterOutUnlicensed}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPRoutingMachineInfo { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${Availability}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${OutgoingScheme}, + + [System.Nullable[int]] + ${OutgoingPort}, + + [ValidateNotNull()] + [System.Nullable[double]] + ${StaticWeight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPRoutingMachinePool { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${MachineTargets}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPRoutingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [object] + ${MachinePool}, + + [ValidateNotNull()] + [System.Nullable[int]] + ${ExecutionGroup}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseFailoverServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPSecureStoreSystemAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${AccountName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseFailoverServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPServiceApplicationProxyGroupMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [Alias('Proxy')] + [ValidateNotNull()] + [object] + ${Member}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPShellAdmin { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${UserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPSiteSubscriptionFeaturePackMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${FeatureDefinition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [string] + ${SynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${LiteralPath}, + + [uint32] + ${Language}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPThrottlingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [ValidateRange(0, 10)] + [ValidateNotNull()] + [System.Nullable[int]] + ${Threshold}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPUserLicenseMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$true)] + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.List`1[[object]]] + ${Mapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Add-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${LiteralPath}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Backup-SPConfigurationDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet')] + param( + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [string] + ${Directory}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Backup-SPEnterpriseSearchServiceApplicationIndex { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='RunBackup', Mandatory=$true, Position=0)] + [int] + ${Phase}, + + [Parameter(ParameterSetName='AbortBackup', Mandatory=$true, Position=0)] + [switch] + ${Abort}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='RunBackup', Mandatory=$true, Position=2)] + [string] + ${BackupFolder}, + + [Parameter(Mandatory=$true, Position=3)] + [string] + ${BackupHandleFile}, + + [Parameter(Position=4)] + [int] + ${Retries}, + + [Parameter(Position=5)] + [switch] + ${PeerToPeer}, + + [Parameter(Position=6)] + [string] + ${SpecifiedBackupHandle}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Backup-SPFarm { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [string] + ${Directory}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [ValidateSet('Full','Differential','None')] + [string] + ${BackupMethod}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${BackupThreads}, + + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${Force}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [switch] + ${ConfigurationOnly}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${Percentage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Backup-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${UseSqlSnapshot}, + + [switch] + ${NoSiteLock}, + + [switch] + ${UseABSDocStreamInfo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPAppDeniedEndpointList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPContentDatabaseSyncData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [ValidateRange(0, 2147483647)] + [int] + ${DaysSinceLastProfileSync}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPDistributedCacheItem { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPLogLevel { + [CmdletBinding()] + param( + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPMetadataWebServicePartitionData { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceProxy}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [switch] + ${FromServiceDatabase}, + + [ValidateNotNull()] + [object] + ${FromContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [object] + ${TrustedLocationType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPScaleOutDatabaseDeletedDataSubRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPScaleOutDatabaseLog { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [int] + ${LogEntryTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPSecureStoreCredentialMapping { + [CmdletBinding(DefaultParameterSetName='OneApplication', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='AllApplications', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ParameterSetName='OneApplication', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(ParameterSetName='AllApplications', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPSecureStoreDefaultProvider { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPServerScaleOutDatabaseDeletedDataSubRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPServerScaleOutDatabaseLog { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [int] + ${LogEntryTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Clear-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Connect-SPConfigurationDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(Mandatory=$true, Position=8, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [securestring] + ${Passphrase}, + + [Parameter(Position=9, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SkipRegisterAsDistributedCacheHost}, + + [string] + ${DatabaseFailOverPartner}, + + [ValidateSet('Application','ApplicationWithSearch','Custom','DistributedCache','Search','SingleServerFarm','WebFrontEnd','WebFrontEndWithDistributedCache')] + [object] + #[System.Nullable[object]] + ${LocalServerRole}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Convert-SPWebApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateSet('LEGACY','CLAIMS-WINDOWS','CLAIMS-TRUSTED-DEFAULT')] + [string] + ${From}, + + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateSet('CLAIMS','CLAIMS-WINDOWS','CLAIMS-TRUSTED-DEFAULT','CLAIMS-SHAREPOINT-ONLINE')] + [string] + ${To}, + + [switch] + ${Force}, + + [switch] + ${RetainPermissions}, + + [ValidateNotNullOrEmpty()] + [string] + ${SourceSkipList}, + + [Parameter(ParameterSetName='Claims')] + [Parameter(ParameterSetName='ClaimOnline', Mandatory=$true)] + [Parameter(ParameterSetName='ClaimOnlineToOnline', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${MapList}, + + [switch] + ${SkipSites}, + + [switch] + ${SkipPolicies}, + + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='Claims')] + [ValidateNotNull()] + [object] + ${TrustedProvider}, + + [Parameter(ParameterSetName='ClaimOnline', Mandatory=$true)] + [Parameter(ParameterSetName='Claims')] + [Parameter(ParameterSetName='ClaimOnlineToOnline', Mandatory=$true)] + [guid] + ${SiteSubsriptionId}, + + [Parameter(ParameterSetName='ClaimOnlineToOnline', Mandatory=$true)] + [guid] + ${SourceSiteSubscriptionId}, + + [ValidateNotNullOrEmpty()] + [string] + ${LoggingDirectory}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPAccessServicesDatabaseCredentials { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AppUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [string] + ${SourceServer}, + + [Parameter(Mandatory=$true)] + [string] + ${TargetServer}, + + [Parameter(Mandatory=$true)] + [System.Net.NetworkCredential] + ${ServerCredential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPActivitiesToWorkflowService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${WorkflowServiceAddress}, + + [string] + ${ActivityName}, + + [System.Net.ICredentials] + ${Credential}, + + [bool] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPBusinessDataCatalogAclToChildren { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${MetadataObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPContentTypes { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${LocalSiteUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${LocalTermStoreName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${RemoteSiteUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string[]] + ${ContentTypeNames}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${Credential}, + + [string] + ${AuthEndpoint}, + + [string] + ${GraphApiEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPSideBySideFiles { + [CmdletBinding()] + param( + [string] + ${LogFile}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPSite { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [object] + ${DestinationDatabase}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [string] + ${TargetUrl}, + + [string] + ${HostHeaderWebApplication}, + + [switch] + ${PreserveSiteId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Copy-SPTaxonomyGroups { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${LocalTermStoreName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${RemoteSiteUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${LocalSiteUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string[]] + ${GroupNames}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${Credential}, + + [string] + ${AuthEndpoint}, + + [string] + ${GraphApiEndpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-ProjectServerLicense { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPAppAutoProvision { + [CmdletBinding()] + param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPBusinessDataCatalogEntity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPFeature { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Url}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPHealthAnalysisRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Url')] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPProjectActiveDirectoryEnterpriseResourcePoolSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPProjectEmailNotification { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPProjectEnterpriseProjectTaskSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPProjectQueueStatsMonitoring { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPSessionStateService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPSingleSignOn { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPUserLicensing { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPUserSolutionAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPWebApplicationHttpThrottling { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disable-SPWebTemplateForSiteMaster { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${Template}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Disconnect-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Dismount-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Dismount-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-ProjectServerLicense { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Key}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPAppAutoProvision { + [CmdletBinding()] + param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPBusinessDataCatalogEntity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPFeature { + [CmdletBinding(DefaultParameterSetName='FarmFeatureDefinition', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteFeature')] + [string] + ${Url}, + + [switch] + ${PassThru}, + + [switch] + ${Force}, + + [Parameter(ParameterSetName='FarmFeatureDefinition')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPHealthAnalysisRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('url')] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPProjectActiveDirectoryEnterpriseResourcePoolSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.IEnumerable[guid]] + ${GroupUids}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPProjectEmailNotification { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPProjectEnterpriseProjectTaskSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPProjectQueueStatsMonitoring { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPSessionStateService { + [CmdletBinding(DefaultParameterSetName='AdvancedProvision', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='DefaultProvision', Mandatory=$true)] + [switch] + ${DefaultProvision}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='AdvancedProvision', Mandatory=$true)] + [string] + ${DatabaseName}, + + [System.Nullable[int]] + ${SessionTimeout}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPUserLicensing { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPUserSolutionAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPWebApplicationHttpThrottling { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Enable-SPWebTemplateForSiteMaster { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${Template}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPAccessServicesDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPAppPackage { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPBusinessDataCatalogModel { + [CmdletBinding()] + param( + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [string] + ${SettingId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPInfoPathAdministrationFiles { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPMetadataWebServicePartitionData { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [switch] + ${NoCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPPerformancePointContent { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string] + ${ExportFileUrl}, + + [Parameter(Mandatory=$true)] + [array] + ${ItemUrls}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPSiteSubscriptionSettings { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${AdminProperties}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPTagsAndNotesData { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${FilePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Export-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeAlerts}, + + [object] + ${IncludeVersions}, + + [int] + ${CompressionSize}, + + [switch] + ${UseSqlSnapshot}, + + [string] + ${AppLogFilePath}, + + [string] + ${ItemUrl}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${IncludeUserSecurity}, + + [switch] + ${HaltOnWarning}, + + [switch] + ${HaltOnError}, + + [switch] + ${NoLogFile}, + + [switch] + ${NoFileCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-AvailabilityGroupStatus { + [CmdletBinding()] + param( + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-ProjectServerLicense { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAccessServiceApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAccessServicesApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAccessServicesDatabase { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${ContentDb}, + + [Parameter(Position=2, ValueFromPipeline=$true)] + [bool] + ${AccessAppsOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAccessServicesDatabaseServer { + [CmdletBinding(DefaultParameterSetName='GetDatabaseServersParameterSet')] + param( + [Parameter(ParameterSetName='GetDatabaseServersParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true)] + [Parameter(ParameterSetName='GetDatabaseServersParameterSet')] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true)] + [object] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAccessServicesDatabaseServerGroup { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${DatabaseServerGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAccessServicesDatabaseServerGroupMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAlternateURL { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [object] + ${Zone}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${ResourceName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppAcquisitionConfiguration { + [CmdletBinding(DefaultParameterSetName='MarketplaceSettingsInWebApplication')] + param( + [Parameter(ParameterSetName='MarketplaceSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='MarketplaceSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppAutoProvisionConnection { + [CmdletBinding()] + param( + [object] + ${SiteSubscription}, + + [object] + ${ConnectionType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppDeniedEndpointList { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppDisablingConfiguration { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppDomain { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppHostingQuotaConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppInstance { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='IdentityParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(ParameterSetName='WebParameterSet')] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(ParameterSetName='SiteAndIdParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ParameterSetName='SiteAndIdParameterSet', Mandatory=$true)] + [guid] + ${AppInstanceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppPrincipal { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NameIdentifier}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppScaleProfile { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppSiteSubscriptionName { + [CmdletBinding()] + param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppStateSyncLastRunTime { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppStateUpdateInterval { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppStoreConfiguration { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAppStoreWebServiceConfiguration { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAuthenticationProvider { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, Position=2)] + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPAuthenticationRealm { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBackupHistory { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string] + ${Directory}, + + [switch] + ${ShowBackup}, + + [switch] + ${ShowRestore}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBingMapsBlock { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBingMapsKey { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBrowserCustomerExperienceImprovementProgram { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='Farm', Mandatory=$true)] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBusinessDataCatalogMetadataObject { + [CmdletBinding()] + param( + [string] + ${Namespace}, + + [string] + ${Name}, + + [string] + ${ContainingLobSystem}, + + [Parameter(Mandatory=$true)] + [object] + ${BdcObjectType}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPBusinessDataCatalogThrottleConfig { + [CmdletBinding(DefaultParameterSetName='ProxyProvided')] + param( + [Parameter(Mandatory=$true)] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [object] + ${ThrottleType}, + + [Parameter(ParameterSetName='ProxyProvided', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ParameterSetName='FileBackedProvided', Mandatory=$true)] + [switch] + ${FileBacked}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPCertificateAuthority { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPClaimProvider { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPClaimProviderManager { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPClaimTypeEncoding { + [CmdletBinding()] + param( + [char] + ${EncodingCharacter}, + + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPConnectedServiceApplicationInformation { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet')] + param( + [Parameter(ParameterSetName='DefaultSet', Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='AllContentDatabasesInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDatabasesOfSite', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ParameterSetName='ContentDatabasesSinceLastProfileSync', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${DaysSinceLastProfileSync}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [switch] + ${ConnectAsUnattachedDatabase}, + + [Parameter(ParameterSetName='Unattached')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='ContentDatabasesSinceLastProfileSync')] + [Parameter(ParameterSetName='DefaultSet')] + [Parameter(ParameterSetName='AllContentDatabasesInWebApplication')] + [switch] + ${NoStatusFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPContentDatabaseOrphanedData { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPContentDeploymentJob { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [object] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPContentDeploymentPath { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPCustomLayoutsPage { + [CmdletBinding()] + param( + [object] + ${Identity}, + + [ValidateRange(14, 15)] + [int] + ${CompatibilityLevel}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultParameterSet')] + param( + [Parameter(ParameterSetName='DefaultParameterSet', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServerParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServerInstance}, + + [Parameter(ParameterSetName='NameParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDataConnectionFile { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDataConnectionFileDependent { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='AllDeletedSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AllDeletedSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [string] + ${DateTimeFrom}, + + [string] + ${DateTimeTo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDesignerSettings { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDiagnosticConfig { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDiagnosticsPerformanceCounter { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ValueFromPipeline=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDiagnosticsProvider { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPDistributedCacheClientSetting { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchAdministrationComponent { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchComponent { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [string] + ${Protocol}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlExtension { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlMapping { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchCrawlRule { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchFileFormat { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchHostController { + [CmdletBinding()] + param( + [object] + ${SearchServiceInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [System.Nullable[object]] + ${Type}, + + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchLinguisticComponentsStatus { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchLinksDatabase { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchMetadataCategory { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('p')] + [System.Nullable[guid]] + ${PropSet}, + + [Alias('vt')] + [Obsolete()] + [System.Nullable[int]] + ${VariantType}, + + [Alias('c')] + [object] + ${Category}, + + [string] + ${Limit}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [string] + ${Limit}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchMetadataMapping { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [object] + ${ManagedProperty}, + + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchOwner { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [Alias('l')] + [object] + ${Level}, + + [object] + ${SPWeb}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchPropertyRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${PropertyName}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Operator}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchPropertyRuleCollection { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryAndSiteSettingsService { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryAndSiteSettingsServiceProxy { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryAuthority { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryDemoted { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryKeyword { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryScope { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('u')] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [uri] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Alias('n')] + [object] + ${Scope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQuerySpellingCorrection { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchQuerySuggestionCandidates { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchRankingModel { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchResultItemType { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchResultSource { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchService { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchServiceApplication { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchServiceApplicationBackupStore { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${BackupFolder}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${Name}, + + [Parameter(Position=3, ValueFromPipeline=$true)] + [string] + ${BackupId}, + + [Parameter(Position=4)] + [switch] + ${UseMostRecent}, + + [Parameter(Position=5)] + [switch] + ${IsVerbose}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchServiceInstance { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchSiteHitRule { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchStatus { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [switch] + ${Primary}, + + [switch] + ${Text}, + + [switch] + ${Detailed}, + + [switch] + ${Constellation}, + + [switch] + ${JobStatus}, + + [switch] + ${HealthReport}, + + [switch] + ${DetailSearchRuntime}, + + [string] + ${Component}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchTopology { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [switch] + ${Active}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPEnterpriseSearchVssDataPath { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPFarm { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPFarmConfig { + [CmdletBinding()] + param( + [switch] + ${ServiceConnectionPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPFeature { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='FarmFeatures')] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='SiteFeatures')] + [object] + ${Site}, + + [Parameter(ParameterSetName='WebFeatures')] + [object] + ${Web}, + + [Parameter(ParameterSetName='WebApplicationFeatures')] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteFeatures')] + [switch] + ${Sandboxed}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='FarmFeatureDefinitions')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPHealthAnalysisRule { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(ParameterSetName='SpecificRule', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPHelpCollection { + [CmdletBinding()] + param( + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInfoPathFormsService { + [CmdletBinding()] + param( + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInfoPathFormTemplate { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInfoPathUserAgent { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInfoPathWebServiceProxy { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInsightsConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInternalAppStateSyncLastRunTime { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPInternalAppStateUpdateInterval { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPIRMSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPLogEvent { + [CmdletBinding(DefaultParameterSetName='Directory')] + param( + [Parameter(ParameterSetName='Directory')] + [ValidateNotNullOrEmpty()] + [string] + ${Directory}, + + [Parameter(ParameterSetName='File')] + [ValidateNotNullOrEmpty()] + [string] + ${File}, + + [switch] + ${AsString}, + + [ValidateNotNullOrEmpty()] + [string[]] + ${ContextKey}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [ValidateNotNullOrEmpty()] + [string] + ${MinimumLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPLogLevel { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Service')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Service', ValueFromPipeline=$true)] + [object] + ${Service}, + + [Parameter(ParameterSetName='WebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='Server', ValueFromPipeline=$true)] + [object] + ${Server}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication')] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPMetadataServiceApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPMetadataServiceApplicationProxy { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPMicrofeedOptions { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPMobileMessagingAccount { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [Alias('ServiceType','AccountType')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPO365LinkSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPODataConnectionSetting { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [ValidateLength(0, 246)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPODataConnectionSettingMetadata { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateLength(0, 255)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPOfficeStoreAppsDefaultActivation { + [CmdletBinding(DefaultParameterSetName='AppsForOfficeSettingsInWebApplication')] + param( + [Parameter(ParameterSetName='AppsForOfficeSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPPendingUpgradeActions { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RootObject}, + + [switch] + ${Recursive}, + + [switch] + ${SkipSiteUpgradeActionInfo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPPluggableSecurityTrimmer { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProcessAccount { + [CmdletBinding(DefaultParameterSetName='NetworkService')] + param( + [Parameter(ParameterSetName='NetworkService')] + [switch] + ${NetworkService}, + + [Parameter(ParameterSetName='LocalSystem')] + [switch] + ${LocalSystem}, + + [Parameter(ParameterSetName='LocalService')] + [switch] + ${LocalService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProduct { + [CmdletBinding(DefaultParameterSetName='Local')] + param( + [Parameter(ParameterSetName='Server', ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Server}, + + [Parameter(ParameterSetName='Local')] + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProfileLeader { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProfileServiceApplicationSecurity { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [ValidateSet('UserACL','MySiteReaderACL')] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectDatabaseQuota { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectDatabaseUsage { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectEnterpriseProjectTaskSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectEventServiceSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectIsEmailNotificationEnabled { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectOdataConfiguration { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectPCSSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectPermissionMode { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectQueueSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectReportingTimephasedMode { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPProjectWebInstance { + [CmdletBinding()] + param( + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPRequestManagementSettings { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPRoutingMachineInfo { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${Availability}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPRoutingMachinePool { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPRoutingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPScaleOutDatabaseDataState { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPScaleOutDatabaseInconsistency { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPScaleOutDatabaseLogEntry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [int] + ${Count}, + + [System.Nullable[object]] + ${MajorAction}, + + [System.Nullable[guid]] + ${CorrelationId}, + + [byte[]] + ${RangeLimitPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSecureStoreApplication { + [CmdletBinding(DefaultParameterSetName='NameSet')] + param( + [Parameter(ParameterSetName='AllSet', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ParameterSetName='NameSet', Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSecureStoreSystemAccount { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSecurityTokenServiceConfig { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServer { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServerScaleOutDatabaseDataState { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServerScaleOutDatabaseInconsistency { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServerScaleOutDatabaseLogEntry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [int] + ${Count}, + + [System.Nullable[object]] + ${MajorAction}, + + [System.Nullable[guid]] + ${CorrelationId}, + + [byte[]] + ${RangeLimitPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPService { + [CmdletBinding(DefaultParameterSetName='Identity')] + param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceApplicationEndpoint { + [CmdletBinding(DefaultParameterSetName='Identity')] + param( + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Name', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Name')] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceApplicationPool { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceApplicationProxy { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceApplicationProxyGroup { + [CmdletBinding(DefaultParameterSetName='Identity')] + param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default identity', Mandatory=$true)] + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceApplicationSecurity { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Admin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceContext { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='Site', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceHostConfig { + [CmdletBinding()] + param( + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPServiceInstance { + [CmdletBinding(DefaultParameterSetName='Identity')] + param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Server', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Server}, + + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSessionStateService { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPShellAdmin { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSite { + [CmdletBinding(DefaultParameterSetName='AllSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AllSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='AllSitesInContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='AllSitesInContentDB')] + [switch] + ${NeedsB2BUpgrade}, + + [Parameter(ParameterSetName='AllSitesInWebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AllSitesInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='AllSitesInIdentity')] + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteAdministration { + [CmdletBinding(DefaultParameterSetName='AllSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AllSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='AllSitesInContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='AllSitesInWebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AllSitesInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='AllSitesInIdentity')] + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteMaster { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscription { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscriptionConfig { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscriptionEdiscoveryHub { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscriptionEdiscoverySearchScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscriptionFeaturePack { + [CmdletBinding(DefaultParameterSetName='FeaturePack')] + param( + [Parameter(ParameterSetName='FeaturePack', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteSubscription', ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscriptionIRMConfig { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteSubscriptionMetadataConfig { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteUpgradeSessionInfo { + [CmdletBinding(DefaultParameterSetName='ContentDB')] + param( + [Parameter(ParameterSetName='Site', Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ParameterSetName='ContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='ContentDB')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${HideWaiting}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowInProgress}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowCompleted}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowFailed}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPSolution { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPStateServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPStateServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPStateServiceDatabase { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='Default', Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServiceApplication', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Application')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTaxonomySession { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPThrottlingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTimerJob { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTopologyServiceApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTopologyServiceApplicationProxy { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTranslationThrottlingSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [object] + ${Farm}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTrustedIdentityTokenIssuer { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTrustedRootAuthority { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTrustedSecurityTokenIssuer { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPTrustedServiceTokenIssuer { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUpgradeActions { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUsageApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUsageDefinition { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUsageService { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUser { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [object] + ${Group}, + + [string] + ${Limit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserLicense { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserLicenseMapping { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='WebApplication', ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserLicensing { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserSettingsProvider { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserSettingsProviderManager { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserSolution { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPUserSolutionAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPVisioExternalData { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPVisioPerformance { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPVisioSafeDataProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [string] + ${DataProviderId}, + + [int] + ${DataProviderType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPVisioServiceApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPVisioServiceApplicationProxy { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Site}, + + [string] + ${Limit}, + + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWebApplication { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeCentralAdministration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWebApplicationAppDomain { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${AppDomain}, + + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWebApplicationHttpThrottlingMonitor { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWebPartPack { + [CmdletBinding()] + param( + [Parameter(Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [switch] + ${GlobalOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWebTemplate { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [uint32] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWebTemplatesEnabledForSiteMaster { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWOPIBinding { + [CmdletBinding()] + param( + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Server}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WOPIZone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWOPISuppressionSetting { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWOPIZone { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWorkflowConfig { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Get-SPWorkflowServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Grant-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Right}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Grant-SPObjectSecurity { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNull()] + [string[]] + ${Rights}, + + [switch] + ${Replace}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPAccessServicesDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [byte[]] + ${Bacpac}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPAppPackage { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [object] + ${Source}, + + [string] + ${AssetId}, + + [string] + ${ContentMarket}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPBusinessDataCatalogDotNetAssembly { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [ValidateNotNullOrEmpty()] + [string[]] + ${DependentAssemblyPaths}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${LobSystem}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPBusinessDataCatalogModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ParameterSetName='Catalog', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${Force}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPEnterpriseSearchCustomExtractionDictionary { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the UNC path to the CSV file.')] + [string] + ${FileName}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the fully qualified name of the target dictionary to be deployed.')] + [ValidateSet('Microsoft.UserDictionaries.EntityExtraction.Custom.Word.1','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.2','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.3','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.4','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.5','Microsoft.UserDictionaries.EntityExtraction.Custom.ExactWord.1','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.1','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.2','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.3','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.4','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.5','Microsoft.UserDictionaries.EntityExtraction.Custom.ExactWordPart.1')] + [string] + ${DictionaryName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPEnterpriseSearchPopularQueries { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [object] + ${ResultSource}, + + [Parameter(Mandatory=$true)] + [object] + ${Web}, + + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPEnterpriseSearchThesaurus { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the UNC path to the CSV file.')] + [string] + ${FileName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPInfoPathAdministrationFiles { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPMetadataWebServicePartitionData { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [switch] + ${ToServiceDatabase}, + + [ValidateNotNull()] + [object] + ${ToContentDatabase}, + + [switch] + ${NoCompression}, + + [ValidateSet('true','false')] + [switch] + ${OverwriteExisting}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPPerformancePointContent { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string] + ${ImportFileUrl}, + + [Parameter(Mandatory=$true)] + [string] + ${MasterPageUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteDestination}, + + [Parameter(Mandatory=$true)] + [hashtable] + ${LocationMap}, + + [Parameter(Mandatory=$true)] + [hashtable] + ${DatasourceMap}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPSiteSubscriptionSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${AdminProperties}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Import-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${IncludeUserCustomAction}, + + [switch] + ${ActivateSolutions}, + + [object] + ${UpdateVersions}, + + [switch] + ${PreserveDeletedUserMetadataReferences}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${IncludeUserSecurity}, + + [switch] + ${HaltOnWarning}, + + [switch] + ${HaltOnError}, + + [switch] + ${NoLogFile}, + + [switch] + ${NoFileCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Initialize-SPResourceSecurity { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Initialize-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPApp { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPApplicationContent { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebAccessible}, + + [switch] + ${Overwrite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPFeature { + [CmdletBinding(DefaultParameterSetName='PathSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='PathSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [Parameter(ParameterSetName='AllExistingFeatures', Mandatory=$true)] + [switch] + ${AllExistingFeatures}, + + [Parameter(ParameterSetName='ScanForFeatures', Mandatory=$true)] + [switch] + ${ScanForFeatures}, + + [switch] + ${Force}, + + [Parameter(ParameterSetName='ScanForFeatures')] + [Parameter(ParameterSetName='AllExistingFeatures')] + [string] + ${SolutionId}, + + [Parameter(ParameterSetName='PathSet')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPHelpCollection { + [CmdletBinding(DefaultParameterSetName='InstallOne')] + param( + [Parameter(ParameterSetName='InstallOne', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${LiteralPath}, + + [Parameter(ParameterSetName='InstallAll', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [switch] + ${EnableGradualUpgrade}, + + [switch] + ${NoWait}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPService { + [CmdletBinding()] + param( + [switch] + ${Provision}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPSolution { + [CmdletBinding(DefaultParameterSetName='Deploy', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='Deploy', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Synchronize', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Deploy')] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='Deploy')] + [string] + ${Time}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${CASPolicies}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${GACDeployment}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${FullTrustBinDeployment}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${Local}, + + [uint32] + ${Language}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${Force}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${AllWebApplications}, + + [Parameter(ParameterSetName='Deploy')] + [string] + ${CompatibilityLevel}, + + [Parameter(ParameterSetName='Synchronize', Mandatory=$true)] + [switch] + ${Synchronize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Install-SPWebPartPack { + [CmdletBinding(DefaultParameterSetName='UseFileName', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='UseName', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='UseFileName', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${LiteralPath}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [switch] + ${GlobalInstall}, + + [uint32] + ${Language}, + + [switch] + ${Force}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Invoke-SPProjectActiveDirectoryEnterpriseResourcePoolSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Invoke-SPProjectActiveDirectoryGroupSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Invoke-SPProjectRedactUser { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='ByClaimsAccountWithUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByResourceIdWithoutUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByResourceIdWithUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByClaimsAccountWithoutUpdateName', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ParameterSetName='ByResourceIdWithoutUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByResourceIdWithUpdateName', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [guid] + ${ResourceId}, + + [Parameter(ParameterSetName='ByClaimsAccountWithoutUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByClaimsAccountWithUpdateName', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimsAccount}, + + [Parameter(ParameterSetName='ByClaimsAccountWithUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByResourceIdWithUpdateName', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UpdateDisplayName}, + + [Parameter(ParameterSetName='ByClaimsAccountWithUpdateName', Mandatory=$true)] + [Parameter(ParameterSetName='ByResourceIdWithUpdateName', Mandatory=$true)] + [bool] + ${RedactTimesheet}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Merge-SPLogFile { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Overwrite}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [string[]] + ${Process}, + + [uint32[]] + ${ThreadID}, + + [string[]] + ${Area}, + + [string[]] + ${Category}, + + [string[]] + ${EventID}, + + [string] + ${Level}, + + [string[]] + ${Message}, + + [guid[]] + ${Correlation}, + + [string[]] + ${ContextFilter}, + + [switch] + ${ExcludeNestedCorrelation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Merge-SPUsageLog { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [string[]] + ${Servers}, + + [switch] + ${Partial}, + + [string] + ${DiagnosticLogPath}, + + [switch] + ${OverWrite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Migrate-SPDatabase { + [CmdletBinding(DefaultParameterSetName='SiteSubscription', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, Position=1)] + [object] + ${DestinationDatabase}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=2)] + [object] + ${SiteCollection}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, Position=2)] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=3)] + [object] + ${ServiceType}, + + [Parameter(Position=4)] + [switch] + ${Overwrite}, + + [Parameter(Position=5)] + [switch] + ${UseLinkedSqlServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Migrate-SPProjectResourcePlans { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Mount-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [switch] + ${SkipIntegrityChecks}, + + [Alias('NoB2BSiteUpgrade')] + [switch] + ${SkipSiteUpgrade}, + + [string] + ${DatabaseFailoverServer}, + + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseAccessCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${ClearChangeLog}, + + [switch] + ${ChangeSyncKnowledge}, + + [switch] + ${AssignNewDatabaseId}, + + [switch] + ${UseLatestSchema}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Mount-SPStateServiceDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Weight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPAppManagementData { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [object] + ${SourceAppManagementDatabase}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [object] + ${TargetContentDatabase}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ParameterSetName='Default')] + [switch] + ${OverWrite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPBlobStorageLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${SourceDatabase}, + + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDataSourceInstance}, + + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDatabase}, + + [ValidateNotNullOrEmpty()] + [string] + ${Dir}, + + [ValidateNotNullOrEmpty()] + [bool] + ${VerboseMod}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${DestinationDatabase}, + + [hashtable] + ${RbsProviderMapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPEnterpriseSearchLinksDatabases { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=1)] + [System.Nullable[guid]] + ${RepartitioningId}, + + [Parameter(Position=2)] + [object] + ${SourceStores}, + + [Parameter(Position=3)] + [object] + ${TargetStores}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPProfileManagedMetadataProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Identity}, + + [string] + ${TermSetName}, + + [switch] + ${AvailableForTagging}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${DestinationDatabase}, + + [hashtable] + ${RbsProviderMapping}, + + [bool] + ${CopyEvents}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPSocialComment { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [string] + ${OldUrl}, + + [string] + ${NewUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Move-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewAlias}, + + [switch] + ${IgnoreSID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAccessServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [string] + ${Name}, + + [switch] + ${Default}, + + [ValidateRange(1, 255)] + [int] + ${ColumnsMax}, + + [ValidateRange(1, 200000)] + [int] + ${RowsMax}, + + [ValidateRange(1, 20)] + [int] + ${SourcesMax}, + + [ValidateRange(0, 32)] + [int] + ${OutputCalculatedColumnsMax}, + + [ValidateRange(0, 8)] + [int] + ${OrderByMax}, + + [switch] + ${OuterJoinsAllowed}, + + [switch] + ${NonRemotableQueriesAllowed}, + + [ValidateRange(-1, 2147483647)] + [int] + ${RecordsInTableMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${ApplicationLogSizeMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(0, 4096)] + [int] + ${SessionMemoryMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${TemplateSizeMax}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAccessServicesApplication { + [CmdletBinding(DefaultParameterSetName='NoApplicationServerParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateNotNull()] + [pscredential] + ${DatabaseServerCredentials}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${Name}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [switch] + ${Default}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${QueryTimeout}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 1440)] + [int] + ${RecoveryPointObjective}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${Hosted}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${Encrypt}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${TrustServerCertificate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAccessServicesApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${application}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAccessServicesDatabaseServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServerGroupName}, + + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [ValidateNotNullOrEmpty()] + [pscredential] + ${DatabaseServerCredentials}, + + [ValidateNotNullOrEmpty()] + [bool] + ${AvailableForCreate}, + + [ValidateNotNullOrEmpty()] + [bool] + ${Exclusive}, + + [bool] + ${Encrypt}, + + [bool] + ${TrustServerCertificate}, + + [bool] + ${ValidateServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${SecondaryDatabaseServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${UserDomain}, + + [object] + ${LoginType}, + + [object] + ${State}, + + [object] + ${StateOwner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAlternateURL { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [object] + ${Zone}, + + [switch] + ${Internal}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${ResourceName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAppManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAppManagementServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${Name}, + + [switch] + ${UseDefaultProxyGroup}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Uri}, + + [Parameter(ParameterSetName='ServiceApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAuthenticationProvider { + [CmdletBinding(DefaultParameterSetName='Windows')] + param( + [Parameter(ParameterSetName='Windows')] + [switch] + ${AllowAnonymous}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${UseBasicAuthentication}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${DisableKerberos}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${UseWindowsIntegratedAuthentication}, + + [Parameter(ParameterSetName='Forms', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ASPNETMembershipProvider}, + + [Parameter(ParameterSetName='Forms', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ASPNETRoleProviderName}, + + [Parameter(ParameterSetName='Trusted', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPAzureAccessControlServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${MetadataServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPBECWebServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPBusinessDataCatalogServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [switch] + ${Sharing}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPBusinessDataCatalogServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [switch] + ${DefaultProxyGroup}, + + [string] + ${Name}, + + [Parameter(ParameterSetName='PipeBind', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri')] + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPCentralAdministration { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [int] + ${Port}, + + [Parameter(Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${WindowsAuthProvider}, + + [Parameter(Position=2, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SecureSocketsLayer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPClaimProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string] + ${DisplayName}, + + [Parameter(Mandatory=$true)] + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [string] + ${AssemblyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Type}, + + [switch] + ${Enabled}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPClaimsPrincipal { + [CmdletBinding(DefaultParameterSetName='IdentityType')] + param( + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='IdentityType', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='STSIdentity', Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ParameterSetName='IdentityType', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${IdentityType}, + + [Parameter(ParameterSetName='BasicClaim', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${EncodedClaim}, + + [Parameter(ParameterSetName='STSIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimValue}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='STSIdentity', Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=2)] + [ValidateNotNull()] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='STSIdentity', Position=3)] + [ValidateNotNull()] + [switch] + ${IdentifierClaim}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPClaimTypeEncoding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [char] + ${EncodingCharacter}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPClaimTypeMapping { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${IncomingClaimType}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${IncomingClaimTypeDisplayName}, + + [Parameter(Position=2)] + [ValidateNotNullOrEmpty()] + [string] + ${LocalClaimType}, + + [ValidateNotNull()] + [switch] + ${SameAsIncoming}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPConfigurationDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${AdministrationContentDatabaseName}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${FarmCredentials}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [securestring] + ${Passphrase}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SkipRegisterAsDistributedCacheHost}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseFailOverServer}, + + [ValidateSet('Application','ApplicationWithSearch','Custom','DistributedCache','Search','SingleServerFarm','WebFrontEnd','WebFrontEndWithDistributedCache')] + [object] + #[System.Nullable[object]] + ${LocalServerRole}, + + [switch] + ${ServerRoleOptional}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseAccessCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${ClearChangeLog}, + + [switch] + ${ChangeSyncKnowledge}, + + [switch] + ${AssignNewDatabaseId}, + + [switch] + ${UseLatestSchema}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [object] + ${SPContentDeploymentPath}, + + [object] + ${Scope}, + + [string] + ${Schedule}, + + [switch] + ${ScheduleEnabled}, + + [switch] + ${IncrementalEnabled}, + + [object] + ${SqlSnapshotSetting}, + + [switch] + ${HostingSupportEnabled}, + + [object] + ${EmailNotifications}, + + [string[]] + ${EmailAddresses}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceSPWebApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceSPSite}, + + [Parameter(Mandatory=$true)] + [uri] + ${DestinationCentralAdministrationURL}, + + [Parameter(Mandatory=$true)] + [uri] + ${DestinationSPWebApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DestinationSPSite}, + + [object] + ${Authentication}, + + [Parameter(Mandatory=$true)] + [pscredential] + ${PathAccount}, + + [switch] + ${DeployUserNamesEnabled}, + + [object] + ${DeploySecurityInformation}, + + [switch] + ${EventReceiversEnabled}, + + [switch] + ${CompressionEnabled}, + + [switch] + ${PathEnabled}, + + [object] + ${KeepTemporaryFilesOptions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchAdminComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchAnalyticsProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchContentProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [object] + ${Type}, + + [string] + ${Tag}, + + [Alias('s')] + [string] + ${StartAddresses}, + + [Alias('p')] + [object] + #[System.Nullable[object]] + ${CrawlPriority}, + + [System.Nullable[int]] + ${MaxPageEnumerationDepth}, + + [System.Nullable[int]] + ${MaxSiteEnumerationDepth}, + + [object] + #[System.Nullable[object]] + ${SharePointCrawlBehavior}, + + [object] + ${BDCApplicationProxyGroup}, + + [string[]] + ${LOBSystemSet}, + + [string] + ${CustomProtocol}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Protocol}, + + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [string] + ${ModelFilePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [string] + ${Target}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Path}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [object] + ${Type}, + + [System.Nullable[bool]] + ${IsAdvancedRegularExpression}, + + [System.Nullable[bool]] + ${CrawlAsHttp}, + + [System.Nullable[bool]] + ${FollowComplexUrls}, + + [System.Nullable[int]] + ${PluggableSecurityTimmerId}, + + [System.Nullable[bool]] + ${SuppressIndexing}, + + [System.Nullable[int]] + ${Priority}, + + [string] + ${ContentClass}, + + [object] + #[System.Nullable[object]] + ${AuthenticationType}, + + [string] + ${AccountName}, + + [securestring] + ${AccountPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchFileFormat { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0)] + [string] + ${FormatId}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${FormatName}, + + [Parameter(Mandatory=$true, Position=2)] + [string] + ${MimeType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchIndexComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [uint32] + ${IndexPartition}, + + [string] + ${RootDirectory}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [System.Nullable[object]] + ${Type}, + + [Parameter(Mandatory=$true)] + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('p')] + [System.Nullable[guid]] + ${PropSet}, + + [Alias('d')] + [System.Nullable[bool]] + ${DiscoverNewProperties}, + + [Alias('m')] + [System.Nullable[bool]] + ${MapToContents}, + + [Alias('auto')] + [System.Nullable[bool]] + ${AutoCreateNewManagedProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('c')] + [object] + ${Category}, + + [Parameter(Mandatory=$true)] + [Alias('ie')] + [bool] + ${IsNameEnum}, + + [Parameter(Mandatory=$true)] + [Alias('vt')] + [Obsolete()] + [int] + ${VariantType}, + + [Parameter(Mandatory=$true)] + [Alias('p')] + [guid] + ${PropSet}, + + [Alias('im')] + [System.Nullable[bool]] + ${IsMappedToContents}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [int] + ${Type}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('f')] + [System.Nullable[bool]] + ${FullTextQueriable}, + + [Alias('r')] + [System.Nullable[bool]] + ${Retrievable}, + + [Alias('q')] + [System.Nullable[bool]] + ${Queryable}, + + [Alias('e')] + [System.Nullable[bool]] + ${EnabledForScoping}, + + [Alias('nn')] + [System.Nullable[bool]] + ${NameNormalized}, + + [Alias('rp')] + [System.Nullable[bool]] + ${RespectPriority}, + + [Alias('rd')] + [System.Nullable[bool]] + ${RemoveDuplicates}, + + [Alias('im5')] + [Obsolete('This property is replaced by IncludeInAlertSignature.')] + [System.Nullable[bool]] + ${IncludeInMd5}, + + [Alias('sfa')] + [System.Nullable[bool]] + ${SafeForAnonymous}, + + [Alias('eps')] + [System.Nullable[bool]] + ${ExpandSegments}, + + [Alias('lnw')] + [System.Nullable[bool]] + ${LanguageNeutralWordBreaker}, + + [Alias('ia')] + [System.Nullable[bool]] + ${IncludeInAlertSignature}, + + [Alias('nw')] + [System.Nullable[bool]] + ${NoWordBreaker}, + + [Alias('u')] + [System.Nullable[int16]] + ${UserFlags}, + + [Alias('qir')] + [System.Nullable[bool]] + ${EnabledForQueryIndependentRank}, + + [Alias('def')] + [System.Nullable[uint32]] + ${DefaultForQueryIndependentRank}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${ManagedProperty}, + + [Parameter(Mandatory=$true)] + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('l')] + [float] + ${Level}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchQueryDemoted { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Term}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Alias('d')] + [string] + ${Definition}, + + [Alias('c')] + [string] + ${Contact}, + + [Alias('s')] + [System.Nullable[datetime]] + ${StartDate}, + + [Alias('e')] + [System.Nullable[datetime]] + ${EndDate}, + + [Alias('r')] + [System.Nullable[datetime]] + ${ReviewDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchQueryProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('d')] + [string] + ${Description}, + + [Alias('o')] + [uri] + ${OwningSiteUrl}, + + [Alias('a')] + [string] + ${AlternateResultsPage}, + + [Parameter(Mandatory=$true)] + [Alias('disp')] + [System.Nullable[bool]] + ${DisplayInAdminUI}, + + [Alias('type')] + [System.Nullable[int]] + ${CompilationType}, + + [Alias('f')] + [string] + ${ExtendedSearchFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Alias('s')] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [Alias('type')] + [string] + ${RuleType}, + + [Alias('f')] + [string] + ${FilterBehavior}, + + [Alias('ut')] + [string] + ${UrlScopeRuleType}, + + [Alias('text')] + [string] + ${MatchingString}, + + [Alias('value')] + [string] + ${PropertyValue}, + + [Alias('mname')] + [object] + ${ManagedProperty}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${RankingModelXML}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchResultItemType { + [CmdletBinding(DefaultParameterSetName='New', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(ParameterSetName='Copy', Position=1)] + [Parameter(ParameterSetName='New', Mandatory=$true, Position=1)] + [Alias('n')] + [string] + ${Name}, + + [Parameter(ParameterSetName='New', Mandatory=$true, Position=2)] + [Parameter(ParameterSetName='Copy', Position=2)] + [Alias('rule')] + [object] + ${Rules}, + + [Parameter(Position=3)] + [Alias('priority')] + [int] + ${RulePriority}, + + [Parameter(Position=4)] + [Alias('dp')] + [string] + ${DisplayProperties}, + + [Parameter(Position=5)] + [Alias('sid')] + [System.Nullable[guid]] + ${SourceID}, + + [Parameter(ParameterSetName='New', Mandatory=$true, Position=6)] + [Parameter(ParameterSetName='Copy', Position=6)] + [Alias('url')] + [string] + ${DisplayTemplateUrl}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ParameterSetName='Copy', Mandatory=$true)] + [Alias('copy')] + [object] + ${ExistingResultItemType}, + + [Parameter(ParameterSetName='Copy', Mandatory=$true)] + [Alias('eo')] + [object] + ${ExistingResultItemTypeOwner}, + + [Alias('opt')] + [System.Nullable[bool]] + ${OptimizeForFrequentUse}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [string] + ${QueryTemplate}, + + [Parameter(Mandatory=$true)] + [guid] + ${ProviderId}, + + [string] + ${RemoteUrl}, + + [System.Nullable[bool]] + ${AutoDiscover}, + + [System.Nullable[object]] + ${AuthenticationType}, + + [string] + ${UserName}, + + [string] + ${Password}, + + [string] + ${SsoId}, + + [System.Nullable[bool]] + ${MakeDefault}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [int] + ${Id}, + + [Parameter(Mandatory=$true)] + [string] + ${TypeName}, + + [string] + ${Properties}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [string] + ${RulePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='DatabasePlacement', Position=0)] + [Parameter(ParameterSetName='DefaultParameterSet', Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='DatabasePlacement')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='DatabasePlacement')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='DatabasePlacement')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [switch] + ${Partitioned}, + + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [object] + ${AdminApplicationPool}, + + [Parameter(ParameterSetName='DatabasePlacement', Mandatory=$true)] + [hashtable] + ${ParametersForDatabases}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='DatabasePlacement')] + [bool] + ${CloudIndex}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='SSA', Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [string] + ${Uri}, + + [switch] + ${Partitioned}, + + [switch] + ${MergeWithDefaultPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchSiteHitRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchService}, + + [Parameter(Mandatory=$true)] + [string] + ${HitRate}, + + [Parameter(Mandatory=$true)] + [string] + ${Behavior}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='Clone')] + [switch] + ${Clone}, + + [Parameter(ParameterSetName='Clone')] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPLogFile { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPManagedAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [pscredential] + ${Credential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${RelativeURL}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [switch] + ${Explicit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPMarketplaceWebServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPMetadataServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${AdministratorAccount}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${FullAccessAccount}, + + [string] + ${HubUri}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='NoQuota', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [string] + ${ReadAccessAccount}, + + [string] + ${RestrictedAccount}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [int] + ${CacheTimeCheckInterval}, + + [int] + ${MaxChannelCache}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true)] + [switch] + ${DisablePartitionQuota}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${GroupsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermSetsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${LabelsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${PropertiesPerPartition}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPMetadataServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [switch] + ${ContentTypePushdownEnabled}, + + [switch] + ${ContentTypeSyndicationEnabled}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${DefaultKeywordTaxonomy}, + + [switch] + ${DefaultSiteCollectionTaxonomy}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [object] + ${ServiceApplication}, + + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPODataConnectionSetting { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateLength(0, 246)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${ServiceAddressURL}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [string] + ${ExtensionProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPOnlineApplicationPrincipalManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${OnlineTenantUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateLength(0, 64)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [bool] + ${CommentsDisabled}, + + [int] + ${CommentsScorecardMax}, + + [int] + ${IndicatorImageCacheSeconds}, + + [int] + ${DataSourceQueryTimeoutSeconds}, + + [int] + ${FilterRememberUserSelectionsDays}, + + [int] + ${FilterTreeMembersMax}, + + [int] + ${FilterSearchResultsMax}, + + [int] + ${ShowDetailsInitialRows}, + + [bool] + ${ShowDetailsMaxRowsDisabled}, + + [int] + ${ShowDetailsMaxRows}, + + [bool] + ${MSMQEnabled}, + + [string] + ${MSMQName}, + + [int] + ${SessionHistoryHours}, + + [bool] + ${AnalyticQueryLoggingEnabled}, + + [bool] + ${TrustedDataSourceLocationsRestricted}, + + [bool] + ${TrustedContentLocationsRestricted}, + + [int] + ${SelectMeasureMaximum}, + + [int] + ${DecompositionTreeMaximum}, + + [bool] + ${ApplicationProxyCacheEnabled}, + + [bool] + ${ApplicationCacheEnabled}, + + [int] + ${ApplicationCacheMinimumHitCount}, + + [int] + ${AnalyticResultCacheMinimumHitCount}, + + [int] + ${ElementCacheSeconds}, + + [int] + ${AnalyticQueryCellMax}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseFailoverServer}, + + [pscredential] + ${DatabaseSQLAuthenticationCredential}, + + [bool] + ${UseEffectiveUserName}, + + [string] + ${DataSourceUnattendedServiceAccountTargetApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPPerformancePointServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateLength(0, 64)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateLength(0, 1024)] + [string] + ${Url}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(Mandatory=$true)] + [object] + ${TrustedLocationType}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPPowerPointConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 128)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPPowerPointConversionServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 128)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${AddToDefaultGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [string] + ${ProfileDBName}, + + [string] + ${ProfileDBServer}, + + [pscredential] + ${ProfileDBCredentials}, + + [string] + ${ProfileDBFailoverServer}, + + [string] + ${SocialDBName}, + + [string] + ${SocialDBServer}, + + [pscredential] + ${SocialDBCredentials}, + + [string] + ${SocialDBFailoverServer}, + + [string] + ${ProfileSyncDBName}, + + [string] + ${ProfileSyncDBServer}, + + [pscredential] + ${ProfileSyncDBCredentials}, + + [string] + ${ProfileSyncDBFailoverServer}, + + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPProfileServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [string] + ${Name}, + + [Parameter(ParameterSetName='Application', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPProjectServiceApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ApplicationPool}, + + [switch] + ${Proxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPProjectServiceApplicationProxy { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPRequestManagementRuleCriteria { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='StandardParameterSet', Mandatory=$true, Position=0)] + [Parameter(ParameterSetName='CustomPropertyParameterSet', Mandatory=$true, Position=0)] + [AllowEmptyString()] + [string] + ${Value}, + + [Parameter(ParameterSetName='CustomPropertyParameterSet', Mandatory=$true, Position=1)] + [string] + ${CustomHeader}, + + [Parameter(ParameterSetName='StandardParameterSet', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [System.Nullable[object]] + ${Property}, + + [Parameter(ParameterSetName='StandardParameterSet', Position=2)] + [Parameter(ParameterSetName='CustomPropertyParameterSet', Position=2)] + [ValidateNotNull()] + [System.Nullable[object]] + ${MatchType}, + + [Parameter(ParameterSetName='CustomPropertyParameterSet', Position=2)] + [Parameter(ParameterSetName='StandardParameterSet', Position=2)] + [System.Nullable[switch]] + ${CaseSensitive}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSecureStoreApplication { + [CmdletBinding()] + param( + [object] + ${Administrator}, + + [object] + ${CredentialsOwnerGroup}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Fields}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [object] + ${TargetApplication}, + + [object] + ${TicketRedeemer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSecureStoreApplicationField { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [switch] + ${Masked}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSecureStoreServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(Mandatory=$true)] + [switch] + ${AuditingEnabled}, + + [System.Nullable[int]] + ${AuditlogMaxSize}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${FailoverDatabaseServer}, + + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [switch] + ${Sharing}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSecureStoreServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [switch] + ${DefaultProxyGroup}, + + [string] + ${Name}, + + [Parameter(ParameterSetName='PipeBind', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSecureStoreTargetApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${ApplicationType}, + + [string] + ${ContactEmail}, + + [Parameter(Mandatory=$true)] + [string] + ${FriendlyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${SetCredentialsUri}, + + [int] + ${TimeoutInMinutes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 100)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Account}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPServiceApplicationProxyGroup { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(0, 100)] + [AllowEmptyString()] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [uint32] + ${Language}, + + [object] + ${Template}, + + [string] + ${Name}, + + [string] + ${Description}, + + [object] + ${QuotaTemplate}, + + [string] + ${OwnerEmail}, + + [Parameter(Mandatory=$true)] + [object] + ${OwnerAlias}, + + [string] + ${SecondaryEmail}, + + [object] + ${SecondaryOwnerAlias}, + + [object] + ${HostHeaderWebApplication}, + + [object] + ${ContentDatabase}, + + [object] + ${SiteSubscription}, + + [object] + ${AdministrationSiteType}, + + [int] + ${CompatibilityLevel}, + + [switch] + ${OverrideCompatibilityRestriction}, + + [switch] + ${CreateFromSiteMaster}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSiteMaster { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${Template}, + + [uint32] + ${Language}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSiteSubscription { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSiteSubscriptionFeaturePack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPStateServiceApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPStateServiceApplicationProxy { + [CmdletBinding()] + param( + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPStateServiceDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Weight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSubscriptionSettingsServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPSubscriptionSettingsServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Uri}, + + [Parameter(ParameterSetName='ServiceApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPTranslationServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${PartitionMode}, + + [switch] + ${Default}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPTranslationServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [Parameter(ParameterSetName='ConnectLocal', Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='ConnectRemote', Mandatory=$true)] + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportTrustCertificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ClaimsMappings}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SignInUrl}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${IdentifierClaim}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Realm}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [switch] + ${UseWReply}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [switch] + ${UseDefaultConfiguration}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [ValidateSet('EMAIL','USER-PRINCIPAL-NAME','ACCOUNT-NAME')] + [string] + ${IdentifierClaimIs}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${SignOutUrl}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${RegisteredIssuerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='ManualUpdateCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [ValidateNotNullOrEmpty()] + [string] + ${RegisteredIssuerName}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IsTrustBroker}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0)] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 135)] + [string] + ${DatabaseServer}, + + [ValidateLength(1, 135)] + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [ValidateLength(1, 128)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='SQLAuthentication')] + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='SQLAuthentication')] + [ValidateNotNull()] + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPUsageLogFile { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${UserAlias}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [string] + ${Email}, + + [object] + ${Group}, + + [string[]] + ${PermissionLevel}, + + [string] + ${DisplayName}, + + [switch] + ${SiteCollectionAdmin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPUserLicenseMapping { + [CmdletBinding(DefaultParameterSetName='WindowsAuth', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='WindowsAuth', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SecurityGroup}, + + [Parameter(ParameterSetName='FormsAuth', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Role}, + + [Parameter(ParameterSetName='FormsAuth', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${RoleProviderName}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${OriginalIssuer}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Value}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ParameterSetName='ClaimsValues')] + [ValidateNotNullOrEmpty()] + [string] + ${ValueType}, + + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Claim}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${License}, + + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPUserSettingsProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string] + ${DisplayName}, + + [Parameter(Mandatory=$true)] + [string] + ${AssemblyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPUserSolutionAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ListTitle}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPVisioSafeDataProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${DataProviderType}, + + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPVisioServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${AddToDefaultGroup}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPVisioServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [uint32] + ${Language}, + + [object] + ${Template}, + + [string] + ${Name}, + + [string] + ${Description}, + + [switch] + ${AddToQuickLaunch}, + + [switch] + ${UniquePermissions}, + + [switch] + ${AddToTopNav}, + + [switch] + ${UseParentTopNav}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWebApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [string] + ${ApplicationPool}, + + [object] + ${ApplicationPoolAccount}, + + [Alias('ProxyGroup')] + [object] + ${ServiceApplicationProxyGroup}, + + [switch] + ${SecureSocketsLayer}, + + [string] + ${HostHeader}, + + [uint32] + ${Port}, + + [switch] + ${AllowAnonymousAccess}, + + [string] + ${Path}, + + [string] + ${Url}, + + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [object] + ${AuthenticationProvider}, + + [object] + ${AdditionalClaimProvider}, + + [string] + ${SignInRedirectURL}, + + [object] + ${SignInRedirectProvider}, + + [object] + ${UserSettingsProvider}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWebApplicationAppDomain { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${AppDomain}, + + [object] + ${Zone}, + + [int] + ${Port}, + + [switch] + ${SecureSocketsLayer}, + + [Parameter(Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWebApplicationExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [object] + ${Zone}, + + [uint32] + ${Port}, + + [string] + ${HostHeader}, + + [string] + ${Path}, + + [string] + ${Url}, + + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [switch] + ${AllowAnonymousAccess}, + + [switch] + ${SecureSocketsLayer}, + + [object] + ${AuthenticationProvider}, + + [object] + ${AdditionalClaimProvider}, + + [string] + ${SignInRedirectURL}, + + [object] + ${SignInRedirectProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [ValidateNotNullOrEmpty()] + [string] + ${FileName}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [switch] + ${AllowHTTP}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWOPISuppressionSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWordConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredential}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${PartitionMode}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function New-SPWorkflowServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Pause-SPProjectWebInstance { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Publish-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [AllowEmptyString()] + [ValidateLength(0, 250)] + [string] + ${Description}, + + [ValidateNotNullOrEmpty()] + [uri] + ${InfoLink}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Receive-SPServiceApplicationConnectionInfo { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${FarmUrl}, + + [ValidateNotNullOrEmpty()] + [string] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Register-SPAppPrincipal { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NameIdentifier}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DisplayName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Register-SPWorkflowService { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${SPSite}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WorkflowHostUri}, + + [string] + ${ScopeName}, + + [switch] + ${PartitionMode}, + + [switch] + ${AllowOAuthHttp}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-DatabaseFromAvailabilityGroup { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AGName}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='AllDatabases', Mandatory=$true)] + [switch] + ${ProcessAllDatabases}, + + [switch] + ${Force}, + + [switch] + ${KeepSecondaryData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPAccessServicesDatabaseServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPActivityFeedItems { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [bool] + ${AllItems}, + + [int] + ${ID}, + + [string] + ${SearchText}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPAlternateURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPAppDeniedEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Endpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPApplicationCredentialKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPAppPrincipalPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${AppPrincipal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Scope}, + + [switch] + ${DisableAppOnlyPolicy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPBusinessDataCatalogModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPCentralAdministration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPClaimProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPClaimTypeMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPDeletedSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPDiagnosticsPerformanceCounter { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ValueFromPipeline=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPDistributedCacheServiceInstance { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [string] + ${UserNames}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchFileFormat { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [System.Nullable[object]] + ${Type}, + + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchQueryDemoted { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('u')] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Alias('n')] + [object] + ${Scope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchResultItemType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchServiceApplicationSiteSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${TenantId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchSiteHitRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchTenantConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Identity')] + [guid] + ${SiteSubscriptionId}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchTenantSchema { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPInfoPathUserAgent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ChangePassword')] + [switch] + ${ChangePassword}, + + [Parameter(ParameterSetName='ChangePassword', Mandatory=$true)] + [securestring] + ${NewPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPODataConnectionSetting { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPPerformancePointServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPPluggableSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(Mandatory=$true)] + [int] + ${PlugInId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPProfileLeader { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPProfileSyncConnection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionForestName}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionDomain}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionUserName}, + + [Parameter(Mandatory=$true)] + [securestring] + ${ConnectionPassword}, + + [string] + ${ConnectionServerName}, + + [string] + ${ConnectionNamingContext}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionSynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPProjectWebInstanceData { + [CmdletBinding(DefaultParameterSetName='web', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='web', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPRoutingMachineInfo { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPRoutingMachinePool { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPRoutingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [switch] + ${DeleteData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSecureStoreApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSecureStoreSystemAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [switch] + ${DeleteData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPServiceApplicationProxyGroup { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPServiceApplicationProxyGroupMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [Alias('Proxy')] + [ValidateNotNull()] + [object] + ${Member}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPShellAdmin { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${UserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [switch] + ${DeleteADAccounts}, + + [switch] + ${GradualDelete}, + + [bool] + ${CheckComplianceFlags}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteMaster { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [guid] + ${SiteId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscription { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscriptionFeaturePack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscriptionFeaturePackMember { + [CmdletBinding(DefaultParameterSetName='SingleFeatureDefinition', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SingleFeatureDefinition', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${FeatureDefinition}, + + [Parameter(ParameterSetName='AllFeatureDefinitions', Mandatory=$true)] + [switch] + ${AllFeatureDefinitions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscriptionMetadataConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteSubscriptionSettings { + [CmdletBinding(DefaultParameterSetName='SpecifySiteSubscriptions', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SpecifySiteSubscriptions', Mandatory=$true)] + [ValidateNotNull()] + [guid[]] + ${SiteSubscriptions}, + + [Parameter(ParameterSetName='FindAllOrphans', Mandatory=$true)] + [ValidateSet('True')] + [switch] + ${FindAllOrphans}, + + [Parameter(ParameterSetName='FindAllOrphans')] + [ValidateNotNull()] + [guid[]] + ${AlternativeSiteSubscriptions}, + + [Parameter(ParameterSetName='FindAllOrphans')] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteUpgradeSessionInfo { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSocialItemByDate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [bool] + ${RemoveTags}, + + [bool] + ${RemoveComments}, + + [bool] + ${RemoveRatings}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [datetime] + ${EndDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [uint32] + ${Language}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPSolutionDeploymentLock { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPThrottlingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPTranslationServiceJobHistory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeActiveJobs}, + + [System.Nullable[datetime]] + ${BeforeDate}, + + [System.Nullable[guid]] + ${JobId}, + + [System.Nullable[guid]] + ${PartitionId}, + + [switch] + ${AllPartitions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [object] + ${Group}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPUserLicenseMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [System.Collections.Generic.List[guid]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPUserSettingsProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPVisioSafeDataProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${DataProviderType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Recycle}, + + [bool] + ${CheckComplianceFlags}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPWebApplication { + [CmdletBinding(DefaultParameterSetName='RemoveWebApp', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='RemoveZoneOfWebApp', Mandatory=$true)] + [object] + ${Zone}, + + [Parameter(ParameterSetName='RemoveWebApp')] + [switch] + ${RemoveContentDatabases}, + + [switch] + ${DeleteIISSite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPWebApplicationAppDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Server}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${WOPIZone}, + + [Parameter(ParameterSetName='RemoveAll')] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPWOPISuppressionSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ParameterSetName='Identity', ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Remove-SPWordConversionServiceJobHistory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeActiveJobs}, + + [System.Nullable[datetime]] + ${BeforeDate}, + + [System.Nullable[guid]] + ${JobId}, + + [System.Nullable[guid]] + ${SubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Rename-SPServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Repair-SPManagedAccountDeployment { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Repair-SPProjectWebInstance { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='FindProjectSiteByWebInstance', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${RepairRule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Repair-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [guid] + ${RuleId}, + + [switch] + ${RunAlways}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Request-SPUpgradeEvaluationSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${NoUpgrade}, + + [switch] + ${Email}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Reset-SPAccessServicesDatabasePassword { + [CmdletBinding(DefaultParameterSetName='ResetAllApps', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='ResetSingleApp', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(ParameterSetName='ResetSingleApp', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ResetAllApps', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Reset-SPProjectEventServiceSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Reset-SPProjectPCSSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Reset-SPProjectQueueSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Reset-SPSites { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Restart-SPAppInstanceJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${AppInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Restore-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Restore-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='Config')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='Config')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='Config')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='Full', Mandatory=$true)] + [string] + ${TopologyFile}, + + [Parameter(Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [object] + ${AdminSearchServiceInstance}, + + [Parameter(ParameterSetName='Full')] + [switch] + ${KeepId}, + + [Parameter(ParameterSetName='Full')] + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Restore-SPEnterpriseSearchServiceApplicationIndex { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='RestoreProgress', Mandatory=$true, Position=1)] + [string] + ${Handle}, + + [Parameter(ParameterSetName='Restore', Mandatory=$true, Position=1)] + [string] + ${BackupFolder}, + + [Parameter(ParameterSetName='Restore', Position=2)] + [switch] + ${AllReplicas}, + + [Parameter(ParameterSetName='Restore', Position=3)] + [switch] + ${AllowMove}, + + [Parameter(Position=4)] + [int] + ${Retries}, + + [Parameter(Position=5)] + [int] + ${RetryPauseSeconds}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Restore-SPFarm { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [string] + ${Directory}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [ValidateSet('New','Overwrite')] + [string] + ${RestoreMethod}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${RestoreThreads}, + + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [guid] + ${BackupId}, + + [Parameter(ParameterSetName='DefaultSet')] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='DefaultSet', ValueFromPipeline=$true)] + [pscredential] + ${FarmCredentials}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [switch] + ${ConfigurationOnly}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${Percentage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Restore-SPSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [string] + ${Path}, + + [string] + ${HostHeaderWebApplication}, + + [switch] + ${Force}, + + [switch] + ${GradualDelete}, + + [Parameter(ParameterSetName='DatabaseFromPipebind', ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='DatabaseParameter')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='DatabaseParameter')] + [string] + ${DatabaseServer}, + + [switch] + ${PreserveSiteID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Resume-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Resume-SPProjectWebInstance { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Resume-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Revoke-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Right}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Revoke-SPObjectSecurity { + [CmdletBinding(DefaultParameterSetName='RevokeOne')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='RevokeOne', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(ParameterSetName='RevokeOne', Position=2)] + [ValidateNotNull()] + [string[]] + ${Rights}, + + [Parameter(ParameterSetName='RevokeAll', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAccessServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(1, 255)] + [int] + ${ColumnsMax}, + + [ValidateRange(1, 200000)] + [int] + ${RowsMax}, + + [ValidateRange(1, 20)] + [int] + ${SourcesMax}, + + [ValidateRange(0, 32)] + [int] + ${OutputCalculatedColumnsMax}, + + [ValidateRange(0, 8)] + [int] + ${OrderByMax}, + + [switch] + ${OuterJoinsAllowed}, + + [switch] + ${NonRemotableQueriesAllowed}, + + [ValidateRange(-1, 2147483647)] + [int] + ${RecordsInTableMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${ApplicationLogSizeMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(0, 4096)] + [int] + ${SessionMemoryMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${TemplateSizeMax}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAccessServicesApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${QueryTimeout}, + + [ValidateRange(-1, 1440)] + [int] + ${RecoveryPointObjective}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAccessServicesDatabaseServer { + [CmdletBinding(DefaultParameterSetName='SetCredentialsParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [Parameter(Mandatory=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true)] + [Parameter(Mandatory=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServer}, + + [Parameter(ParameterSetName='SetCredentialsParameterSet')] + [string] + ${DatabaseServerName}, + + [Parameter(ParameterSetName='SetCredentialsParameterSet')] + [pscredential] + ${DatabaseServerCredentials}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [bool] + ${AvailableForCreate}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet')] + [ValidateNotNullOrEmpty()] + [bool] + ${Exclusive}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [bool] + ${Encrypt}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [bool] + ${TrustServerCertificate}, + + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet')] + [string] + ${SecondaryDatabaseServerName}, + + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [bool] + ${Failover}, + + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UserDomain}, + + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [object] + ${State}, + + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [object] + ${StateOwner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAccessServicesDatabaseServerGroupMapping { + [CmdletBinding(DefaultParameterSetName='SetDatabaseServerGroupMappingParameter', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${CorporateCatalog}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [switch] + ${ObjectModel}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [switch] + ${RemoteObjectModel}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${DeveloperSite}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [switch] + ${StoreFront}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName', Mandatory=$true)] + [switch] + ${ClearMapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAlternateURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Url}, + + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppAcquisitionConfiguration { + [CmdletBinding(DefaultParameterSetName='MarketplaceSettingsInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ParameterSetName='MarketplaceSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='MarketplaceSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppAutoProvisionConnection { + [CmdletBinding()] + param( + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='WebHostEndPoint', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [object] + ${ConnectionType}, + + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${Username}, + + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${Password}, + + [Parameter(ParameterSetName='WebHostEndPoint', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${EndPoint}, + + [Parameter(ParameterSetName='Remove', Mandatory=$true)] + [switch] + ${Remove}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppDisablingConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0)] + [AllowNull()] + [AllowEmptyString()] + [string] + ${AppDomain}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppHostingQuotaConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [double] + ${AppHostingLicenseQuota}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [double] + ${AppInstanceCountQuota}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPApplicationCredentialKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [securestring] + ${Password}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppManagementDeploymentId { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${DeploymentId}, + + [Parameter(ValueFromPipeline=$true)] + [Alias('Subscription')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${AppManagementServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppPrincipalPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${AppPrincipal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Right}, + + [switch] + ${EnableAppOnlyPolicy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppScaleProfile { + [CmdletBinding()] + param( + [ValidateNotNullOrEmpty()] + [string] + ${MaxDatabaseSize}, + + [ValidateRange(1, 255)] + [int] + ${RemoteWebSiteInstanceCount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppSiteDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppSiteSubscriptionName { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [object] + ${SiteSubscription}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppStateUpdateInterval { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${AppStateSyncHours}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${FastAppRevocationHours}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppStoreConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [string] + ${Url}, + + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAppStoreWebServiceConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [string] + ${Client}, + + [version] + ${ProxyVersion}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPAuthenticationRealm { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [string] + ${Realm}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBingMapsBlock { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, HelpMessage='Block Bing Maps in all locales.')] + [switch] + ${BlockBingMapsInAllLocales}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBingMapsKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, HelpMessage='Enter the Bing Maps API key.')] + [string] + ${BingKey}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBrowserCustomerExperienceImprovementProgram { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(ParameterSetName='Farm', Mandatory=$true)] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true)] + [object] + ${SiteSubscription}, + + [switch] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(DefaultParameterSetName='NameValue', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='Display')] + [string] + ${DisplayName}, + + [Parameter(ParameterSetName='NameValue')] + [Parameter(ParameterSetName='NameRemove')] + [ValidateNotNull()] + [string] + ${PropertyName}, + + [Parameter(ParameterSetName='NameValue')] + [psobject] + ${PropertyValue}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='NameRemove')] + [switch] + ${Remove}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBusinessDataCatalogServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${Sharing}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseUsername}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPBusinessDataCatalogThrottleConfig { + [CmdletBinding(DefaultParameterSetName='MaxDefault', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='MaxDefault', Mandatory=$true)] + [int] + ${Maximum}, + + [Parameter(ParameterSetName='MaxDefault', Mandatory=$true)] + [int] + ${Default}, + + [Parameter(ParameterSetName='Enforcement', Mandatory=$true)] + [switch] + ${Enforced}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPCentralAdministration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [int] + ${Port}, + + [switch] + ${SecureSocketsLayer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPClaimProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Enabled}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPContentDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [object] + ${Status}, + + [string] + ${DatabaseFailoverServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Description}, + + [object] + ${Scope}, + + [string] + ${Schedule}, + + [switch] + ${ScheduleEnabled}, + + [switch] + ${IncrementalEnabled}, + + [object] + ${SqlSnapshotSetting}, + + [switch] + ${HostingSupportEnabled}, + + [object] + ${EmailNotifications}, + + [string[]] + ${EmailAddresses}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Description}, + + [uri] + ${DestinationCentralAdministrationURL}, + + [object] + ${Authentication}, + + [pscredential] + ${PathAccount}, + + [switch] + ${DeployUserNamesEnabled}, + + [object] + ${DeploySecurityInformation}, + + [switch] + ${EventReceiversEnabled}, + + [switch] + ${CompressionEnabled}, + + [switch] + ${PathEnabled}, + + [object] + ${KeepTemporaryFilesOptions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPCustomLayoutsPage { + [CmdletBinding(DefaultParameterSetName='CustomPage', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='CustomPage', Mandatory=$true)] + [string] + ${RelativePath}, + + [Parameter(ParameterSetName='ResetCustomPage')] + [Parameter(ParameterSetName='CustomPage')] + [ValidateRange(14, 15)] + [int] + ${CompatibilityLevel}, + + [Parameter(ParameterSetName='ResetCustomPage', Mandatory=$true)] + [switch] + ${Reset}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateLength(0, 255)] + [string] + ${DisplayName}, + + [ValidateLength(0, 255)] + [string] + ${Description}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [ValidateSet('true','false')] + [string] + ${WebAccessible}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPDefaultProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(Mandatory=$true)] + [bool] + ${MySitesPublicEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPDesignerSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [bool] + ${AllowDesigner}, + + [bool] + ${AllowRevertFromTemplate}, + + [bool] + ${AllowMasterPageEditing}, + + [bool] + ${ShowURLStructure}, + + [string] + ${RequiredDesignerVersion}, + + [string] + ${DesignerDownloadUrl}, + + [bool] + ${AllowCreateDeclarativeWorkflow}, + + [bool] + ${AllowSavePublishDeclarativeWorkflow}, + + [bool] + ${AllowSaveDeclarativeWorkflowAsTemplate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPDiagnosticConfig { + [CmdletBinding()] + param( + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${AllowLegacyTraceProviders}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${AppAnalyticsAutomaticUploadEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${CustomerExperienceImprovementProgramEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${FarmTelemetryEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${FarmTelemetryEmailAddress}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ErrorReportingEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ErrorReportingAutomaticUploadEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${DownloadErrorReportingUpdatesEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 366)] + [int] + ${DaysToKeepLogs}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${LogMaxDiskSpaceUsageEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1000)] + [int] + ${LogDiskSpaceUsageGB}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${LogLocation}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${LogCutInterval}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${EventLogFloodProtectionEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 100)] + [int] + ${EventLogFloodProtectionThreshold}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionTriggerPeriod}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionQuietPeriod}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionNotifyInterval}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ScriptErrorReportingEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ScriptErrorReportingRequireAuth}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${ScriptErrorReportingDelay}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPDiagnosticsProvider { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Enable}, + + [ValidateRange(1, 31)] + [int] + ${DaysRetained}, + + [ValidateRange(1, 9223372036854775807)] + [long] + ${MaxTotalSizeInBytes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPDistributedCacheClientSetting { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${DistributedCacheClientSettings}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchAdministrationComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${StoragePath}, + + [object] + ${SearchServiceInstance}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentEnrichmentConfiguration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(DefaultParameterSetName='NoSchedule', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('t')] + [string] + ${Tag}, + + [Alias('s')] + [string] + ${StartAddresses}, + + [Alias('p')] + [object] + #[System.Nullable[object]] + ${CrawlPriority}, + + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='Daily', Mandatory=$true)] + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='RemoveSchedule')] + [object] + #[System.Nullable`1[[object]]] + ${ScheduleType}, + + [Parameter(ParameterSetName='Daily')] + [Alias('daily')] + [switch] + ${DailyCrawlSchedule}, + + [Parameter(ParameterSetName='Weekly')] + [Alias('weekly')] + [switch] + ${WeeklyCrawlSchedule}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('monthly')] + [switch] + ${MonthlyCrawlSchedule}, + + [Parameter(ParameterSetName='RemoveSchedule')] + [switch] + ${RemoveCrawlSchedule}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('start')] + [System.Nullable[datetime]] + ${CrawlScheduleStartDateTime}, + + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('duration')] + [System.Nullable[int]] + ${CrawlScheduleRepeatDuration}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='Daily')] + [Alias('interval')] + [System.Nullable[int]] + ${CrawlScheduleRepeatInterval}, + + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='Daily')] + [Alias('every')] + [System.Nullable[int]] + ${CrawlScheduleRunEveryInterval}, + + [Parameter(ParameterSetName='Weekly')] + [object] + #[System.Nullable[object]] + ${CrawlScheduleDaysOfWeek}, + + [Parameter(ParameterSetName='MonthlyDate')] + [System.Nullable[int]] + ${CrawlScheduleDaysOfMonth}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('month')] + [object] + #[System.Nullable[object]] + ${CrawlScheduleMonthsOfYear}, + + [System.Nullable[int]] + ${MaxPageEnumerationDepth}, + + [System.Nullable[int]] + ${MaxSiteEnumerationDepth}, + + [object] + ${BDCApplicationProxyGroup}, + + [string[]] + ${LOBSystemSet}, + + [string] + ${CustomProtocol}, + + [System.Nullable[bool]] + ${EnableContinuousCrawls}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [string] + ${UserNames}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('t')] + [object] + #[System.Nullable[object]] + ${Type}, + + [System.Nullable[bool]] + ${IsAdvancedRegularExpression}, + + [System.Nullable[bool]] + ${CrawlAsHttp}, + + [System.Nullable[bool]] + ${FollowComplexUrls}, + + [System.Nullable[int]] + ${PluggableSecurityTimmerId}, + + [System.Nullable[bool]] + ${SuppressIndexing}, + + [System.Nullable[int]] + ${Priority}, + + [string] + ${ContentClass}, + + [object] + #[System.Nullable[object]] + ${AuthenticationType}, + + [string] + ${AccountName}, + + [securestring] + ${AccountPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchFileFormatState { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [bool] + ${Enable}, + + [Parameter(Position=2)] + [System.Nullable[bool]] + ${UseIFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchLinguisticComponentsStatus { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [System.Nullable[bool]] + ${ThesaurusEnabled}, + + [System.Nullable[bool]] + ${StemmingEnabled}, + + [System.Nullable[bool]] + ${QuerySpellingEnabled}, + + [System.Nullable[bool]] + ${EntityExtractionEnabled}, + + [System.Nullable[bool]] + ${AllEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [System.Nullable[bool]] + ${DiscoverNewProperties}, + + [Alias('m')] + [System.Nullable[bool]] + ${MapToContents}, + + [Alias('auto')] + [System.Nullable[bool]] + ${AutoCreateNewManagedProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [Alias('im')] + [System.Nullable[bool]] + ${IsMappedToContents}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('f')] + [System.Nullable[bool]] + ${FullTextQueriable}, + + [Alias('r')] + [System.Nullable[bool]] + ${Retrievable}, + + [Alias('e')] + [System.Nullable[bool]] + ${EnabledForScoping}, + + [Alias('nn')] + [System.Nullable[bool]] + ${NameNormalized}, + + [Alias('rp')] + [System.Nullable[bool]] + ${RespectPriority}, + + [Alias('rd')] + [System.Nullable[bool]] + ${RemoveDuplicates}, + + [Alias('im5')] + [Obsolete('This property is replaced by IncludeInAlertSignature.')] + [System.Nullable[bool]] + ${IncludeInMd5}, + + [Alias('ia')] + [System.Nullable[bool]] + ${IncludeInAlertSignature}, + + [Alias('sfa')] + [System.Nullable[bool]] + ${SafeForAnonymous}, + + [Alias('eps')] + [System.Nullable[bool]] + ${ExpandSegments}, + + [Alias('lnw')] + [System.Nullable[bool]] + ${LanguageNeutralWordBreaker}, + + [Alias('nw')] + [System.Nullable[bool]] + ${NoWordBreaker}, + + [Alias('u')] + [System.Nullable[int16]] + ${UserFlags}, + + [Alias('qir')] + [System.Nullable[bool]] + ${EnabledForQueryIndependentRank}, + + [Alias('def')] + [System.Nullable[uint32]] + ${DefaultForQueryIndependentRank}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [object] + ${ManagedProperty}, + + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchPrimaryHostController { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SearchServiceInstance}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('l')] + [System.Nullable[float]] + ${Level}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Alias('t')] + [string] + ${Term}, + + [Alias('d')] + [string] + ${Definition}, + + [Alias('c')] + [string] + ${Contact}, + + [Alias('s')] + [System.Nullable[datetime]] + ${StartDate}, + + [Alias('e')] + [System.Nullable[datetime]] + ${EndDate}, + + [Alias('r')] + [System.Nullable[datetime]] + ${ReviewDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [uri] + ${Url}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [string] + ${AlternateResultsPage}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('disp')] + [System.Nullable[bool]] + ${DisplayInAdminUI}, + + [Alias('type')] + [System.Nullable[int]] + ${CompilationType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Alias('n')] + [object] + ${Scope}, + + [Alias('f')] + [string] + ${FilterBehavior}, + + [Alias('ut')] + [string] + ${UrlScopeRuleType}, + + [Alias('text')] + [string] + ${MatchingString}, + + [Alias('value')] + [string] + ${PropertyValue}, + + [Alias('mname')] + [string] + ${ManagedPropertyName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchQuerySpellingCorrection { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [System.Nullable[bool]] + ${ContentAlignmentEnabled}, + + [System.Nullable[int]] + ${MaxDictionarySize}, + + [System.Nullable[bool]] + ${DiacriticsInSuggestionsEnabled}, + + [System.Nullable[int]] + ${TermFrequencyThreshold}, + + [System.Nullable[bool]] + ${SecurityTrimmingEnabled}, + + [System.Nullable[object]] + ${SpellingDictionary}, + + [System.Nullable[timespan]] + ${MaxProcessingTime}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(Mandatory=$true)] + [string] + ${RankingModelXML}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchResultItemType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('rule')] + [object] + ${Rules}, + + [Alias('priority')] + [System.Nullable[int]] + ${RulePriority}, + + [Alias('dp')] + [string] + ${DisplayProperties}, + + [Alias('sid')] + [System.Nullable[guid]] + ${SourceID}, + + [Alias('url')] + [string] + ${DisplayTemplateUrl}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Alias('opt')] + [System.Nullable[bool]] + ${OptimizeForFrequentUse}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('o')] + [object] + ${Owner}, + + [string] + ${Name}, + + [string] + ${Description}, + + [string] + ${QueryTemplate}, + + [guid] + ${ProviderId}, + + [string] + ${RemoteUrl}, + + [System.Nullable[bool]] + ${AutoDiscover}, + + [System.Nullable[object]] + ${AuthenticationType}, + + [string] + ${UserName}, + + [string] + ${Password}, + + [string] + ${SsoId}, + + [System.Nullable[bool]] + ${MakeDefault}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${ServiceAccount}, + + [securestring] + ${ServicePassword}, + + [string] + ${ContactEmail}, + + [string] + ${ConnectionTimeout}, + + [string] + ${AcknowledgementTimeout}, + + [string] + ${ProxyType}, + + [string] + ${IgnoreSSLWarnings}, + + [string] + ${InternetIdentity}, + + [string] + ${PerformanceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${DiacriticSensitive}, + + [object] + #[System.Nullable[object]] + ${DefaultSearchProvider}, + + [string] + ${VerboseQueryMonitoring}, + + [object] + ${ApplicationPool}, + + [object] + ${AdminApplicationPool}, + + [string] + ${DefaultContentAccessAccountName}, + + [securestring] + ${DefaultContentAccessAccountPassword}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${DefaultIndexLocation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPFarmConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowBatchSize}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowPostponeThreshold}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowEventDeliveryTimeout}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${InstalledProductsRefresh}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${DataFormWebPartAutoRefreshEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${ASPScriptOptimizationEnabled}, + + [switch] + ${ServiceConnectionPointDelete}, + + [string] + ${ServiceConnectionPointBindingInformation}, + + [System.Nullable[object]] + ${SiteMasterMode}, + + [System.Nullable[uint32]] + ${SiteMasterValidationIntervalInHours}, + + [System.Nullable[bool]] + ${DefaultActivateOnSiteMasterValue}, + + [switch] + ${Force}, + + [System.Nullable[switch]] + ${UserAccountDirectoryPathIsImmutable}, + + [System.Nullable[uint32]] + ${MaxTenantStoreValueLength}, + + [System.Nullable[uint32]] + ${MaxSiteSubscriptionSettingsValueLength}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPInfoPathFormsService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [object] + ${Identity}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormBrowserEnabling}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormBrowserRendering}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${DefaultDataConnectionTimeout}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MemoryCacheSize}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MaxDataConnectionTimeout}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MaxDataConnectionResponseSize}, + + [ValidateSet('true','false')] + [string] + ${RequireSslForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowEmbeddedSqlForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowUdcAuthenticationForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormCrossDomainDataConnections}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${MaxPostbacksPerSession}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${MaxUserActionsPerPostback}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${ActiveSessionTimeout}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxSizeOfUserFormState}, + + [ValidateSet('true','false')] + [string] + ${AllowViewState}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${ViewStateThreshold}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxFormLoadTime}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxDataConnectionRoundTrip}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPInfoPathWebServiceProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateSet('true','false')] + [string] + ${AllowWebServiceProxy}, + + [ValidateSet('true','false')] + [string] + ${AllowForUserForms}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPInternalAppStateUpdateInterval { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${AppStateSyncHours}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPIRMSettings { + [CmdletBinding(DefaultParameterSetName='UseServiceDiscovery', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [switch] + ${IrmEnabled}, + + [switch] + ${SubscriptionScopeSettingsEnabled}, + + [Parameter(ParameterSetName='UseServiceDiscovery')] + [switch] + ${UseActiveDirectoryDiscovery}, + + [Parameter(ParameterSetName='UseSpecifiedCertificateUrl', Mandatory=$true)] + [uri] + ${CertificateServerUrl}, + + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ServiceAuthenticationCertificate}, + + [ValidateNotNull()] + [securestring] + ${CertificatePassword}, + + [switch] + ${UseOauth}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPLogLevel { + [CmdletBinding()] + param( + [string] + ${TraceSeverity}, + + [string] + ${EventSeverity}, + + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Schedule}, + + [int] + ${PreExpireDays}, + + [int] + ${EmailNotification}, + + [Parameter(ParameterSetName='AutoGeneratePassword')] + [switch] + ${AutoGeneratePassword}, + + [Parameter(ParameterSetName='NewPasswordAsParameter', Mandatory=$true)] + [securestring] + ${Password}, + + [Parameter(ParameterSetName='NewPassword')] + [switch] + ${SetNewPassword}, + + [Parameter(ParameterSetName='NewPassword', Mandatory=$true)] + [securestring] + ${NewPassword}, + + [Parameter(ParameterSetName='NewPassword', Mandatory=$true)] + [securestring] + ${ConfirmPassword}, + + [Parameter(ParameterSetName='ExistingPassword')] + [switch] + ${UseExistingPassword}, + + [Parameter(ParameterSetName='ExistingPassword', Mandatory=$true)] + [securestring] + ${ExistingPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPMetadataServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [string] + ${AdministratorAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${FullAccessAccount}, + + [string] + ${HubUri}, + + [int] + ${CacheTimeCheckInterval}, + + [int] + ${MaxChannelCache}, + + [switch] + ${DoNotUnpublishAllPackages}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Quota', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [string] + ${ReadAccessAccount}, + + [string] + ${RestrictedAccount}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true)] + [switch] + ${DisablePartitionQuota}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${GroupsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermSetsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${LabelsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${PropertiesPerPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPMetadataServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [switch] + ${ContentTypeSyndicationEnabled}, + + [switch] + ${ContentTypePushdownEnabled}, + + [switch] + ${DefaultKeywordTaxonomy}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${DefaultSiteCollectionTaxonomy}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPMicrofeedOptions { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [ValidateNotNull()] + [int] + ${MaxPostLength}, + + [ValidateNotNull()] + [int] + ${MaxMentions}, + + [ValidateNotNull()] + [int] + ${MaxTags}, + + [ValidateNotNull()] + [System.Nullable[bool]] + ${AsyncRefs}, + + [ValidateNotNull()] + [int] + ${MaxCacheMs}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPMobileMessagingAccount { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [Alias('ServiceType','AccountType')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [string] + ${ServiceName}, + + [string] + ${ServiceUrl}, + + [string] + ${UserId}, + + [string] + ${Password}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPO365LinkSettings { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [AllowEmptyString()] + [string] + ${MySiteHostUrl}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string[]] + ${Audiences}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${RedirectSites}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${HybridAppLauncherEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${OnedriveDefaultToCloudEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPODataConnectionSetting { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 246)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${ServiceAddressURL}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [string] + ${ExtensionProvider}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPODataConnectionSettingMetadata { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 255)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${ServiceAddressMetadataURL}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPOfficeStoreAppsDefaultActivation { + [CmdletBinding(DefaultParameterSetName='AppsForOfficeSettingsInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPPassPhrase { + [CmdletBinding(DefaultParameterSetName='AcrossFarm', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [securestring] + ${PassPhrase}, + + [Parameter(ParameterSetName='AcrossFarm', Mandatory=$true)] + [securestring] + ${ConfirmPassPhrase}, + + [Parameter(ParameterSetName='LocalOnly')] + [switch] + ${LocalServerOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPPerformancePointSecureDataValues { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [pscredential] + ${DataSourceUnattendedServiceAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [bool] + ${CommentsDisabled}, + + [int] + ${CommentsScorecardMax}, + + [int] + ${IndicatorImageCacheSeconds}, + + [int] + ${DataSourceQueryTimeoutSeconds}, + + [int] + ${FilterRememberUserSelectionsDays}, + + [int] + ${FilterTreeMembersMax}, + + [int] + ${FilterSearchResultsMax}, + + [int] + ${ShowDetailsInitialRows}, + + [bool] + ${ShowDetailsMaxRowsDisabled}, + + [int] + ${ShowDetailsMaxRows}, + + [bool] + ${MSMQEnabled}, + + [string] + ${MSMQName}, + + [int] + ${SessionHistoryHours}, + + [bool] + ${AnalyticQueryLoggingEnabled}, + + [bool] + ${TrustedDataSourceLocationsRestricted}, + + [bool] + ${TrustedContentLocationsRestricted}, + + [int] + ${SelectMeasureMaximum}, + + [int] + ${DecompositionTreeMaximum}, + + [bool] + ${ApplicationProxyCacheEnabled}, + + [bool] + ${ApplicationCacheEnabled}, + + [int] + ${ApplicationCacheMinimumHitCount}, + + [int] + ${AnalyticResultCacheMinimumHitCount}, + + [int] + ${ElementCacheSeconds}, + + [int] + ${AnalyticQueryCellMax}, + + [string] + ${SettingsDatabase}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseSQLAuthenticationCredential}, + + [string] + ${DatabaseFailoverServer}, + + [bool] + ${DatabaseUseWindowsAuthentication}, + + [string] + ${DataSourceUnattendedServiceAccountTargetApplication}, + + [bool] + ${UseEffectiveUserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPPowerPointConversionServiceApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [uint32] + ${CacheExpirationPeriodInSeconds}, + + [uint32] + ${WorkerProcessCount}, + + [uint32] + ${WorkerKeepAliveTimeoutInSeconds}, + + [uint32] + ${WorkerTimeoutInSeconds}, + + [uint32] + ${MaximumConversionsPerWorker}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [string] + ${Name}, + + [object] + ${ApplicationPool}, + + [pscredential] + ${ProfileDBCredentials}, + + [string] + ${ProfileDBFailoverServer}, + + [pscredential] + ${SocialDBCredentials}, + + [string] + ${SocialDBFailoverServer}, + + [pscredential] + ${ProfileSyncDBCredentials}, + + [string] + ${ProfileSyncDBFailoverServer}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [bool] + ${PurgeNonImportedObjects}, + + [bool] + ${UseOnlyPreferredDomainControllers}, + + [bool] + ${GetNonImportedObjects}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProfileServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [string] + ${Name}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProfileServiceApplicationSecurity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [ValidateSet('UserACL','MySiteReaderACL')] + [string] + ${Type}, + + [string] + ${UserPrincipalName}, + + [int] + ${UserRights}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectDatabaseQuota { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ParameterSetName='settings', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Settings}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [switch] + ${Enabled}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [ValidateRange(0, 1024000)] + [int] + ${ReadOnlyLimit}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [ValidateRange(0, 100)] + [int] + ${ReadOnlyWarningThreshold}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [ValidateRange(0, 1024000)] + [int] + ${MaxDbSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectEventServiceSettings { + [CmdletBinding()] + param( + [System.Nullable[int]] + ${NetTcpPort}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectOdataConfiguration { + [CmdletBinding()] + param( + [bool] + ${UseVerboseErrors}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxResultsPerCollection}, + + [bool] + ${AcceptCountRequests}, + + [bool] + ${AcceptProjectionRequests}, + + [ValidateRange(1, 2147483647)] + [int] + ${DefaultMaxPageSize}, + + [switch] + ${ClearEntityPageSizeOverrides}, + + [string] + ${EntitySetName}, + + [ValidateRange(1, 2147483647)] + [int] + ${PageSizeOverride}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectPCSSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [System.Nullable[int]] + ${MaximumWorkersCount}, + + [System.Nullable[int]] + ${EditingSessionTimeout}, + + [System.Nullable[int]] + ${MaximumSessionsPerUser}, + + [System.Nullable[int]] + ${CachePersistence}, + + [System.Nullable[int]] + ${MinimumMemoryRequired}, + + [System.Nullable[int]] + ${RequestTimeLimits}, + + [System.Nullable[int]] + ${ResponseSizeLimits}, + + [System.Nullable[int]] + ${MaximumProjectSize}, + + [System.Nullable[int]] + ${NetTcpPort}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectPermissionMode { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [ValidateSet('SharePoint','ProjectServer')] + [object] + ${Mode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectQueueSettings { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [System.Nullable[int]] + ${MaxDegreeOfConcurrency}, + + [System.Nullable[int]] + ${MsgRetryInterval}, + + [System.Nullable[int]] + ${MsgRetryLimit}, + + [System.Nullable[int]] + ${SqlRetryInterval}, + + [System.Nullable[int]] + ${SqlRetryLimit}, + + [System.Nullable[int]] + ${SqlCommandTimeout}, + + [System.Nullable[int]] + ${CleanupSuccessAgeLimit}, + + [System.Nullable[int]] + ${CleanupNonSuccessAgeLimit}, + + [System.Nullable[int]] + ${PeriodicTasksInterval}, + + [System.Nullable[int]] + ${QueueTimeout}, + + [System.Nullable[int]] + ${MaxConnections}, + + [System.Nullable[int]] + ${NetTcpPort}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectReportingTimephasedMode { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true)] + [ValidateSet('Disabled','Daily','Weekly','Monthly','FiscalYear')] + [ValidateNotNullOrEmpty()] + [string] + ${TimephasedMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectServiceApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectUserSync { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [object] + ${Value}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectUserSyncDisabledSyncThreshold { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [int] + ${Threshold}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectUserSyncFullSyncThreshold { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [int] + ${Threshold}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPProjectUserSyncOffPeakSyncThreshold { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [int] + ${Threshold}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPRequestManagementSettings { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [System.Nullable[switch]] + ${RoutingEnabled}, + + [ValidateNotNull()] + [System.Nullable[switch]] + ${ThrottlingEnabled}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${RoutingScheme}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPRoutingMachineInfo { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${Availability}, + + [ValidateNotNull()] + [System.Nullable[object]] + ${OutgoingScheme}, + + [ValidateNotNull()] + [ValidateRange(1, 65535)] + [System.Nullable[int]] + ${OutgoingPort}, + + [ValidateNotNull()] + [switch] + ${ClearOutgoingPort}, + + [ValidateNotNull()] + [System.Nullable[double]] + ${StaticWeight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPRoutingMachinePool { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${MachineTargets}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPRoutingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [object] + ${MachinePool}, + + [ValidateNotNull()] + [System.Nullable[int]] + ${ExecutionGroup}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPScaleOutDatabaseDataRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [object] + ${Range}, + + [byte[]] + ${NewRangePoint}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPScaleOutDatabaseDataSubRange { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [byte[]] + ${SubRangePoint}, + + [Parameter(Mandatory=$true)] + [object] + ${SubRangeMode}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [switch] + ${IgnoreSubRangePointOnBoundary}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSecureStoreApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [object] + ${Administrator}, + + [object] + ${CredentialsOwnerGroup}, + + [object] + ${Fields}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [object] + ${TargetApplication}, + + [object] + ${TicketRedeemer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSecureStoreDefaultProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [type] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSecureStoreServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [object] + ${ApplicationPool}, + + [switch] + ${AuditingEnabled}, + + [System.Nullable[int]] + ${AuditlogMaxSize}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Sharing}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSecurityTokenServiceConfig { + [CmdletBinding(DefaultParameterSetName='SigningCertificateImport', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='SigningCertificateImport')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportSigningCertificate}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${SigningCertificateThumbprint}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${SigningCertificateStoreName}, + + [Parameter(ParameterSetName='SigningCertificateQueue')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${QueueSigningCertificate}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${QueueSigningCertificateThumbprint}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${QueueSigningCertificateStoreName}, + + [Parameter(ParameterSetName='SigningCertificateRevoke')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${RevokeSigningCertificate}, + + [Parameter(ParameterSetName='RevokeSigningCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${RevokeSigningCertificateThumbprint}, + + [Parameter(ParameterSetName='RevokeSigningCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${RevokeSigningCertificateStoreName}, + + [int] + ${ServiceTokenLifetime}, + + [int] + ${ServiceTokenCacheExpirationWindow}, + + [int] + ${FormsTokenLifetime}, + + [int] + ${WindowsTokenLifetime}, + + [int] + ${MaxLogonTokenCacheItems}, + + [int] + ${MaxServiceTokenCacheItems}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServer { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [object] + ${Identity}, + + [System.Nullable[object]] + ${Status}, + + [ValidateSet('Application','ApplicationWithSearch','Custom','DistributedCache','Search','SingleServerFarm','WebFrontEnd','WebFrontEndWithDistributedCache')] + [System.Nullable[object]] + ${Role}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServerScaleOutDatabaseDataRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [object] + ${Range}, + + [byte[]] + ${NewRangePoint}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServerScaleOutDatabaseDataSubRange { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [byte[]] + ${SubRangePoint}, + + [Parameter(Mandatory=$true)] + [object] + ${SubRangeMode}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [switch] + ${IgnoreSubRangePointOnBoundary}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${DefaultEndpoint}, + + [ValidateNotNull()] + [object] + ${ServiceApplicationProxyGroup}, + + [ValidateNotNull()] + [object] + ${IisWebServiceApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServiceApplicationEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='HostName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${HostName}, + + [Parameter(ParameterSetName='ResetHostName', Mandatory=$true)] + [switch] + ${ResetHostName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Position=1)] + [object] + ${Account}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServiceApplicationSecurity { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${ObjectSecurity}, + + [switch] + ${Admin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPServiceHostConfig { + [CmdletBinding(DefaultParameterSetName='SslCertificateImport', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='SslCertificateImport', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SslCertificateReferenceRunInProcess', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SslCertificateReference', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [Alias('Port')] + [ValidateRange(1, 65535)] + [int] + ${HttpPort}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [Alias('SecurePort')] + [ValidateRange(1, 65535)] + [int] + ${HttpsPort}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [ValidateRange(1, 65535)] + [int] + ${NetTcpPort}, + + [Parameter(ParameterSetName='SslCertificateReference', Mandatory=$true)] + [Parameter(ParameterSetName='SslCertificateReferenceRunInProcess', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SslCertificateThumbprint}, + + [Parameter(ParameterSetName='SslCertificateReferenceRunInProcess')] + [Parameter(ParameterSetName='SslCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${SslCertificateStoreName}, + + [Parameter(ParameterSetName='SslCertificateImport')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportSslCertificate}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [switch] + ${NoWait}, + + [Parameter(ParameterSetName='SslCertificateReferenceRunInProcess', Mandatory=$true)] + [switch] + ${RunInProcess}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSessionStateService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [System.Nullable[int]] + ${SessionTimeout}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSite { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default')] + [object] + ${OwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${QuotaTemplate}, + + [Parameter(ParameterSetName='Default')] + [object] + ${Template}, + + [Parameter(ParameterSetName='Default')] + [string] + ${Url}, + + [Parameter(ParameterSetName='Default')] + [long] + ${MaxSize}, + + [Parameter(ParameterSetName='Default')] + [long] + ${WarningSize}, + + [Parameter(ParameterSetName='Default')] + [string] + ${SharingType}, + + [Parameter(ParameterSetName='Default')] + [ValidateSet('Unlock','NoAdditions','ReadOnly','NoAccess')] + [string] + ${LockState}, + + [Parameter(ParameterSetName='Default')] + [object] + ${SecondaryOwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [string] + ${UserAccountDirectoryPath}, + + [Parameter(ParameterSetName='SiteSubscription')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='SiteSubscription')] + [switch] + ${Force}, + + [object] + ${AdministrationSiteType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteAdministration { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default')] + [object] + ${OwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${SecondaryOwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${Template}, + + [Parameter(ParameterSetName='Default')] + [ValidateSet('Unlock','NoAdditions','ReadOnly','NoAccess')] + [string] + ${LockState}, + + [Parameter(ParameterSetName='Default')] + [long] + ${MaxSize}, + + [Parameter(ParameterSetName='Default')] + [long] + ${WarningSize}, + + [Parameter(ParameterSetName='SiteSubscription')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='SiteSubscription')] + [switch] + ${Force}, + + [object] + ${AdministrationSiteType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteSubscriptionConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${UserAccountDirectoryPath}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${FeaturePack}, + + [switch] + ${PassThru}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteSubscriptionEdiscoveryHub { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${SearchScope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteSubscriptionIRMConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${IrmEnabled}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${CertificateServerUrl}, + + [switch] + ${PassThru}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteSubscriptionMetadataConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${HubUri}, + + [switch] + ${DoNotUnpublishAllPackages}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [string] + ${SynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${Zone}, + + [Parameter(Mandatory=$true)] + [string] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPStateServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPStateServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Application')] + [object] + ${ServiceApplication}, + + [ValidateRange(1, 10)] + [System.Nullable[int]] + ${Weight}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPSubscriptionSettingsServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPThrottlingRule { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [ValidateRange(0, 10)] + [ValidateNotNull()] + [System.Nullable[int]] + ${Threshold}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Schedule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTopologyServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${LoadBalancerUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTopologyServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${BadListPeriod}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTranslationServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${DatabaseServer}, + + [string] + ${FailoverDatabaseServer}, + + [System.Nullable[int]] + ${TimerJobFrequency}, + + [System.Nullable[int]] + ${MaximumTranslationAttempts}, + + [System.Nullable[int]] + ${KeepAliveTimeout}, + + [System.Nullable[int]] + ${MaximumTranslationTime}, + + [System.Nullable[int]] + ${TranslationsPerInstance}, + + [System.Nullable[int]] + ${MaximumSyncTranslationRequests}, + + [System.Nullable[int]] + ${RecycleProcessThreshold}, + + [System.Nullable[int]] + ${TotalActiveProcesses}, + + [string] + ${MachineTranslationClientId}, + + [string] + ${MachineTranslationCategory}, + + [switch] + ${UseDefaultInternetSettings}, + + [string] + ${WebProxyAddress}, + + [string] + ${MachineTranslationAddress}, + + [System.Nullable[int]] + ${JobExpirationDays}, + + [System.Nullable[int]] + ${MaximumItemsPerDay}, + + [System.Nullable[int]] + ${MaximumItemsPerPartitionPerDay}, + + [System.Nullable[int]] + ${MaximumBinaryFileSize}, + + [System.Nullable[int]] + ${MaximumTextFileSize}, + + [System.Nullable[int]] + ${MaximumWordCharacterCount}, + + [System.Nullable[bool]] + ${DisableBinaryFileScan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string[]] + ${AddEnabledFileExtensions}, + + [string[]] + ${RemoveEnabledFileExtensions}, + + [switch] + ${ClearEnabledFileExtensions}, + + [switch] + ${EnableAllFileExtensions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTranslationServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [System.Nullable[int]] + ${MaximumGroupSize}, + + [System.Nullable[int]] + ${MaximumItemCount}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTranslationThrottlingSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [System.Nullable[int]] + ${SiteQuota}, + + [System.Nullable[int]] + ${TenantQuota}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportTrustCertificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [object] + ${ClaimsMappings}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${SignInUrl}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [string] + ${Realm}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [switch] + ${UseWReply}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [string] + ${RegisteredIssuerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ManualUpdateCertificateParameterSet')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [string] + ${RegisteredIssuerName}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IsTrustBroker}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNull()] + [object] + #[System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${UsageService}, + + [ValidateLength(1, 135)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseUsername}, + + [ValidateNotNull()] + [securestring] + ${DatabasePassword}, + + [switch] + ${EnableLogging}, + + [ValidateLength(1, 135)] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPUsageDefinition { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Enable}, + + [ValidateRange(0, 31)] + [int] + ${DaysRetained}, + + [ValidateRange(0, 31)] + [int] + ${DaysToKeepUsageFiles}, + + [ValidateRange(1, 9223372036854775807)] + [long] + ${MaxTotalSizeInBytes}, + + [switch] + ${UsageDatabaseEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPUsageService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The max space, in GB, that Usage log files should take up.')] + [ValidateRange(1, 20)] + [uint32] + ${UsageLogMaxSpaceGB}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The location where Usage log files are created.')] + [ValidateLength(1, 181)] + [ValidateNotNullOrEmpty()] + [string] + ${UsageLogLocation}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The time interval, in minutes, that Usage log files should be cut and start a new one.')] + [ValidateRange(1, 1440)] + [uint32] + ${UsageLogCutTime}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The max usage file size, in KB, that Usage log files should be cut and start a new one.')] + [ValidateRange(512, 65536)] + [uint32] + ${UsageLogMaxFileSizeKB}, + + [System.Nullable[bool]] + ${LoggingEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Web}, + + [object] + ${Group}, + + [string] + ${DisplayName}, + + [switch] + ${SyncFromAD}, + + [string[]] + ${AddPermissionLevel}, + + [string[]] + ${RemovePermissionLevel}, + + [switch] + ${ClearPermissions}, + + [switch] + ${PassThru}, + + [string] + ${Email}, + + [switch] + ${IsSiteCollectionAdmin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPVisioExternalData { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UnattendedServiceAccountApplicationID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPVisioPerformance { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [long] + ${MaxDiagramSize}, + + [Parameter(Mandatory=$true)] + [int] + ${MinDiagramCacheAge}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${MaxDiagramCacheAge}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${MaxRecalcDuration}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [long] + ${MaxCacheSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPVisioSafeDataProvider { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true)] + [int] + ${DataProviderType}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPVisioServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ServiceApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${RelativeUrl}, + + [string] + ${Description}, + + [object] + ${Template}, + + [Obsolete('This control applies to SharePoint 2007 theming and is no longer functional')] + [string] + ${Theme}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWebApplication { + [CmdletBinding(DefaultParameterSetName='UpdateGeneralSettings', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='UpdateClaimSettings', Mandatory=$true)] + [object] + ${Zone}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [int] + ${DefaultTimeZone}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [string] + ${DefaultQuotaTemplate}, + + [Parameter(ParameterSetName='UpdateMailSettings', Mandatory=$true)] + [string] + ${SMTPServer}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [switch] + ${DisableSMTPEncryption}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [pscredential] + ${SMTPCredentials}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [int] + ${SMTPServerPort}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [string] + ${OutgoingEmailAddress}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [string] + ${ReplyToEmailAddress}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [Alias('ProxyGroup')] + [object] + ${ServiceApplicationProxyGroup}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${AuthenticationProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${AdditionalClaimProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [string] + ${SignInRedirectURL}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${SignInRedirectProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [switch] + ${Force}, + + [switch] + ${NotProvisionGlobally}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWebApplicationHttpThrottlingMonitor { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(Mandatory=$true, Position=2, ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Upper')] + [ValidateRange(0, 1.7976931348623157E+308)] + [double] + ${UpperLimit}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Lower')] + [ValidateRange(0, 1.7976931348623157E+308)] + [double] + ${LowerLimit}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Buckets')] + [double[]] + ${HealthScoreBuckets}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${IsDESC}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [switch] + ${DefaultAction}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWOPIZone { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWordConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${DatabaseServer}, + + [System.Nullable[int]] + ${TimerJobFrequency}, + + [System.Nullable[int]] + ${ConversionTimeout}, + + [System.Nullable[int]] + ${MaximumConversionAttempts}, + + [System.Nullable[int]] + ${KeepAliveTimeout}, + + [System.Nullable[int]] + ${MaximumConversionTime}, + + [System.Nullable[int]] + ${MaximumSyncConversionRequests}, + + [System.Nullable[int]] + ${ConversionsPerInstance}, + + [switch] + ${DisableEmbeddedFonts}, + + [switch] + ${DisableBinaryFileScan}, + + [System.Nullable[int]] + ${RecycleProcessThreshold}, + + [System.Nullable[int]] + ${ActiveProcesses}, + + [System.Nullable[int]] + ${MaximumMemoryUsage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string[]] + ${AddSupportedFormats}, + + [string[]] + ${RemoveSupportedFormats}, + + [switch] + ${ClearSupportedFormats}, + + [System.Nullable[int]] + ${MaximumGroupSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Set-SPWorkflowConfig { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteCollection}, + + [bool] + ${EmailNoPermissionParticipantsEnabled}, + + [bool] + ${SendDocumentToExternalParticipants}, + + [bool] + ${DeclarativeWorkflowsEnabled}, + + [int] + ${SingleWorkflowEpisodeTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Split-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='NewDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseName}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseFailoverServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNull()] + [pscredential] + ${NewDatabaseCredentials}, + + [Parameter(ParameterSetName='ExistingDatabase', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TargetDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceServiceApplication}, + + [int] + ${SourcePercentage}, + + [switch] + ${MoveLowerHalf}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Split-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='NewDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseName}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseFailoverServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNull()] + [pscredential] + ${NewDatabaseCredentials}, + + [Parameter(ParameterSetName='ExistingDatabase', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TargetDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceServiceApplication}, + + [int] + ${SourcePercentage}, + + [switch] + ${MoveLowerHalf}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPAdminJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPAssignment { + [CmdletBinding()] + param( + [switch] + ${Global}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${WaitEnabled}, + + [string] + ${DeploySinceTime}, + + [switch] + ${TestEnabled}, + + [string] + ${UseSpecificSnapshot}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPDiagnosticsSession { + [CmdletBinding()] + param( + [guid] + ${CorrelationId}, + + [switch] + ${Dashboard}, + + [ValidateSet('High','Medium','Monitorable','Unexpected','Verbose','VerboseEx','None')] + [string] + ${TraceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${IncludeCustomServerRole}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Start-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPAssignment { + [CmdletBinding()] + param( + [switch] + ${Global}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${SemiGlobal}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPContentTypeReplication { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPDiagnosticsSession { + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPDistributedCacheServiceInstance { + [CmdletBinding()] + param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${Graceful}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(0, 1440)] + [System.Nullable[int]] + ${TimeLeft}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${IncludeCustomServerRole}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Stop-SPTaxonomyReplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${Credential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Suspend-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Suspend-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Sync-SPProjectPermissions { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='PSMode', Mandatory=$true, Position=0)] + [Parameter(ParameterSetName='SPMode', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ParameterSetName='SPMode', Position=1)] + [ValidateSet('Full','Incremental')] + [ValidateNotNullOrEmpty()] + [object] + ${Type}, + + [Parameter(ParameterSetName='PSMode', Position=1)] + [switch] + ${SyncPWASite}, + + [Parameter(ParameterSetName='PSMode', Position=2)] + [switch] + ${SyncProjectSites}, + + [Parameter(ParameterSetName='PSMode', Position=3)] + [switch] + ${Async}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Test-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='ContentDatabaseById')] + param( + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNull()] + [object] + ${ServerInstance}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${ShowRowCounts}, + + [switch] + ${ShowLocation}, + + [Parameter(ParameterSetName='ContentDatabaseById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${ExtendedCheck}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Test-SPInfoPathFormTemplate { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Test-SPO365LinkSettings { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${MySiteHostUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Test-SPProjectServiceApplication { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${Rule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Test-SPProjectWebInstance { + [CmdletBinding()] + param( + [Parameter(ParameterSetName='FindProjectSiteByWebInstance', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='FindProjectSiteByWebInstance', Position=1, ValueFromPipeline=$true)] + [object] + ${Rule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Test-SPSite { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [guid] + ${RuleId}, + + [switch] + ${RunAlways}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPAppInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPFeature { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Force}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPHelpCollection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPSolution { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='OneWebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [string] + ${Time}, + + [switch] + ${Local}, + + [Parameter(ParameterSetName='AllWebApplication', Mandatory=$true)] + [switch] + ${AllWebApplications}, + + [uint32] + ${Language}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Uninstall-SPWebPartPack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [uint32] + ${Language}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Unpublish-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPAppCatalogConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [switch] + ${SkipWebTemplateChecking}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPAppInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPAzureBlobConfigLocatorEx1 { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [byte[]] + ${Locator}) + + + } + + + function Update-SPDistributedCacheSize { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uint32] + ${CacheSizeInMB}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPFarmEncryptionKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [switch] + ${Resume}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPHelp { + [CmdletBinding()] + param( + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPInfoPathAdminFileUrl { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true)] + [uri] + ${Find}, + + [Parameter(Mandatory=$true)] + [uri] + ${Replace}, + + [switch] + ${Scan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPInfoPathUserFileUrl { + [CmdletBinding(DefaultParameterSetName='WebApp', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='WebApp', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDB', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='Site', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [uri] + ${Find}, + + [Parameter(Mandatory=$true)] + [uri] + ${Replace}, + + [switch] + ${Scan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPProfilePhotoStore { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${MySiteHostLocation}, + + [bool] + ${CreateThumbnailsForImportedPhotos}, + + [bool] + ${NoDelete}, + + [uri] + ${OldBaseUri}, + + [uri] + ${NewBaseUri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPProfileSync { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [string] + ${ExcludeWebApplications}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SynchronizationTiming}, + + [Parameter(Position=2, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SweepTiming}, + + [Parameter(Position=3, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [bool] + ${IgnoreIsActive}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPRepopulateMicroblogFeedCache { + [CmdletBinding(DefaultParameterSetName='Default')] + param( + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='FollowableList', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='Default', ValueFromPipeline=$true)] + [Parameter(ParameterSetName='FollowableList', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='Default')] + [ValidateNotNull()] + [string] + ${AccountName}, + + [Parameter(ParameterSetName='Default')] + [ValidateNotNull()] + [string] + ${SiteUrl}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${SiteId}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${WebId}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${ListId}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${ListRootFolderUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPRepopulateMicroblogLMTCache { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPSecureStoreApplicationServerKey { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Passphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPSecureStoreCredentialMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [securestring[]] + ${Values}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPSecureStoreGroupCredentialMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [securestring[]] + ${Values}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPSecureStoreMasterKey { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Passphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${LiteralPath}, + + [string] + ${Time}, + + [switch] + ${CASPolicies}, + + [switch] + ${GACDeployment}, + + [switch] + ${FullTrustBinDeployment}, + + [switch] + ${Local}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [object] + ${ToSolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Update-SPWOPIProofKey { + [CmdletBinding()] + param( + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPAppManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(ParameterSetName='AppManagementSvcAppById', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='AppManagementSvcAppByName')] + [string] + ${Name}, + + [guid[]] + ${DatabaseIds}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='ContentDatabaseById', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${ServerInstance}, + + [switch] + ${UseSnapshot}, + + [Parameter(ParameterSetName='ContentDatabaseById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1)] + [switch] + ${ForceDeleteLock}, + + [switch] + ${SkipIntegrityChecks}, + + [Alias('NoB2BSiteUpgrade')] + [switch] + ${SkipSiteUpgrade}, + + [switch] + ${AllowUnattached}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPEnterpriseSearchServiceApplicationSiteSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPFarm { + [CmdletBinding(DefaultParameterSetName='FarmById', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [switch] + ${ServerOnly}, + + [switch] + ${SkipDatabaseUpgrade}, + + [Alias('NoB2BSiteUpgrade')] + [switch] + ${SkipSiteUpgrade}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] + param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPSingleSignOnDatabase { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SSOConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SecureStoreConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [securestring] + ${SecureStorePassphrase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + function Upgrade-SPSite { + [CmdletBinding(DefaultParameterSetName='SPSiteById', SupportsShouldProcess=$true, ConfirmImpact='High')] + param( + [Parameter(ParameterSetName='SPSiteById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${VersionUpgrade}, + + [switch] + ${QueueOnly}, + + [switch] + ${Email}, + + [switch] + ${Unthrottled}, + + [byte] + ${Priority}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + diff --git a/Tests/Unit/UnitTestHelper.psm1 b/Tests/Unit/UnitTestHelper.psm1 index 0b380e422..20be24c30 100644 --- a/Tests/Unit/UnitTestHelper.psm1 +++ b/Tests/Unit/UnitTestHelper.psm1 @@ -45,15 +45,14 @@ function New-SPDscUnitTestHelper } $spBuild = (Get-Item -Path $SharePointStubModule).Directory.BaseName - $firstDot = $spBuild.IndexOf(".") - $majorBuildNumber = $spBuild.Substring(0, $firstDot) + $spBuildParts = $spBuild.Split('.') + $majorBuildNumber = $spBuildParts[0] + $minorBuildNumber = $spBuildParts[1] $describeHeader += " [SP Build: $spBuild]" Import-Module -Name $moduleToLoad -Global - - $initScript = @" Remove-Module -Name "Microsoft.SharePoint.PowerShell" -Force -ErrorAction SilentlyContinue Import-Module -Name "$SharePointStubModule" -WarningAction SilentlyContinue @@ -69,6 +68,10 @@ function New-SPDscUnitTestHelper return $majorBuildNumber } + Mock -CommandName Get-SPDSCBuildVersion -MockWith { + return $minorBuildNumber + } + "@ if ($ExcludeInvokeHelper -eq $false) diff --git a/appveyor.yml b/appveyor.yml index 79208bc25..a589d3624 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ -version: 2.6.0.{build} +version: 3.0.0.{build} + install: - git clone https://github.com/PowerShell/DscResource.Tests