diff --git a/.gitignore b/.gitignore index 2e8c2d67b..0a2ef1841 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.suo *.user *.coverage -.vs \ No newline at end of file +.vs +.psproj +.sln \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..5395f9979 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "PowerShell", + "type": "PowerShell", + "request": "launch", + "program": "RunPesterTests.ps1" + } + ] +} \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPAlternateUrl/MSFT_xSPAlternateUrl.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPAlternateUrl/MSFT_xSPAlternateUrl.psm1 new file mode 100644 index 000000000..ca6a62d65 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPAlternateUrl/MSFT_xSPAlternateUrl.psm1 @@ -0,0 +1,101 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [ValidateSet("Default","Intranet","Extranet","Custom","Internet")] [System.String] $Zone, + [parameter(Mandatory = $false)] [System.String] $Url, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + + ) + + Write-Verbose -Message "Getting Alternate URL for $Zone in $WebAppUrl" + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $aam = Get-SPAlternateURL -WebApplication $params.WebAppUrl -Zone $params.Zone | Select -First 1 + $url = $null + $Ensure = "Absent" + if ($aam -ne $null) { + $url = $aam.PublicUrl + $Ensure = "Present" + } + + return @{ + WebAppUrl = $params.WebAppUrl + Zone = $params.Zone + Url = $url + Ensure = $Ensure + InstallAccount = $params.InstallAccount + } + } + return $result +} + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [ValidateSet("Default","Intranet","Extranet","Custom","Internet")] [System.String] $Zone, + [parameter(Mandatory = $false)] [System.String] $Url, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + + Write-Verbose -Message "Updating app domain settings for $SiteUrl" + + if ($Ensure -eq "Present") { + if ([string]::IsNullOrEmpty($Url)) { + throw "URL must be specified when ensure is set to present" + } + + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments ($PSBoundParameters, $CurrentValues) -ScriptBlock { + $params = $args[0] + $CurrentValues = $args[1] + + if ([string]::IsNullOrEmpty($CurrentValues.Url)) { + New-SPAlternateURL -WebApplication $params.WebAppUrl -Url $params.Url -Zone $params.Zone + } else { + Get-SPAlternateURL -WebApplication $params.WebAppUrl -Zone $params.Zone | Set-SPAlternateURL -Url $params.Url + } + } + } else { + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + Get-SPAlternateURL -WebApplication $params.WebAppUrl -Zone $params.Zone | Remove-SPAlternateURL -Confirm:$false + } + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [ValidateSet("Default","Intranet","Extranet","Custom","Internet")] [System.String] $Zone, + [parameter(Mandatory = $false)] [System.String] $Url, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + + ) + + if ([string]::IsNullOrEmpty($Url) -and $Ensure -eq "Present") { + throw "URL must be specified when ensure is set to present" + } + + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing alternate URL configuration" + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Url", "Ensure") +} + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPAlternateUrl/MSFT_xSPAlternateUrl.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPAlternateUrl/MSFT_xSPAlternateUrl.schema.mof new file mode 100644 index 000000000..54df3805d --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPAlternateUrl/MSFT_xSPAlternateUrl.schema.mof @@ -0,0 +1,27 @@ +/* +**Description** + +This resource is used to define an alternate access mapping URL for a specified web application. + + +**Example** + + xSPAlternateUrl CentralAdminAAM + { + WebAppUrl = "http://sharepoint1:9999" + Zone = "Intranet" + Url = "https://admin.sharepoint.contoso.com" + PsDscRunAsCredential = $SPSetupAccount + } +*/ + +[ClassVersion("1.0.0.0"), FriendlyName("xSPAlternateUrl")] +class MSFT_xSPAlternateUrl : OMI_BaseResource +{ + [Key, Description("The URL of the web application to apply the alternate URL to")] String WebAppUrl; + [Key, Description("The Zone to use for the alternate URL"), ValueMap{"Default","Intranet","Extranet","Custom","Internet"}, Values{"Default","Intranet","Extranet","Custom","Internet"}] String Zone; + [Write, Description("The new alternate URL")] String Url; + [Required, Description("Present ensures the URL is set for this zone on this web app, Absent ensures it is removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; +}; + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPAntivirusSettings/MSFT_xSPAntivirusSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPAntivirusSettings/MSFT_xSPAntivirusSettings.schema.mof index b64e2ec15..349624c99 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPAntivirusSettings/MSFT_xSPAntivirusSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPAntivirusSettings/MSFT_xSPAntivirusSettings.schema.mof @@ -19,12 +19,12 @@ Note that this will not scan documents for viruses on it's own, an external tool [ClassVersion("1.0.0.0"), FriendlyName("xSPAntivirusSettings")] class MSFT_xSPAntivirusSettings : OMI_BaseResource { - [Key] Boolean ScanOnDownload; - [Write] Boolean ScanOnUpload; - [Write] Boolean AllowDownloadInfected; - [Write] Boolean AttemptToClean; - [Write] Uint16 TimeoutDuration; - [Write] Uint16 NumberOfThreads; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, 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; + [Write, Description("What is the timeout for an AV scan in seconds")] Uint16 TimeoutDuration; + [Write, Description("How many concurrent threads should the AV engine be able to run on a server")] Uint16 NumberOfThreads; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPAppCatalog/MSFT_xSPAppCatalog.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPAppCatalog/MSFT_xSPAppCatalog.schema.mof index 57c414803..c5aaeaba4 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPAppCatalog/MSFT_xSPAppCatalog.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPAppCatalog/MSFT_xSPAppCatalog.schema.mof @@ -16,7 +16,6 @@ The catalog site needs to have been created using the correct template (APPCATAL [ClassVersion("1.0.0.0"), FriendlyName("xSPAppCatalog")] class MSFT_xSPAppCatalog : OMI_BaseResource { - [Key] string SiteUrl; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - + [Key, Description("The URL of the site collection that will be the app catalog for the web app that it is in")] string SiteUrl; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPAppDomain/MSFT_xSPAppDomain.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPAppDomain/MSFT_xSPAppDomain.schema.mof index 37114b9cf..ef0637594 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPAppDomain/MSFT_xSPAppDomain.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPAppDomain/MSFT_xSPAppDomain.schema.mof @@ -18,8 +18,8 @@ You can set the domain name and the prefix that is to be used for app URLs. [ClassVersion("1.0.0.0"), FriendlyName("xSPAppDomain")] class MSFT_xSPAppDomain : OMI_BaseResource { - [Key] string AppDomain; - [Required] string Prefix; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The domain name for apps to use in this farm")] string AppDomain; + [Required, Description("The prefix to go on to app URLs")] string Prefix; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPAppManagementServiceApp/MSFT_xSPAppManagementServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPAppManagementServiceApp/MSFT_xSPAppManagementServiceApp.schema.mof index 2d81307b1..9c6786d51 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPAppManagementServiceApp/MSFT_xSPAppManagementServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPAppManagementServiceApp/MSFT_xSPAppManagementServiceApp.schema.mof @@ -19,10 +19,10 @@ Database names or server name will not be changed if the configuration does not [ClassVersion("1.0.0.0"), FriendlyName("xSPAppManagementServiceApp")] class MSFT_xSPAppManagementServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] String ApplicationPool; - [Write] string DatabaseName; - [Write] String DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the app management service application")] string Name; + [Required, Description("The app pool that should be used to run the service app")] String ApplicationPool; + [Write, Description("The name of the database for the service application")] string DatabaseName; + [Write, Description("The name of the server for the database")] String DatabaseServer; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.schema.mof index 9c74b6b6b..2d954ec45 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.schema.mof @@ -20,10 +20,10 @@ Database names or server name will not be changed if the configuration does not [ClassVersion("1.0.0.0"), FriendlyName("xSPBCSServiceApp")] class MSFT_xSPBCSServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] String ApplicationPool; - [Write] string DatabaseName; - [Write] String DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the BCS service app")] string Name; + [Required, Description("The application pool it should run in")] String ApplicationPool; + [Write, Description("Name of the database to create for the service app")] string DatabaseName; + [Write, Description("Name of the database server to host the database on")] String DatabaseServer; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.schema.mof index 8ab123936..2e3a75d16 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.schema.mof @@ -16,9 +16,9 @@ This resource is used to set the "super user" and "super reader" cache accounts [ClassVersion("1.0.0.0"), FriendlyName("xSPCacheAccounts")] class MSFT_xSPCacheAccounts : OMI_BaseResource { - [Key] string WebAppUrl; - [Required] string SuperUserAlias; - [Required] string SuperReaderAlias; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The URL of the web application to set the accounts for")] string WebAppUrl; + [Required, Description("The account name for the super user")] string SuperUserAlias; + [Required, Description("The account name fo the super reader")] string SuperReaderAlias; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof index 32955ca6d..b36b14d4b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.schema.mof @@ -28,12 +28,12 @@ This means you need to use [xSPDistributedCacheService](xSPDistributedCacheServi [ClassVersion("1.0.0.0"), FriendlyName("xSPCreateFarm")] class MSFT_xSPCreateFarm : OMI_BaseResource { - [Key] String FarmConfigDatabaseName; - [Key] String DatabaseServer; - [Required, EmbeddedInstance("MSFT_Credential")] String FarmAccount; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Required] String Passphrase; - [Required] String AdminContentDatabaseName; - [Write] uint32 CentralAdministrationPort; - [Write, ValueMap{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}, Values{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}] string ServerRole; + [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")] 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("SharePoint 2016 only - the MinRole role to enroll this server as"), ValueMap{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}, Values{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}] string ServerRole; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDatabaseAAG/MSFT_xSPDatabaseAAG.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDatabaseAAG/MSFT_xSPDatabaseAAG.psm1 new file mode 100644 index 000000000..3e5bbd5c0 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDatabaseAAG/MSFT_xSPDatabaseAAG.psm1 @@ -0,0 +1,126 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $DatabaseName, + [parameter(Mandatory = $true)] [System.String] $AGName, + [parameter(Mandatory = $false)] [System.String] $FileShare, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Getting current AAG config for $DatabaseName" + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $database = Get-SPDatabase | Where-Object { $_.Name -eq $params.DatabaseName } + + $Ensure = "Absent" + $AGName = $params.AGName + if ($database -ne $null) { + $ag = $database.AvailabilityGroup + if ($ag -ne $null) { + $AGName = $ag.Name + if ($ag.Name -eq $params.AGName) { + $Ensure = "Present" + } + } + } + + return @{ + DatabaseName = $params.DatabaseName + AGName = $AGName + FileShare = $params.FileShare + Ensure = $Ensure + InstallAccount = $params.InstallAccount + } + } + return $result +} + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [System.String] $DatabaseName, + [parameter(Mandatory = $true)] [System.String] $AGName, + [parameter(Mandatory = $false)] [System.String] $FileShare, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Setting AAG config for $DatabaseName" + + $CurrentValues = Get-TargetResource @PSBoundParameters + + # Move to a new AG + if ($CurrentValues.AGName -ne $AGName -and $Ensure -eq "Present") { + Write-Verbose -Message "Moving $DatabaseName from previous AAG to $AGName" + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments ($PSBoundParameters, $CurrentValues) -ScriptBlock { + $params = $args[0] + $CurrentValues = $args[1] + + # Remove it from the current AAG first + Remove-DatabaseFromAvailabilityGroup -AGName $CurrentValues.AGName -DatabaseName $params.DatabaseName -Force + + # Now add it to the AAG it's meant to be in + $addParams = @{ + AGName = $params.AGName + DatabaseName = $params.DatabaseName + } + if ($params.ContainsKey("FileShare")) { + $addParams.Add("FileShare", $params.FileShare) + } + Add-DatabaseToAvailabilityGroup @addParams + } + } else { + if ($Ensure -eq "Present") { + # Add to AG + Write-Verbose -Message "Adding $DatabaseName from $AGName" + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $cmdParams = @{ + AGName = $params.AGName + DatabaseName = $params.DatabaseName + } + if ($params.ContainsKey("FileShare")) { + $cmdParams.Add("FileShare", $params.FileShare) + } + Add-DatabaseToAvailabilityGroup @cmdParams + } + } else { + # Remove from the AG + Write-Verbose -Message "Removing $DatabaseName from $AGName" + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + Remove-DatabaseFromAvailabilityGroup -AGName $params.AGName -DatabaseName $params.DatabaseName -Force + } + } + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [System.String] $DatabaseName, + [parameter(Mandatory = $true)] [System.String] $AGName, + [parameter(Mandatory = $false)] [System.String] $FileShare, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + + Write-Verbose -Message "Checking AAG configuration for $DatabaseName" + + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure", "AGName") +} + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDatabaseAAG/MSFT_xSPDatabaseAAG.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPDatabaseAAG/MSFT_xSPDatabaseAAG.schema.mof new file mode 100644 index 000000000..1307279b0 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDatabaseAAG/MSFT_xSPDatabaseAAG.schema.mof @@ -0,0 +1,29 @@ +/* +**Description** + +This resource will allow specifying which SQL Server AlwaysOn Availability group a resource should be in. +This resource does not configure the Availability Groups on SQL Server, they must already exist. +It simply adds the specified database to the group. + + +**Example** + + xSPDatabaseAAG ConfigDBAAG + { + DatabaseName = "SP_Config" + AGName = "MyAvailabilityGroup" + FileShare = "\\SQL\Backups" + Ensure = "Present" + PsDscRunAsCredential = $InstallAccount + }s +*/ +[ClassVersion("1.0.0.0"), FriendlyName("xSPDatabaseAAG")] +class MSFT_xSPDatabaseAAG : OMI_BaseResource +{ + [Key, Description("The name of the database to put in the AlwaysOn group")] string DatabaseName; + [Required, Description("Name of the AlwaysOn group on the SQL server - this must already exist")] string AGName; + [Write, Description("The fileshare to use for the SQL backup when adding to the group")] string FileShare; + [Required, Description("Present if the database should be in this AlwaysOn group, or Absent if it should not be in the group"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; +}; + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDesignerSettings/MSFT_xSPDesignerSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPDesignerSettings/MSFT_xSPDesignerSettings.schema.mof index 86d3d9652..d0a9c5429 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDesignerSettings/MSFT_xSPDesignerSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDesignerSettings/MSFT_xSPDesignerSettings.schema.mof @@ -33,15 +33,15 @@ Consider implementing PowerShell v5 and switching to the PsDscRunAsCredential co [ClassVersion("1.0.0.0"), FriendlyName("xSPDesignerSettings")] class MSFT_xSPDesignerSettings : OMI_BaseResource { - [Key] string Url; - [Required, ValueMap{"WebApplication","SiteCollection"}, Values{"WebApplication","SiteCollection"}] string SettingsScope; - [Write] Boolean AllowSharePointDesigner; - [Write] Boolean AllowDetachPagesFromDefinition; - [Write] Boolean AllowCustomiseMasterPage; - [Write] Boolean AllowManageSiteURLStructure; - [Write] Boolean AllowCreateDeclarativeWorkflow; - [Write] Boolean AllowSavePublishDeclarativeWorkflow; - [Write] Boolean AllowSaveDeclarativeWorkflowAsTemplate; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [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; + [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; + [Write, Description("Allow site URL structure to be changed by SharePoint Designer")] Boolean AllowManageSiteURLStructure; + [Write, Description("Allow users to create declarative workflows with SharePoint Designer")] Boolean AllowCreateDeclarativeWorkflow; + [Write, Description("Allow users to save and re-publish declarative workflows with SharePoint Designer")] Boolean AllowSavePublishDeclarativeWorkflow; + [Write, Description("Allow users to save declarative workflows as a template from SharePoint Designer")] Boolean AllowSaveDeclarativeWorkflowAsTemplate; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.schema.mof index ede389a1d..9a2ba56b7 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.schema.mof @@ -32,24 +32,24 @@ These settings are applied to the diagnostic logging service for the farm and do [ClassVersion("1.0.0.0"), FriendlyName("xSPDiagnosticLoggingSettings")] class MSFT_xSPDiagnosticLoggingSettings : OMI_BaseResource { - [Key] string LogPath; - [Required] uint32 LogSpaceInGB; - [Write] boolean AppAnalyticsAutomaticUploadEnabled; - [Write] boolean CustomerExperienceImprovementProgramEnabled; - [Write] uint32 DaysToKeepLogs; - [Write] boolean DownloadErrorReportingUpdatesEnabled; - [Write] boolean ErrorReportingAutomaticUploadEnabled; - [Write] boolean ErrorReportingEnabled; - [Write] boolean EventLogFloodProtectionEnabled; - [Write] uint32 EventLogFloodProtectionNotifyInterval; - [Write] uint32 EventLogFloodProtectionQuietPeriod; - [Write] uint32 EventLogFloodProtectionThreshold; - [Write] uint32 EventLogFloodProtectionTriggerPeriod; - [Write] uint32 LogCutInterval; - [Write] boolean LogMaxDiskSpaceUsageEnabled; - [Write] uint32 ScriptErrorReportingDelay; - [Write] boolean ScriptErrorReportingEnabled; - [Write] boolean ScriptErrorReportingRequireAuth; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, 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; + [Write, Description("How many days should ULS logs be kept for")] uint32 DaysToKeepLogs; + [Write, Description("Should updates to error reporting tools be automatically downloaded")] boolean DownloadErrorReportingUpdatesEnabled; + [Write, Description("Should error reports be automatically uploaded")] boolean ErrorReportingAutomaticUploadEnabled; + [Write, Description("Should reporting of errors be enabled")] boolean ErrorReportingEnabled; + [Write, Description("Protect event logs with Event Log Flood Protection")] boolean EventLogFloodProtectionEnabled; + [Write, Description("What interval should the event logs report a flood event")] uint32 EventLogFloodProtectionNotifyInterval; + [Write, Description("What quiet period should reset the event log flood protection thresholds")] uint32 EventLogFloodProtectionQuietPeriod; + [Write, Description("What is the event log flood protection threshold")] uint32 EventLogFloodProtectionThreshold; + [Write, Description("What is the time period that will trigger event log flood protection")] uint32 EventLogFloodProtectionTriggerPeriod; + [Write, Description("How many minutes of activity will a ULS log file leep in an individual file")] uint32 LogCutInterval; + [Write, Description("Will the maximum disk space setting be enabled")] boolean LogMaxDiskSpaceUsageEnabled; + [Write, Description("What delay will be set before script error reporting is triggered")] uint32 ScriptErrorReportingDelay; + [Write, Description("Is script error reporting enabled in this farm")] boolean ScriptErrorReportingEnabled; + [Write, Description("Require users to be authenticated to allow script errors to be reported")] boolean ScriptErrorReportingRequireAuth; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index c18bac757..ed0720ded 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -9,6 +9,7 @@ function Get-TargetResource [parameter(Mandatory = $true)] [System.String] $ServiceAccount, [parameter(Mandatory = $true)] [System.Boolean] $CreateFirewallRules, [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.String[]] $ServerProvisionOrder, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) @@ -40,6 +41,7 @@ function Get-TargetResource ServiceAccount = $windowsService.StartName CreateFirewallRules = ($firewallRule -ne $null) Ensure = "Present" + ServerProvisionOrder = $params.ServerProvisionOrder InstallAccount = $params.InstallAccount } } @@ -61,6 +63,7 @@ function Set-TargetResource [parameter(Mandatory = $true)] [System.String] $ServiceAccount, [parameter(Mandatory = $true)] [System.Boolean] $CreateFirewallRules, [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.String[]] $ServerProvisionOrder, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) @@ -90,7 +93,36 @@ function Set-TargetResource Write-Verbose -Message "Enabling distributed cache service" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - + + if ($params.ContainsKey("ServerProvisionOrder")) { + + $serverCount = 0 + $currentServer = $params.ServerProvisionOrder[$serverCount] + + while ($currentServer -ne $env:COMPUTERNAME) { + $count = 0 + $maxCount = 30 + + Write-Verbose "Waiting for cache on $currentServer" + while (($count -lt $maxCount) -and ((Get-SPServiceInstance -Server $currentServer | ? { $_.TypeName -eq "Distributed Cache" -and $_.Status -eq "Online" }) -eq $null)) { + Start-Sleep -Seconds 60 + $count++ + } + + if ((Get-SPServiceInstance -Server $currentServer | ? { $_.TypeName -eq "Distributed Cache" -and $_.Status -eq "Online" }) -eq $null) { + Write-Warning "Server $currentServer is not running distributed cache after waiting 30 minutes. No longer waiting for this server, progressing to next action" + } + + $serverCount++ + + if ($ServerCount -ge $params.ServerProvisionOrder.Length) { + throw "The server $($env:COMPUTERNAME) was not found in the array for distributed cache servers" + } + $currentServer = $params.ServerProvisionOrder[$serverCount] + } + } + + Add-SPDistributedCacheServiceInstance Get-SPServiceInstance | Where-Object { $_.TypeName -eq "Distributed Cache" } | Stop-SPServiceInstance -Confirm:$false @@ -157,6 +189,7 @@ function Test-TargetResource [parameter(Mandatory = $true)] [System.String] $ServiceAccount, [parameter(Mandatory = $true)] [System.Boolean] $CreateFirewallRules, [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.String[]] $ServerProvisionOrder, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.schema.mof index 13e856455..e4fecae99 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.schema.mof @@ -1,4 +1,4 @@ -/* +/* **Description** This resource is responsible for provisioning the distributed cache to the service it runs on. @@ -6,25 +6,33 @@ This is required in your farm on at least one server (as the behavior of [xSPCre The service will be provisioned or de-provisioned based on the Ensure property, and when provisioned the CacheSizeInMB property and ServiceAccount property will be used to configure it. The property createFirewallRules is used to determine if exceptions should be added to the windows firewall to allow communication between servers on the appropriate ports. +The ServerProvisionOrder optional property is used when a pull server is handing out configurations to nodes in order to tell this resource about a specific order of enabling the caches. +This allows for multiple servers to receive the same configuration, but they will always check for the server before them in the list first to ensure that it is running distributed cache. +By doing this you can ensure that you do not create conflicts with two or more servers provisioning a cache at the same time. +Note, this approach only makes a server check the others for distributed cache, it does not provision the cache automatically on all servers. +If a previous server in the sequence does not appear to be running distributed cache after 30 minutes, the local server that was waiting will begin anyway. + **Example** xSPDistributedCacheService EnableDistributedCache { - Name = "AppFabricCachingService" - Ensure = "Present" - CacheSizeInMB = 8192 - ServiceAccount = "DEMO\ServiceAccount" - InstallAccount = $InstallAccount - CreateFirewallRules = $true + Name = "AppFabricCachingService" + Ensure = "Present" + CacheSizeInMB = 8192 + ServiceAccount = "DEMO\ServiceAccount" + InstallAccount = $InstallAccount + ServerProvisionOrder = @("server1", "server2") + CreateFirewallRules = $true } */ [ClassVersion("1.0.0.0"), FriendlyName("xSPDistributedCacheService")] class MSFT_xSPDistributedCacheService : OMI_BaseResource { - [Key] String Name; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; - [Required] UInt32 CacheSizeInMB; - [Required] String ServiceAccount; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Required] Boolean CreateFirewallRules; + [Key, Description("A name to assign to this resource - not really used. For example - AppFabricCachingService")] String Name; + [Required, Description("Present to ensure the current server should be running distributed cache, absent to ensure that it isn't running"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Required, Description("How many MB should be used for the cache. The maximum supported is 16384")] UInt32 CacheSizeInMB; + [Required, Description("The name of the service account to run the service as. This should already be registered as a managed account in SharePoint")] String ServiceAccount; + [Write, Description("A list of servers which specifies the order they should provision the cache in to ensure that two servers do not do it at the same time")] String ServerProvisionOrder[]; + [Required, Description("Should the Windows Firewall rules for distributed cache be created?")] Boolean CreateFirewallRules; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFarmAdministrators/MSFT_xSPFarmAdministrators.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPFarmAdministrators/MSFT_xSPFarmAdministrators.schema.mof index 2692d405c..bb95092c4 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFarmAdministrators/MSFT_xSPFarmAdministrators.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFarmAdministrators/MSFT_xSPFarmAdministrators.schema.mof @@ -18,10 +18,10 @@ The "MembersToInclude" and "MembersToExclude" properties will allow you to contr [ClassVersion("1.0.0.0"), FriendlyName("xSPFarmAdministrators")] class MSFT_xSPFarmAdministrators : OMI_BaseResource { - [Key] String Name; - [Write] String Members[]; - [Write] String MembersToInclude[]; - [Write] String MembersToExclude[]; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("A generic name for this resource, its value is not important")] String Name; + [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[]; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFarmSolution/MSFT_xSPFarmSolution.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFarmSolution/MSFT_xSPFarmSolution.psm1 new file mode 100644 index 000000000..3038c3661 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFarmSolution/MSFT_xSPFarmSolution.psm1 @@ -0,0 +1,340 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [String] $Name, + [parameter(Mandatory = $true)] [String] $LiteralPath, + [parameter(Mandatory = $false)] [String[]] $WebApplications = @(), + [parameter(Mandatory = $false)] [ValidateSet("Present","Absent")] + [String] $Ensure = "Present", + [parameter(Mandatory = $false)] [String] $Version = "1.0.0.0", + [parameter(Mandatory = $false)] [Boolean] $Deployed = $true, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + Write-Verbose -Message "Getting farm solution '$Name'..." + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $solution = Get-SPSolution -Identity $params.Name -ErrorAction SilentlyContinue -Verbose:$false + + if ($null -ne $solution) { + $currentState = "Present" + $deployed = $solution.Deployed + $version = $Solution.Properties["Version"] + $deployedWebApplications = @($solution.DeployedWebApplications | select -ExpandProperty Url) + $ContainsGlobalAssembly = $solution.ContainsGlobalAssembly + } else { + $currentState = "Absent" + $deployed = $false + $version = "0.0.0.0" + $deployedWebApplications = @() + $ContainsGlobalAssembly = $false + } + + return @{ + Name = $params.Name + LiteralPath = $LiteralPath + Deployed = $deployed + Ensure = $currentState + Version = $version + WebApplications = $deployedWebApplications + ContainsGlobalAssembly = $ContainsGlobalAssembly + } + } + + return $result +} + +function Set-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [parameter(Mandatory = $true)] [String] $Name, + [parameter(Mandatory = $true)] [String] $LiteralPath, + [parameter(Mandatory = $false)] [String[]] $WebApplications = @(), + [parameter(Mandatory = $false)] [ValidateSet("Present","Absent")] + [String] $Ensure = "Present", + [parameter(Mandatory = $false)] [String] $Version = "1.0.0.0", + [parameter(Mandatory = $false)] [Boolean] $Deployed = $true, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + + $PSBoundParameters.Ensure = $Ensure + $PSBoundParameters.Version = $Version + $PSBoundParameters.Deployed = $Deployed + $PSBoundParameters.ContainsGlobalAssembly = $CurrentValues.ContainsGlobalAssembly + + if ($Ensure -eq "Present") + { + if ($CurrentValues.Ensure -eq "Absent") + { + Write-Verbose "Upload solution to the farm." + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -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.Update() + + return $solution + } + + $CurrentValues.Version = $result.Properties["Version"] + $CurrentValues.ContainsGlobalAssembly = $result.ContainsGlobalAssembly + } + + if ($CurrentValues.Version -ne $Version) + { + # 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) + { + Write-Verbose "Remove current version ('$($CurrentValues.Version)') of solution..." + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $runParams = @{} + $runParams.Add("Identity", $params.Name) + $runParams.Add("Confirm", $false) + $runParams.Add("Verbose", $false) + + Remove-SPSolution $runParams + + $runParams = @{} + $runParams.Add("LiteralPath", $params.LiteralPath) + + $solution = Add-SPSolution @runParams + + $solution.Properties["Version"] = $params.Version + $solution.Update() + + return $solution + } + + $CurrentValues.Version = $result.Properties["Version"] + $CurrentValues.ContainsGlobalAssembly = $result.ContainsGlobalAssembly + } + else + { + Write-Verbose "Update solution from '$($CurrentValues.Version)' to $Version..." + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $runParams = @{} + $runParams.Add("Identity", $params.Name) + $runParams.Add("LiteralPath", $params.LiteralPath) + $runParams.Add("GACDeployment", $params.ContainsGlobalAssembly) + $runParams.Add("Confirm", $false) + $runParams.Add("Local", $false) + $runParams.Add("Verbose", $false) + + Update-SPSolution @runParams + + $Solution = Get-SPSolution $params.Name -Verbose:$false + $solution.Properties["Version"] = $params.Version + $solution.Update() + + # Install new features... + Install-SPFeature -AllExistingFeatures -Confirm:$false + } + } + } + + } + else + { + #If ensure is absent we should also retract the solution first + $Deployed = $false + } + + if ($Deployed -ne $CurrentValues.Deployed) + { + Write-Verbose "The deploy state of $Name is '$($CurrentValues.Deployed)' but should be '$Deployed'." + if ($CurrentValues.Deployed) + { + # Retract Solution globally + $result = Invoke-xSharePointCommand -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 ($webApps -eq $null -or $webApps.Length -eq 0) + { + $runParams.Add("AllWebApplications", $true) + + Uninstall-SPSolution @runParams + } + else + { + foreach ($webApp in $webApps) + { + $runParams["WebApplication"] = $webApp + + Uninstall-SPSolution @runParams + } + } + } + else + { + Uninstall-SPSolution @runParams + } + } + } + else + { + # Deploy solution + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $solution = Get-SPSolution -Identity $params.Name -Verbose:$false + + $runParams = @{ + Identity = $solution + GACDeployment = $solution.ContainsGlobalAssembly + Local = $false + Verbose = $false + } + + if (!$solution.ContainsWebApplicationResource) + { + Install-SPSolution @runParams + } + else + { + if ($webApps -eq $null -or $webApps.Length -eq 0) + { + $runParams.Add("AllWebApplications", $true) + + Install-SPSolution @runParams + } + else + { + foreach ($webApp in $webApps) + { + $runParams["WebApplication"] = $webApp + + Install-SPSolution @runParams + } + } + } + + } + } + + } + + WaitFor-SolutionJob -SolutionName $Name -InstallAccount $InstallAccount + + if ($Ensure -eq "Absent") + { + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $runParams = @{ + Identity = $params.Name + Confirm = $false + Verbose = $false + } + + Remove-SPSolution @runParams + + } + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [String] $Name, + [parameter(Mandatory = $true)] [String] $LiteralPath, + [parameter(Mandatory = $false)] [String[]] $WebApplications = @(), + [parameter(Mandatory = $false)] [ValidateSet("Present","Absent")] + [String] $Ensure = "Present", + [parameter(Mandatory = $false)] [String] $Version = "1.0.0.0", + [parameter(Mandatory = $false)] [Boolean] $Deployed = $true, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing solution $Name" + + $PSBoundParameters.Ensure = $Ensure + + if ($WebApplications.Count -gt 0){ + $valuesToCheck = @("Ensure", "Version", "Deployed", "WebApplications") + }else{ + $valuesToCheck = @("Ensure", "Version", "Deployed") + } + + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck $valuesToCheck +} + +function WaitFor-SolutionJob +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true)] [string]$SolutionName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount + ) + + start-sleep -s 5 + + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments @{ Name = $SolutionName } -ScriptBlock { + $params = $args[0] + + $gc = Start-SPAssignment -Verbose:$false + + $solution = Get-SPSolution -Identity $params.Name -Verbose:$false -AssignmentCollection $gc + + if ($solution.JobExists){ + Write-Verbose "Waiting for solution '$($params.Name)'..." + + while ($solution.JobExists){ + + start-sleep -s 5 + } + + Write-Verbose "Result: $($solution.LastOperationResult)" + Write-Verbose "Details: $($solution.LastOperationDetails)" + + }else{ + Write-Verbose "Solution '$($params.Name)' has no job pending." + return @{ + LastOperationResult = "DeploymentSucceeded" + LastOperationDetails = "Solution '$($params.Name)' has no job pending." + } + } + + Stop-SPAssignment $gc -Verbose:$false + + return @{ + LastOperationResult = $solution.LastOperationResult + LastOperationDetails = $solution.LastOperationDetails + } + } +} + +Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFarmSolution/MSFT_xSPFarmSolution.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPFarmSolution/MSFT_xSPFarmSolution.schema.mof new file mode 100644 index 000000000..cb049dea0 --- /dev/null +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFarmSolution/MSFT_xSPFarmSolution.schema.mof @@ -0,0 +1,38 @@ +/* + +**Description** + +This resource is used to make sure that a specific farm solution is either present or absent in a farm. +The Ensure property will dictate if the solution should be present or absent. +The name property is the name of the solution including the wsp extension (i.e. MySolution.wsp). +The LiteralPath is required and points to the solution in the files system that is used to upload it if it does not exist. +The Version will be stored in the property bag to determine later if the correct version is installed. +I the version in the farm does not match the desired version an upgrade of the solution will be performed. + +The solution can be deployed to one or more web application passing an array of URL's to the WebApplications property. +If the solution contains resources scoped for web applications and no WebApplications are specified, the solution will be deployed to all web applications. +If the solution does not contain resources scoped for web applications the property is ignored and the solution is deployed globally. + +**Example** + + xSPFarmSolution SampleWsp + { + Name = "MySolution.wsp" + LiteralPath = "C:\src\MySolution.wsp" + Ensure = "Present" + Version = "1.0.0" + WebApplications = @("http://collaboration", "http://mysites") + PsDscRunAsCredential = $InstallAccount + } +*/ +[ClassVersion("1.0.0.0"), FriendlyName("xSPFarmSolution")] +class MSFT_xSPFarmSolution : 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("Present if the WSP should be deployed, or Absent if it should be removed")] 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; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; +}; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 index cb94bf93d..7cf174ce0 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 @@ -8,7 +8,8 @@ function Get-TargetResource [parameter(Mandatory = $true)] [System.String] $Url, [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, - [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.String] $Version ) Write-Verbose -Message "Getting feature $Name at $FeatureScope scope" @@ -32,6 +33,7 @@ function Get-TargetResource Url = $params.Url InstalAcount = $params.InstallAccount Ensure = $currentState + Version = $featureAtScope.Version } } return $result @@ -47,23 +49,41 @@ function Set-TargetResource [parameter(Mandatory = $true)] [System.String] $Url, [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, - [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.String] $Version ) + $CurrentValues = Get-TargetResource @PSBoundParameters + + $PSBoundParameters.Add("CurrentValues", $CurrentValues) + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { - $params = $args[0] + $params = $args[0] + $currentValues = $params["CurrentValues"] + + $runParams = @{ Identity = $params.Name } - $runParams = @{} - $runParams.Add("Identity", $params.Name) if ($params.FeatureScope -ne "Farm") { $runParams.Add("Url", $params.Url) } - + if ($params.Ensure -eq "Present") { + if ($currentValues.Ensure -eq "Present"){ + + # Disable the feature first if it already exists. + $runParams.Add("Confirm", $false) + Write-Verbose "Disable Feature '$($params.Name)' because it is already active at scope '$($params.FeatureScope)'..." + Disable-SPFeature @runParams + } + + Write-Verbose "Enable Feature '$($params.Name)' at scope '$($params.FeatureScope)'..." Enable-SPFeature @runParams + } else { - $runParams.Add("Confirm", $false) + + $runParams.Add("Confirm", $false) + Write-Verbose "Disable Feature '$($params.Name)' because 'Ensure' is '$($params.Ensure)'..." Disable-SPFeature @runParams } } @@ -80,12 +100,16 @@ function Test-TargetResource [parameter(Mandatory = $true)] [System.String] $Url, [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, - [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.String] $Version ) $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for feature $Name at $FeatureScope scope" - return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure") + + $valuesToCheck = @("Ensure", "Version") + + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck $valuesToCheck } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.schema.mof index be07bcbbc..951937d38 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.schema.mof @@ -13,16 +13,19 @@ The name property is the name of the feature based on its folder name in the FEA Url = "http://www.contoso.com" Ensure = "Present" Scope = "Site" - PsDscRunAsCredential = $SetupAccuount + PsDscRunAsCredential = $SetupAccuount + Version = "1.0.0.0" } */ [ClassVersion("1.0.0.0"), FriendlyName("xSPFeature")] class MSFT_xSPFeature : OMI_BaseResource { - [Key] string Name; - [Required, ValueMap{"Farm","WebApplication","Site","Web"}, Values{"Farm","WebApplication","Site","Web"}] string FeatureScope; - [Key] string Url; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("The name of the feature")] string Name; + [Required, Description("The scope to change the feature at - Farm, WebApplication, SiteCollection or Site"), ValueMap{"Farm","WebApplication","Site","Web"}, Values{"Farm","WebApplication","Site","Web"}] string FeatureScope; + [Key, Description("The URL to change the feature at")] string Url; + [Required, Description("Present if the feature is to be enabled, Absent if it is to be disabled"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("The version of the feature to check against")] string Version; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; + diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPHealthAnalyzerRuleState/MSFT_xSPHealthAnalyzerRuleState.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPHealthAnalyzerRuleState/MSFT_xSPHealthAnalyzerRuleState.schema.mof index d2d87b8b8..0dfa871cc 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPHealthAnalyzerRuleState/MSFT_xSPHealthAnalyzerRuleState.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPHealthAnalyzerRuleState/MSFT_xSPHealthAnalyzerRuleState.schema.mof @@ -20,11 +20,11 @@ The resource is able to enable/disable and configure the specified rule. [ClassVersion("1.0.0.0"), FriendlyName("xSPHealthAnalyzerRuleState")] class MSFT_xSPHealthAnalyzerRuleState : OMI_BaseResource { - [Key] String Name; - [Required] Boolean Enabled; - [Write, ValueMap{"All Servers","Any Server"}, Values{"All Servers","Any Server"}] String RuleScope; - [Write, ValueMap{"Hourly","Daily","Weekly","Monthly","OnDemandOnly"}, Values{"Hourly","Daily","Weekly","Monthly","OnDemandOnly"}] String Schedule; - [Write] Boolean FixAutomatically; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the rule exactly as it appears in central admin")] String Name; + [Required, Description("Should the rule be enabled?")] Boolean Enabled; + [Write, Description("What is the scope of this rule"), ValueMap{"All Servers","Any Server"}, Values{"All Servers","Any Server"}] String RuleScope; + [Write, Description("How often should the rule check"), ValueMap{"Hourly","Daily","Weekly","Monthly","OnDemandOnly"}, Values{"Hourly","Daily","Weekly","Monthly","OnDemandOnly"}] String Schedule; + [Write, Description("Should the rule fix itself automatically")] Boolean FixAutomatically; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 index 5ec9e13ed..60d8f16a3 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 @@ -42,6 +42,16 @@ function Set-TargetResource throw [Exception] "xSharePoint does not support uninstalling SharePoint or its prerequisites. Please remove this manually." return } + + $InstallerPath = Join-Path $BinaryDir "setup.exe" + $majorVersion = (Get-xSharePointAssemblyVersion -PathToAssembly $InstallerPath) + if ($majorVersion -eq 15) { + $dotNet46Check = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}' -and $_.Version -like "4.6.*"} + if ($dotNet46Check -ne $null -and $dotNet46Check.Length -gt 0) { + throw [Exception] "A known issue prevents installation of SharePoint 2013 on servers that have .NET 4.6 already installed. See details at https://support.microsoft.com/en-us/kb/3087184" + return + } + } Write-Verbose -Message "Writing install config file" diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof index b3405b8d4..bf986dfa6 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof @@ -31,8 +31,8 @@ Currently SharePoint Foundation is not supported by xSPInstall (see [Issue #81]( [ClassVersion("1.0.0.0"), FriendlyName("xSPInstall")] class MSFT_xSPInstall : OMI_BaseResource { - [Key] String BinaryDir; - [Required] String ProductKey; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("The directory that contains all of the SharePoint binaries")] String BinaryDir; + [Required, Description("The product key to use during the installation")] String ProductKey; + [Required, Description("Present to install SharePoint. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 index bbc456e4e..b0bfecaa0 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 @@ -42,7 +42,15 @@ function Get-TargetResource $WindowsFeatures = Get-WindowsFeature -Name Application-Server, AS-NET-Framework, AS-TCP-Port-Sharing, AS-Web-Support, AS-WAS-Support, AS-HTTP-Activation, AS-Named-Pipes, AS-TCP-Activation, Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Cert-Auth, Web-IP-Security, Web-Url-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Scripting, Web-WMI, Web-Scripting-Tools, NET-Framework-Features, NET-Framework-Core, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, NET-WCF-Pipe-Activation45, NET-WCF-TCP-Activation45, Server-Media-Foundation, Windows-Identity-Foundation, PowerShell-V2, WAS, WAS-Process-Model, WAS-NET-Environment, WAS-Config-APIs, XPS-Viewer } if ($majorVersion -eq 16) { - $WindowsFeatures = Get-WindowsFeature -Name Application-Server, AS-NET-Framework, AS-Web-Support, Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Cert-Auth, Web-IP-Security, Web-Url-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Mgmt-Console, Web-Lgcy-Scripting, Web-WMI, Web-Scripting-Tools, NET-Framework-Features, NET-Framework-Core, NET-HTTP-Activation, NET-Non-HTTP-Activ, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, Windows-Identity-Foundation, PowerShell-V2, WAS, WAS-Process-Model, WAS-NET-Environment, WAS-Config-APIs + $osVersion = [System.Environment]::OSVersion.Version.Major + if ($osVersion -eq 10) { + # Server 2016 + $WindowsFeatures = Get-WindowsFeature -Name 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-Filering, Web-Basic-Auth, Web-Digest-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45Web-Asp-Net, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Scripting, Web-WMI, 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 + } else { + # Server 2012 R2 + $WindowsFeatures = Get-WindowsFeature -Name Application-Server, AS-NET-Framework, AS-Web-Support, Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Cert-Auth, Web-IP-Security, Web-Url-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Mgmt-Console, Web-Lgcy-Scripting, Web-WMI, Web-Scripting-Tools, NET-Framework-Features, NET-Framework-Core, NET-HTTP-Activation, NET-Non-HTTP-Activ, NET-Framework-45-ASPNET, NET-WCF-HTTP-Activation45, Windows-Identity-Foundation, PowerShell-V2, WAS, WAS-Process-Model, WAS-NET-Environment, WAS-Config-APIs + } + } foreach ($feature in $WindowsFeatures) { @@ -122,6 +130,12 @@ function Set-TargetResource Write-Verbose -Message "Detecting SharePoint version from binaries" $majorVersion = (Get-xSharePointAssemblyVersion -PathToAssembly $InstallerPath) if ($majorVersion -eq 15) { + $dotNet46Check = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}' -and $_.Version -like "4.6.*"} + if ($dotNet46Check -ne $null -and $dotNet46Check.Length -gt 0) { + throw [Exception] "A known issue prevents installation of SharePoint 2013 on servers that have .NET 4.6 already installed. See details at https://support.microsoft.com/en-us/kb/3087184" + return + } + Write-Verbose -Message "Version: SharePoint 2013" $requiredParams = @("SQLNCli","PowerShell","NETFX","IDFX","Sync","AppFabric","IDFX11","MSIPCClient","WCFDataServices","KB2671763","WCFDataServices56") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof index 845ce57a6..aaca9d553 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof @@ -46,25 +46,25 @@ Offline example: [ClassVersion("1.0.0.0"), FriendlyName("xSPInstallPrereqs")] class MSFT_xSPInstallPrereqs : OMI_BaseResource { - [Key] String InstallerPath; - [Required] Boolean OnlineMode; - [Write] String SQLNCli; - [Write] String PowerShell; - [Write] String NETFX; - [Write] String IDFX; - [Write] String Sync; - [Write] String AppFabric; - [Write] String IDFX11; - [Write] String MSIPCClient; - [Write] String WCFDataServices; - [Write] String KB2671763; - [Write] String WCFDataServices56; - [Write] String KB2898850; - [Write] String MSVCRT11; - [Write] String MSVCRT14; - [Write] String KB3092423; - [Write] String ODBC; - [Write] String DotNet452; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, 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 installer for this prerequisite")] String SQLNCli; + [Write, Description("The path to the installer for this prerequisite")] String PowerShell; + [Write, Description("The path to the installer for this prerequisite")] String NETFX; + [Write, Description("The path to the installer for this prerequisite")] String IDFX; + [Write, Description("The path to the installer for this prerequisite")] String Sync; + [Write, Description("The path to the installer for this prerequisite")] String AppFabric; + [Write, Description("The path to the installer for this prerequisite")] String IDFX11; + [Write, Description("The path to the installer for this prerequisite")] String MSIPCClient; + [Write, Description("The path to the installer for this prerequisite")] String WCFDataServices; + [Write, Description("The path to the installer for this prerequisite")] String KB2671763; + [Write, Description("The path to the installer for this prerequisite")] String WCFDataServices56; + [Write, Description("The path to the installer for this prerequisite")] String KB2898850; + [Write, Description("The path to the installer for this prerequisite")] String MSVCRT11; + [Write, Description("The path to the installer for this prerequisite")] String MSVCRT14; + [Write, Description("The path to the installer for this prerequisite")] String KB3092423; + [Write, Description("The path to the installer for this prerequisite")] String ODBC; + [Write, Description("The path to the installer for this prerequisite")] String DotNet452; + [Required, Description("Present to install the prerequisites. Absent is currently not supported"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.schema.mof index dcf244734..6b64b00c2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.schema.mof @@ -18,10 +18,9 @@ After the server has joined the farm, the process will wait for 5 minutes to all [ClassVersion("1.0.0.0"), FriendlyName("xSPJoinFarm")] class MSFT_xSPJoinFarm : OMI_BaseResource { - [Key] string FarmConfigDatabaseName; - [Key] string DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Required] string Passphrase; - [Write, ValueMap{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}, Values{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}] string ServerRole; + [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")] string Passphrase; + [Write, Description("SharePoint 2016 only - the MinRole role to enroll this server as"), ValueMap{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}, Values{"Application","Custom","DistributedCache","Search","SingleServer","SingleServerFarm","SpecialLoad","WebFrontEnd"}] string ServerRole; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; - diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.schema.mof index 4f5133fd3..909078d95 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.schema.mof @@ -17,10 +17,10 @@ The settings for EmailNotification, PreExpireDays and Schedule all relate to ena [ClassVersion("1.0.0.0"), FriendlyName("xSPManagedAccount")] class MSFT_xSPManagedAccount : OMI_BaseResource { - [Key] string AccountName; - [Required, EmbeddedInstance("MSFT_Credential")] String Account; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Write] Uint32 EmailNotification; - [Write] Uint32 PreExpireDays; - [Write] string Schedule; + [Key, Description("The username of the account")] string AccountName; + [Required, Description("The credential with password of the account"), EmbeddedInstance("MSFT_Credential")] String Account; + [Write, Description("How many days before a password change should an email be sent")] Uint32 EmailNotification; + [Write, Description("How many days before a password expires should it be changed")] Uint32 PreExpireDays; + [Write, Description("What is the schedule for the password reset")] string Schedule; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.schema.mof index d4e073221..1b076e758 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.schema.mof @@ -19,9 +19,9 @@ The database server and database name properties are only used during provisioni [ClassVersion("1.0.0.0"), FriendlyName("xSPManagedMetaDataServiceApp")] class MSFT_xSPManagedMetaDataServiceApp : OMI_BaseResource { - [Key] string Name; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Required] string ApplicationPool; - [Write] string DatabaseServer; - [Write] string DatabaseName; + [Key, Description("The name of the managed metadata service application")] string Name; + [Required, Description("The application pool that the service app will use")] string ApplicationPool; + [Write, Description("The name of the database server which will host the application")] string DatabaseServer; + [Write, Description("The name of the database for the service application")] string DatabaseName; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.schema.mof index d3b7d02b4..294f8f1bd 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.schema.mof @@ -20,9 +20,9 @@ If you are using host named site collections set HostHeader to true and the path [ClassVersion("1.0.0.0"), FriendlyName("xSPManagedPath")] class MSFT_xSPManagedPath : OMI_BaseResource { - [Key] string WebAppUrl; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Key] string RelativeUrl; - [Required] boolean Explicit; - [Required] boolean HostHeader; + [Key, Description("The URL of the web application to apply the managed path to - this is ignored for host header web applications")] string WebAppUrl; + [Key, Description("The relative URL of the managed path")] string RelativeUrl; + [Required, Description("Should the host header be explicit? If false then it is a wildcard")] boolean Explicit; + [Required, Description("Is this a host header web application?")] boolean HostHeader; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof index 292799962..56436d82f 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPOutgoingEmailSettings/MSFT_xSPOutgoingEmailSettings.schema.mof @@ -19,11 +19,11 @@ It is possible to set the outgoing server, from address, reply to address and th [ClassVersion("1.0.0.0"), FriendlyName("xSPOutgoingEmailSettings")] class MSFT_xSPOutgoingEmailSettings : OMI_BaseResource { - [key] string WebAppUrl; - [Required] string SMTPServer; - [Required] string FromAddress; - [Required] string ReplyToAddress; - [Required] string CharacterSet; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [key, Description("The URL of the web application. If you want to set the global settings use the Central Admin URL")] string WebAppUrl; + [Required, Description("The SMTP server for outgoing mail")] string SMTPServer; + [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("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPPasswordChangeSettings/MSFT_xSPPasswordChangeSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPPasswordChangeSettings/MSFT_xSPPasswordChangeSettings.schema.mof index 8a9b15557..dcc308bba 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPPasswordChangeSettings/MSFT_xSPPasswordChangeSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPPasswordChangeSettings/MSFT_xSPPasswordChangeSettings.schema.mof @@ -19,9 +19,9 @@ The settings relate to email notifications of when passwords are reset, as well [ClassVersion("1.0.0.0"), FriendlyName("xSPPasswordChangeSettings")] class MSFT_xSPPasswordChangeSettings : OMI_BaseResource { - [key] string MailAddress; - [Write] Uint32 DaysBeforeExpiry; - [Write] Uint32 PasswordChangeWaitTimeSeconds; - [Write] Uint32 NumberOfRetries; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [key, 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; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPQuotaTemplate/MSFT_xSPQuotaTemplate.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPQuotaTemplate/MSFT_xSPQuotaTemplate.schema.mof index 70186ee3b..464f24b3d 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPQuotaTemplate/MSFT_xSPQuotaTemplate.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPQuotaTemplate/MSFT_xSPQuotaTemplate.schema.mof @@ -20,11 +20,11 @@ These settings will be used to make sure a certain quota template exists or not. [ClassVersion("1.0.0.0"), FriendlyName("xSPQuotaTemplate")] class MSFT_xSPQuotaTemplate : OMI_BaseResource { - [Key] string Name; - [Write] uint32 StorageMaxInMB; - [Write] uint32 StorageWarningInMB; - [Write] uint32 MaximumUsagePointsSolutions; - [Write] uint32 WarningUsagePointsSolutions; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the quota template")] string Name; + [Write, Description("The maximum storage for sites of this template in MB")] uint32 StorageMaxInMB; + [Write, Description("The amount of storage for sites of this template that triggers a warning")] uint32 StorageWarningInMB; + [Write, Description("The maximum number of performance points for sandbox solutions for this template")] uint32 MaximumUsagePointsSolutions; + [Write, Description("The warning number of performance points for sandbox solutions for this template")] uint32 WarningUsagePointsSolutions; + [Required, Description("Present to create this template, absent to ensure it does not exist"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchIndexPartition/MSFT_xSPSearchIndexPartition.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchIndexPartition/MSFT_xSPSearchIndexPartition.schema.mof index f7565eb95..7a019f29a 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchIndexPartition/MSFT_xSPSearchIndexPartition.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchIndexPartition/MSFT_xSPSearchIndexPartition.schema.mof @@ -27,9 +27,9 @@ If no disk labeled I: was available on server1, this would fail, even though it [ClassVersion("1.0.0.0"), FriendlyName("xSPSearchIndexPartition")] class MSFT_xSPSearchIndexPartition : OMI_BaseResource { - [Key] Uint32 Index; - [Required] String Servers[]; - [Write] String RootDirectory; - [Required] String ServiceAppName; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The number of the partition in this farm")] Uint32 Index; + [Required, Description("A list of the servers that this partition should exist on")] String Servers[]; + [Write, Description("The directory that the index should use locally on each server to store data")] String RootDirectory; + [Required, Description("The name of the search service application")] String ServiceAppName; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 index ff62feb88..727647e94 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 @@ -8,6 +8,7 @@ function Get-TargetResource [parameter(Mandatory = $true)] [System.String] $ApplicationPool, [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DefaultContentAccessAccount, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) @@ -16,6 +17,11 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") + [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") + [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration") + [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") + [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { @@ -26,11 +32,18 @@ function Get-TargetResource If ($null -eq $serviceApp) { return $null } else { + $caWebApp = Get-SPWebApplication -IncludeCentralAdministration | where {$_.IsAdministrationWebApplication} + $s = Get-SPSite $caWebApp.Url + $c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s); + $sc = New-Object -TypeName Microsoft.Office.Server.Search.Administration.Content -ArgumentList $c; + $defaultAccount = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList @($sc.DefaultGatheringAccount, (ConvertTo-SecureString "-" -AsPlainText -Force)) + $returnVal = @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name DatabaseName = $serviceApp.Database.Name DatabaseServer = $serviceApp.Database.Server.Name + DefaultContentAccessAccount = $defaultAccount InstallAccount = $params.InstallAccount } return $returnVal @@ -49,6 +62,7 @@ function Set-TargetResource [parameter(Mandatory = $true)] [System.String] $ApplicationPool, [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DefaultContentAccessAccount, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $result = Get-TargetResource @PSBoundParameters @@ -58,27 +72,46 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - - if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - $serviceInstance = Get-SPEnterpriseSearchServiceInstance -Local - Start-SPEnterpriseSearchServiceInstance -Identity $serviceInstance -ErrorAction SilentlyContinue - $app = New-SPEnterpriseSearchServiceApplication @params + Start-SPEnterpriseSearchServiceInstance -Identity $serviceInstance -ErrorAction SilentlyContinue + $newParams = @{ + Name = $params.Name + ApplicationPool = $params.ApplicationPool + } + if ($params.ContainsKey("DatabaseServer") -eq $true) { $newParams.Add("DatabaseServer", $params.DatabaseServer) } + if ($params.ContainsKey("DatabaseName") -eq $true) { $newParams.Add("DatabaseName", $params.DatabaseName) } + $app = New-SPEnterpriseSearchServiceApplication @newParams if ($app) { New-SPEnterpriseSearchServiceApplicationProxy -Name "$($params.Name) Proxy" -SearchApplication $app + if ($params.ContainsKey("DefaultContentAccessAccount") -eq $true) { + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool + $setParams = @{ + ApplicationPool = $appPool + Identity = $app + DefaultContentAccessAccountName = $params.DefaultContentAccessAccount.UserName + DefaultContentAccessAccountPassword = (ConvertTo-SecureString -String $params.DefaultContentAccessAccount.GetNetworkCredential().Password -AsPlainText -Force) + } + Set-SPEnterpriseSearchServiceApplication @setParams + } } } } else { - if ([string]::IsNullOrEmpty($ApplicationPool) -eq $false -and $ApplicationPool -ne $result.ApplicationPool) { - Write-Verbose -Message "Updating Search Service Application $Name" - Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { - $params = $args[0] - - - $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Search Service Application" } - $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool - Set-SPEnterpriseSearchServiceApplication -Identity $serviceApp -ApplicationPool $appPool + Write-Verbose -Message "Updating Search Service Application $Name" + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Search Service Application" } + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool + $setParams = @{ + ApplicationPool = $appPool + Identity = $serviceApp } + if ($params.ContainsKey("DefaultContentAccessAccount") -eq $true) { + $setParams.Add("DefaultContentAccessAccountName", $params.DefaultContentAccessAccount.UserName) + $password = ConvertTo-SecureString -String $params.DefaultContentAccessAccount.GetNetworkCredential().Password -AsPlainText -Force + $setParams.Add("DefaultContentAccessAccountPassword", $password) + } + Set-SPEnterpriseSearchServiceApplication @setParams } } } @@ -94,12 +127,18 @@ function Test-TargetResource [parameter(Mandatory = $true)] [System.String] $ApplicationPool, [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DefaultContentAccessAccount, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing Search service application '$Name'" If ($null -eq $CurrentValues) { return $false } + if ($PSBoundParameters.ContainsKey("DefaultContentAccessAccount")) { + if ($DefaultContentAccessAccount.UserName -ne $CurrentValues.DefaultContentAccessAccount.UserName) { + return $false + } + } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.schema.mof index 3928e8293..ac5877127 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.schema.mof @@ -1,4 +1,4 @@ -/* +/* **Description** This resource is responsible for provisioning the search service application. @@ -19,10 +19,11 @@ The database name parameter is used as the prefix for all search databases (so y [ClassVersion("1.0.0.0"), FriendlyName("xSPSearchServiceApp")] class MSFT_xSPSearchServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] string ApplicationPool; - [Write] string DatabaseName; - [Write] string DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the search service application")] string Name; + [Required, Description("The application pool that it should run in")] string ApplicationPool; + [Write, Description("The name of the database (noting that some search databases will use this as a prefix)")] string DatabaseName; + [Write, Description("The server that host the databases for this service application")] string DatabaseServer; + [Write, Description("The default content access account for this search service app"), EmbeddedInstance("MSFT_Credential")] String DefaultContentAccessAccount; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchTopology/MSFT_xSPSearchTopology.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchTopology/MSFT_xSPSearchTopology.schema.mof index 50fc83cca..92332a921 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchTopology/MSFT_xSPSearchTopology.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchTopology/MSFT_xSPSearchTopology.schema.mof @@ -30,13 +30,13 @@ If no disk labeled I: was available on server1, this would fail, even though it [ClassVersion("1.0.0.0"), FriendlyName("xSPSearchTopology")] class MSFT_xSPSearchTopology : OMI_BaseResource { - [Key] String ServiceAppName; - [Required] String Admin[]; - [Required] String Crawler[]; - [Required] String ContentProcessing[]; - [Required] String AnalyticsProcessing[]; - [Required] String QueryProcessing[]; - [Required] String IndexPartition[]; - [Required] String FirstPartitionDirectory; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the search service application for this topology")] String ServiceAppName; + [Required, Description("A list of servers that will run the admin component")] String Admin[]; + [Required, Description("A list of servers that will run the crawler component")] String Crawler[]; + [Required, Description("A list of servers that will run the content processing component")] String ContentProcessing[]; + [Required, Description("A list of servers that will run the analytics processing component")] String AnalyticsProcessing[]; + [Required, Description("A list of servers that will run the query processing component")] String QueryProcessing[]; + [Required, Description("A list of servers that will host the first (0) index partition")] String IndexPartition[]; + [Required, Description("The local directory servers will use to store the first index partition")] String FirstPartitionDirectory; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.schema.mof index a96db36b5..95e417c1f 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.schema.mof @@ -19,17 +19,17 @@ The parameters passed in (except those related to database specifics) are valida [ClassVersion("1.0.0.0"), FriendlyName("xSPSecureStoreServiceApp")] class MSFT_xSPSecureStoreServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] string ApplicationPool; - [Required] boolean AuditingEnabled; - [Write] uint32 AuditlogMaxSize; - [Write, EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; - [Write] string DatabaseName; - [Write] string DatabaseServer; - [Write, ValueMap{"Windows","SQL"}, Values{"Windows","SQL"}] string DatabaseAuthenticationType; - [Write] string FailoverDatabaseServer; - [Write] boolean PartitionMode; - [Write] boolean Sharing; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the secure store service app")] string Name; + [Required, Description("The name of the application pool it will run in")] string ApplicationPool; + [Required, Description("Is auditing enabled for this service app")] boolean AuditingEnabled; + [Write, Description("What is the maximum size of the audit log in MB")] uint32 AuditlogMaxSize; + [Write, Description("What SQL credentials should be used to access the database"), EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; + [Write, Description("The name of the database for the service app")] string DatabaseName; + [Write, Description("The name of the database server to host the database")] string DatabaseServer; + [Write, Description("What type of authentication should be used to access the database"), ValueMap{"Windows","SQL"}, Values{"Windows","SQL"}] string DatabaseAuthenticationType; + [Write, Description("The name of the database server hosting a failover instance of the database")] string FailoverDatabaseServer; + [Write, Description("Is partition mode enabled for this service app")] boolean PartitionMode; + [Write, Description("Is sharing enabled for this service app")] boolean Sharing; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.schema.mof index 6af668629..3a61efad2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.schema.mof @@ -16,8 +16,8 @@ The account used for the service account must already be registered as a managed [ClassVersion("1.0.0.0"), FriendlyName("xSPServiceAppPool")] class MSFT_xSPServiceAppPool : OMI_BaseResource { - [Key] string Name; - [Required] string ServiceAccount; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of application pool")] string Name; + [Required, Description("The name of the managed account to run this service account as")] string ServiceAccount; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.schema.mof index 20166fd82..e30511e9c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.schema.mof @@ -23,7 +23,7 @@ The name is the display name of the service as shown in the Central Admin websit [ClassVersion("1.0.0.0"), FriendlyName("xSPServiceInstance")] class MSFT_xSPServiceInstance : OMI_BaseResource { - [Key] string Name; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Key, Description("The name of the service instance to manage")] string Name; + [Required, Description("Present to ensure it runs on this server, or absent to ensure it is stopped"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSessionStateService/MSFT_xSPSessionStateService.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSessionStateService/MSFT_xSPSessionStateService.schema.mof index 95597c31d..1c202258e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSessionStateService/MSFT_xSPSessionStateService.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSessionStateService/MSFT_xSPSessionStateService.schema.mof @@ -18,10 +18,10 @@ If session timeout is not provided it will default to 60. [ClassVersion("1.0.0.0"), FriendlyName("xSPSessionStateService")] class MSFT_xSPSessionStateService : OMI_BaseResource { - [Key] string DatabaseName; - [Key] string DatabaseServer; - [Required, Write] boolean Enabled; - [Write] uint32 SessionTimeout; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the database for the service")] string DatabaseName; + [Key, Description("The name of the database server for the database")] string DatabaseServer; + [Required, Description("Is the state service enabled")] boolean Enabled; + [Write, Description("What is the timeout on sessions")] uint32 SessionTimeout; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPShellAdmins/MSFT_xSPShellAdmins.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPShellAdmins/MSFT_xSPShellAdmins.schema.mof index 5964bf97d..7944c5d62 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPShellAdmins/MSFT_xSPShellAdmins.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPShellAdmins/MSFT_xSPShellAdmins.schema.mof @@ -60,6 +60,6 @@ class MSFT_xSPShellAdmins : OMI_BaseResource [Write, Description("List of all accounts that are not allowed to have Shell Admin permissions")] String MembersToExclude[]; [Write, Description("Shell Admin configuration of Content Databases"), EmbeddedInstance("MSFT_xSPContentDatabasePermissions")] String ContentDatabases[]; [Write, Description("Specify if all content databases must get the same config as the general config")] Boolean AllContentDatabases; - [Write, Description("The account under which the resource has to run, required for PowerShell v4"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.schema.mof index c15fdf69c..c943946b6 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.schema.mof @@ -21,19 +21,19 @@ The current version of xSharePoint is only able to check for the existence of a [ClassVersion("1.0.0.0"), FriendlyName("xSPSite")] class MSFT_xSPSite : OMI_BaseResource { - [Key] string Url; - [Required] string OwnerAlias; - [Write] uint32 CompatibilityLevel; - [Write] string ContentDatabase; - [Write] string Description; - [Write] string HostHeaderWebApplication; - [Write] uint32 Language; - [Write] string Name; - [Write] string OwnerEmail; - [Write] string QuotaTemplate; - [Write] string SecondaryEmail; - [Write] string SecondaryOwnerAlias; - [Write] string Template; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The URL of the site collection")] string Url; + [Required, Description("The username of the site collection administrator")] string OwnerAlias; + [Write, Description("The compatibility level of the site")] uint32 CompatibilityLevel; + [Write, Description("The name of the content database to create the site in")] string ContentDatabase; + [Write, Description("The description to apply to the site collection")] string Description; + [Write, Description("The URL of the host header web application to create this site in")] string HostHeaderWebApplication; + [Write, Description("The language code of the site")] uint32 Language; + [Write, Description("The display name of the site collection")] string Name; + [Write, Description("The email address of the site collection administrator")] string OwnerEmail; + [Write, Description("The quota template to apply to the site collection")] string QuotaTemplate; + [Write, Description("The secondary site collection admin email address")] string SecondaryEmail; + [Write, Description("The secondary site collection admin username")] string SecondaryOwnerAlias; + [Write, Description("The template to apply to the site collection")] string Template; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof index 771f73a26..31fee06bd 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof @@ -16,9 +16,9 @@ The database specific parameters are only used during initial provisioning of th [ClassVersion("1.0.0.0"), FriendlyName("xSPStateServiceApp")] class MSFT_xSPStateServiceApp : OMI_BaseResource { - [Key] string Name; - [Write, EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; - [Required] string DatabaseName; - [Write] string DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the state service app")] string Name; + [Write, Description("The database credentials for accessing the database"), EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; + [Required, Description("The name of the database for the service app")] string DatabaseName; + [Write, Description("The name of the database server")] string DatabaseServer; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSubscriptionSettingsServiceApp/MSFT_xSPSubscriptionSettingsServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPSubscriptionSettingsServiceApp/MSFT_xSPSubscriptionSettingsServiceApp.schema.mof index 02c4a79e5..195ab1524 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSubscriptionSettingsServiceApp/MSFT_xSPSubscriptionSettingsServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSubscriptionSettingsServiceApp/MSFT_xSPSubscriptionSettingsServiceApp.schema.mof @@ -19,10 +19,10 @@ Database names or server name will not be changed if the configuration does not [ClassVersion("1.0.0.0"), FriendlyName("xSPSubscriptionSettingsServiceApp")] class MSFT_xSPSubscriptionSettingsServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] String ApplicationPool; - [Write] string DatabaseName; - [Write] String DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the subscription settings service app")] string Name; + [Required, Description("The name of the application pool the service app runs in")] String ApplicationPool; + [Write, Description("The name of the database for the service app")] string DatabaseName; + [Write, Description("The name of the database server")] String DatabaseServer; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPTimerJobState/MSFT_xSPTimerJobState.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPTimerJobState/MSFT_xSPTimerJobState.schema.mof index d24f98108..ce25b8594 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPTimerJobState/MSFT_xSPTimerJobState.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPTimerJobState/MSFT_xSPTimerJobState.schema.mof @@ -31,10 +31,10 @@ Use "Get-SPTimerJob -WebApplication "http://servername" | select Name, DisplayNa [ClassVersion("1.0.0.0"), FriendlyName("xSPTimerJobState")] class MSFT_xSPTimerJobState : OMI_BaseResource { - [Key] String Name; - [Write] String WebApplication; - [Write] Boolean Enabled; - [Write] String Schedule; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The internal name of the timer job (not the display name)")] String Name; + [Write, Description("The name of the web application that the timer job belongs to")] String WebApplication; + [Write, Description("Should the timer job be enabled or not")] Boolean Enabled; + [Write, Description("The schedule for the timer job to execute on")] String Schedule; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.schema.mof index 9b8c513e6..7dad5c78c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.schema.mof @@ -19,14 +19,14 @@ The database settings are only used for initial provisioning, but the usage sett [ClassVersion("1.0.0.0"), FriendlyName("xSPUsageApplication")] class MSFT_xSPUsageApplication : OMI_BaseResource { - [Key] string Name; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Write] string DatabaseName; - [Write] string DatabaseServer; - [Write, EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; - [Write] string FailoverDatabaseServer; - [Write] uint32 UsageLogCutTime; - [Write] string UsageLogLocation; - [Write] uint32 UsageLogMaxFileSizeKB; - [Write] uint32 UsageLogMaxSpaceGB; + [Key, Description("The name of the service application")] string Name; + [Write, Description("The name of the database for the service app")] string DatabaseName; + [Write, Description("The name of the database server")] string DatabaseServer; + [Write, Description("The credentials to use to access the database"), EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; + [Write, Description("The name of the failover database server")] string FailoverDatabaseServer; + [Write, Description("The time in minutes to cut over to new log files")] uint32 UsageLogCutTime; + [Write, Description("The location on each server to store the log files")] string UsageLogLocation; + [Write, Description("The maximum file size for log files in KB")] uint32 UsageLogMaxFileSizeKB; + [Write, Description("The total space of all log files on disk in GB")] uint32 UsageLogMaxSpaceGB; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileProperty/MSFT_xSPUserProfileProperty.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileProperty/MSFT_xSPUserProfileProperty.schema.mof index bfc1c65a1..4dc2b5167 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileProperty/MSFT_xSPUserProfileProperty.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileProperty/MSFT_xSPUserProfileProperty.schema.mof @@ -45,31 +45,28 @@ xSPUserProfileProperty WorkEmailProperty [ClassVersion("1.0.0.0"), FriendlyName("xSPUserProfileProperty")] class MSFT_xSPUserProfileProperty : OMI_BaseResource { - [Key] string Name ; - [write, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; - [required] string UserProfileService; - [write] string DisplayName ; - [write, ValueMap{"BigInteger","Binary","Boolean","Date","DateNoYear","DateTime","Email","Float","Guid","HTML","Integer","Person","String","StringMultiValue","TimeZone","URL"}, Values{"BigInteger","Binary","Boolean","Date","DateNoYear","DateTime","Email","Float","Guid","HTML","Integer","Person","String","StringMultiValue","TimeZone","URL"}] string Type; - [write] string Description ; - [write, ValueMap{"Mandatory","Optin","Optout","Disabled"}, Values{"Mandatory","Optin","Optout","Disabled"}] string PolicySetting; - [write, ValueMap{"Public","Contacts","Organization","Manager","Private"}, Values{"Public","Contacts","Organization","Manager","Private"}] string PrivacySetting ; - [write] string MappingConnectionName ; - [write] string MappingPropertyName ; - [write] string MappingDirection ; - [write] uint32 Length ; - [write] uint32 DisplayOrder; - [write] boolean IsEventLog ; - [write] boolean IsVisibleOnEditor; - [write] boolean IsVisibleOnViewer; - [write] boolean IsUserEditable ; - [write] boolean IsAlias; - [write] boolean IsSearchable; - [write] boolean UserOverridePrivacy ; - [write] string TermStore ; - [write] string TermGroup; - [write] string TermSet; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The internal name of the user profile property")] string Name; + [Write, Description("Present if the property should exist, absent if it should be removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Required, Description("The name of the user profile service application")] string UserProfileService; + [Write, Description("The display name of the property")] string DisplayName; + [Write, Description("The type of the property"), ValueMap{"BigInteger","Binary","Boolean","Date","DateNoYear","DateTime","Email","Float","Guid","HTML","Integer","Person","String","StringMultiValue","TimeZone","URL"}, Values{"BigInteger","Binary","Boolean","Date","DateNoYear","DateTime","Email","Float","Guid","HTML","Integer","Person","String","StringMultiValue","TimeZone","URL"}] string Type; + [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 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; + [Write, Description("Is this field visible when editing a users profile, or hidden from editing")] boolean IsVisibleOnEditor; + [Write, Description("Is this field visible when viewing a users profile")] boolean IsVisibleOnViewer; + [Write, Description("Is this field able to be edited by a user, or only an administrator")] boolean IsUserEditable; + [Write, Description("Is this field an alias that can be used to refer to a user by")] boolean IsAlias; + [Write, Description("Is this field able to be searched upon")] boolean IsSearchable; + [Write, Description("Can users override the default privacy policy")] boolean UserOverridePrivacy; + [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 PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; - - - diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.schema.mof index c64f0ce4e..0417a87a0 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.schema.mof @@ -26,15 +26,15 @@ This is done to ensure that the databases are created with the correct schema ow [ClassVersion("1.0.0.0"), FriendlyName("xSPUserProfileServiceApp")] class MSFT_xSPUserProfileServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] string ApplicationPool; - [Required, EmbeddedInstance("MSFT_Credential")] String FarmAccount; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Write] string MySiteHostLocation; - [Write] string ProfileDBName; - [Write] string ProfileDBServer; - [Write] string SocialDBName; - [Write] string SocialDBServer; - [Write] string SyncDBName; - [Write] string SyncDBServer; + [Key, Description("The name of the user profile service")] string Name; + [Required, Description("The name of the application pool to run the service app in")] string ApplicationPool; + [Required, Description("The farm account to use when provisioning the app"), EmbeddedInstance("MSFT_Credential")] String FarmAccount; + [Write, Description("The URL of the my site host collection")] string MySiteHostLocation; + [Write, Description("The name of the profile database")] string ProfileDBName; + [Write, Description("The name of the server to host the profile database")] string ProfileDBServer; + [Write, Description("The name of the social database")] string SocialDBName; + [Write, Description("The name of the database server to host the social database")] string SocialDBServer; + [Write, Description("The name of the sync database")] string SyncDBName; + [Write, Description("The name of the database server to host the sync database")] string SyncDBServer; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.psm1 index 5241db9cd..c5ece6449 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.psm1 @@ -31,10 +31,7 @@ function Get-TargetResource } else { - - $caURL = (Get-SpWebApplication -IncludeCentralAdministration | ?{$_.IsAdministrationWebApplication -eq $true }).Url - $context = Get-SPServiceContext -Site $caURL - + $context = Get-xSharePointServiceContext -ProxyGroup $ups.ServiceApplicationProxyGroup $upcm = New-Object -TypeName Microsoft.Office.Server.UserProfiles.UserProfileConfigManager $context $connection = $upcm.ConnectionManager | Where-Object { $_.DisplayName -eq $params.Name} @@ -85,111 +82,108 @@ function Set-TargetResource Write-Verbose -Message "Creating user profile service application $Name" - $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { - $params = $args[0] + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] - - if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - $ups = Get-SPServiceApplication -Name $params.UserProfileService -ErrorAction SilentlyContinue + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } + $ups = Get-SPServiceApplication -Name $params.UserProfileService -ErrorAction SilentlyContinue - if ($null -eq $ups) { - throw "User Profile Service Application $($params.UserProfileService) not found" - } - $caURL = (Get-SpWebApplication -IncludeCentralAdministration | ?{$_.IsAdministrationWebApplication -eq $true }).Url - $context = Get-SPServiceContext -Site $caURL + if ($null -eq $ups) { + throw "User Profile Service Application $($params.UserProfileService) not found" + } + $context = Get-xSharePointServiceContext -ProxyGroup $ups.ServiceApplicationProxyGroup - Write-Verbose -Message "retrieving UserProfileConfigManager " - $upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager $context + Write-Verbose -Message "retrieving UserProfileConfigManager " + $upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager $context - if($upcm.IsSynchronizationRunning()) - { - throw "Synchronization is in Progress." - } - - $securePassword = ConvertTo-SecureString $params.ConnectionCredentials.GetNetworkCredential().password -AsPlainText -Force - $connection = $upcm.ConnectionManager | Where-Object { $_.DisplayName -eq $params.Name} | select -first 1 - if($connection -ne $null -and $params.Forest -ieq $connection.Server) - { - $domain = $params.ConnectionCredentials.UserName.Split("\")[0] - $userName= $params.ConnectionCredentials.UserName.Split("\")[1] - $connection.SetCredentials($domain, $userName, $securePassword); - - $connection.NamingContexts | %{ - $namingContext = $_ - if($params.ContainsKey("IncludedOUs")){ - $namingContext.ContainersIncluded.Clear() - $params.IncludedOUs| %{$namingContext.ContainersIncluded.Add($_) } - } - $namingContext.ContainersExcluded.Clear() - if($params.ContainsKey("ExcludedOUs")){ - $params.IncludedOUs| %{$namingContext.ContainersExcluded.Add($_) } - } + if($upcm.IsSynchronizationRunning()) + { + throw "Synchronization is in Progress." } - $connection.Update(); - $connection.RefreshSchema($securePassword); - - return; - }else{ - Write-Verbose -Message "creating a new connection " - if($connection -ne $null -and $params.Forest -ine $connection.Server){ - if($params.ContainsKey("Force") -and $params.Force -eq $true){ - $connection.Delete(); - }else{ - throw "connection exists and forest is different. use force " + $securePassword = ConvertTo-SecureString $params.ConnectionCredentials.GetNetworkCredential().password -AsPlainText -Force + $connection = $upcm.ConnectionManager | Where-Object { $_.DisplayName -eq $params.Name} | select -first 1 + if($connection -ne $null -and $params.Forest -ieq $connection.Server) + { + $domain = $params.ConnectionCredentials.UserName.Split("\")[0] + $userName= $params.ConnectionCredentials.UserName.Split("\")[1] + $connection.SetCredentials($domain, $userName, $securePassword); + + $connection.NamingContexts | %{ + $namingContext = $_ + if($params.ContainsKey("IncludedOUs")){ + $namingContext.ContainersIncluded.Clear() + $params.IncludedOUs| %{$namingContext.ContainersIncluded.Add($_) } + } + $namingContext.ContainersExcluded.Clear() + if($params.ContainsKey("ExcludedOUs")){ + $params.IncludedOUs| %{$namingContext.ContainersExcluded.Add($_) } + } } + $connection.Update(); + $connection.RefreshSchema($securePassword); - } + return; + } else { + Write-Verbose -Message "creating a new connection " + if($connection -ne $null -and $params.Forest -ine $connection.Server){ + if($params.ContainsKey("Force") -and $params.Force -eq $true){ + $connection.Delete(); + }else{ + throw "connection exists and forest is different. use force " + } + + } - $servers = New-Object System.Collections.Generic.List[[System.String]] - if($params.ContainsKey("Server")){ - $servers.add($params.Server) - } - $listIncludedOUs = New-Object System.Collections.Generic.List[[System.String]] - $params.IncludedOUs | %{ - $listIncludedOUs.Add($_) - } + $servers = New-Object System.Collections.Generic.List[[System.String]] + if($params.ContainsKey("Server")){ + $servers.add($params.Server) + } + $listIncludedOUs = New-Object System.Collections.Generic.List[[System.String]] + $params.IncludedOUs | %{ + $listIncludedOUs.Add($_) + } - $listExcludedOUs = New-Object System.Collections.Generic.List[[System.String]] - if($params.ContainsKey("ExcludedOus")){ - $params.ExcludedOus | %{$listExcludedOUs.Add($_) } - } - $list = New-Object System.Collections.Generic.List[[Microsoft.Office.Server.UserProfiles.DirectoryServiceNamingContext]] - - $partition = [ADSI]("LDAP://" +("DC=" + $params.Forest.Replace(".", ",DC="))) - $list.Add((New-Object Microsoft.Office.Server.UserProfiles.DirectoryServiceNamingContext ( - $partition.distinguishedName, - $params.Forest, - $false, - (New-Object Guid($partition.objectGUID)) , - $listIncludedOUs , - $listExcludedOUs , - $null , - $false))) - $partition = [ADSI]("LDAP://CN=Configuration," +("DC=" + $params.Forest.Replace(".", ",DC="))) - $list.Add((New-Object Microsoft.Office.Server.UserProfiles.DirectoryServiceNamingContext ( - $partition.distinguishedName, - $params.Forest, - $true, - (New-Object Guid($partition.objectGUID)) , - $listIncludedOUs , - $listExcludedOUs , - $null , - $false))) - - $userDomain = $params.ConnectionCredentials.UserName.Split("\")[0] - $userName= $params.ConnectionCredentials.UserName.Split("\")[1] - - $newUPSADConnection = $upcm.ConnectionManager.AddActiveDirectoryConnection( [Microsoft.Office.Server.UserProfiles.ConnectionType]::ActiveDirectory, ` - $params.Name, ` - $params.Forest, ` - $params.UseSSL, ` - $userDomain, ` - $userName, ` - $securePassword, ` - $list, ` - $null,` - $null) + $listExcludedOUs = New-Object System.Collections.Generic.List[[System.String]] + if($params.ContainsKey("ExcludedOus")){ + $params.ExcludedOus | %{$listExcludedOUs.Add($_) } + } + $list = New-Object System.Collections.Generic.List[[Microsoft.Office.Server.UserProfiles.DirectoryServiceNamingContext]] + + $partition = [ADSI]("LDAP://" +("DC=" + $params.Forest.Replace(".", ",DC="))) + $list.Add((New-Object Microsoft.Office.Server.UserProfiles.DirectoryServiceNamingContext ( + $partition.distinguishedName, + $params.Forest, + $false, + (New-Object Guid($partition.objectGUID)) , + $listIncludedOUs , + $listExcludedOUs , + $null , + $false))) + $partition = [ADSI]("LDAP://CN=Configuration," +("DC=" + $params.Forest.Replace(".", ",DC="))) + $list.Add((New-Object Microsoft.Office.Server.UserProfiles.DirectoryServiceNamingContext ( + $partition.distinguishedName, + $params.Forest, + $true, + (New-Object Guid($partition.objectGUID)) , + $listIncludedOUs , + $listExcludedOUs , + $null , + $false))) + + $userDomain = $params.ConnectionCredentials.UserName.Split("\")[0] + $userName= $params.ConnectionCredentials.UserName.Split("\")[1] + + $newUPSADConnection = $upcm.ConnectionManager.AddActiveDirectoryConnection( [Microsoft.Office.Server.UserProfiles.ConnectionType]::ActiveDirectory, ` + $params.Name, ` + $params.Forest, ` + $params.UseSSL, ` + $userDomain, ` + $userName, ` + $securePassword, ` + $list, ` + $null,` + $null) } } } @@ -218,17 +212,12 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for user profile service sync connection $Name" if ($null -eq $CurrentValues) { return $false } - if( $Force -eq $true) + if($Force -eq $true) { return $false - } - - return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name", "Forest", "UserProfileService", "Server", "UseSSL","IncludedOUs", "ExcludedOUs" ) - - + } + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name", "Forest", "UserProfileService", "Server", "UseSSL","IncludedOUs", "ExcludedOUs" ) } - - Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.schema.mof index f380273a9..7554e0769 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncConnection/MSFT_xSPUserProfileSyncConnection.schema.mof @@ -23,16 +23,15 @@ This resource currently supports AD only. [ClassVersion("1.0.0.0"), FriendlyName("xSPUserProfileSyncConnection")] class MSFT_xSPUserProfileSyncConnection : OMI_BaseResource { - [Key] string Name; - [Required] string Forest; - [Required] string UserProfileService; - [Required, EmbeddedInstance("MSFT_Credential")] string ConnectionCredentials; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; - [Required] string IncludedOUs[]; - [write] string ExcludedOUs[]; - [write] string Server; - [Write] boolean UseSSL; - [Write] boolean Force; - [Write, ValueMap{"ActiveDirectory","BusinessDataCatalog"}, Values{"ActiveDirectory","BusinessDataCatalog"}] string ConnectionType ; + [Key, Description("The name of the connection")] string Name; + [Required, Description("The name of the AD forest to read from")] string Forest; + [Required, Description("The name of the user profile service that this connection is attached to")] string UserProfileService; + [Required, Description("The credentials to connect to Active Directory with"), EmbeddedInstance("MSFT_Credential")] string ConnectionCredentials; + [Required, Description("A listo f the OUs to import users from")] string IncludedOUs[]; + [Write, Description("A list of the OUs to ignore users from")] string ExcludedOUs[]; + [Write, Description("The specific AD server to connect to")] string Server; + [Write, Description("Should SSL be used for the connection")] boolean UseSSL; + [Write, Description("Set to true to run the set method on every call to this resource")] boolean Force; + [Write, Description("The type of the connection - currently only Active Directory is supported"), ValueMap{"ActiveDirectory","BusinessDataCatalog"}, Values{"ActiveDirectory","BusinessDataCatalog"}] string ConnectionType; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; - diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.schema.mof index f92ad42a3..8c52db86d 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.schema.mof @@ -19,8 +19,8 @@ Therefore this resource will add the FarmAccount credential to the local adminis [ClassVersion("1.0.0.0"), FriendlyName("xSPUserProfileSyncService")] class MSFT_xSPUserProfileSyncService : OMI_BaseResource { - [Key] string UserProfileServiceAppName; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; - [Required, EmbeddedInstance("MSFT_Credential")] String FarmAccount; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The name of the user profile service for this sync instance")] string UserProfileServiceAppName; + [Required, Description("Present to ensure the service is running, absent to ensure it is not"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Required, Description("The farm account, which is needed to provision the service app"), EmbeddedInstance("MSFT_Credential")] String FarmAccount; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPVisioServiceApp/MSFT_xSPVisioServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPVisioServiceApp/MSFT_xSPVisioServiceApp.schema.mof index 6dff9888b..dcf08c178 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPVisioServiceApp/MSFT_xSPVisioServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPVisioServiceApp/MSFT_xSPVisioServiceApp.schema.mof @@ -13,6 +13,6 @@ The resource will provision and configure the Visio Graphics Service Application [ClassVersion("1.0.0.0"), FriendlyName("xSPVisioServiceApp")] class MSFT_xSPVisioServiceApp : OMI_BaseResource { - [Key] string Name; - [Required] string ApplicationPool; + [Key, Description("The name of the service application")] string Name; + [Required, Description("The name of the application pool to run the service app in")] string ApplicationPool; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof index 3621a6468..79aa5ee13 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppBlockedFileTypes/MSFT_xSPWebAppBlockedFileTypes.schema.mof @@ -2,9 +2,9 @@ **Description** This resource is responsible for controlling the blocked file type setting on a specific web application. -It has two modes of operation, the first is to use the 'blocked' property, where you are able to define a specific list of file types that will be blocked. +It has two modes of operation, the first is to use the "blocked" property, where you are able to define a specific list of file types that will be blocked. In this mode when it is detected that the list does not match the local farm, it is set to match this list exactly. -The second mode is to use the 'EnsureBlocked' and 'EnsureAllowed' properties. +The second mode is to use the "EnsureBlocked" and "EnsureAllowed" properties. EnsureBlocked will check to make sure that the specified file types are on the list, and if not they will be added. EnsureAllowed checks to make sure that a file type is not on the list, and if it is it will be removed. Both of these properties will only make changes to the file types in their list and will leave the full list as it is otherwise, whereas the blocked property resets the list in full. @@ -22,9 +22,9 @@ Both of these properties will only make changes to the file types in their list [ClassVersion("1.0.0"), FriendlyName("xSPWebAppBlockedFileTypes")] Class MSFT_xSPWebAppBlockedFileTypes : OMI_BaseResource { - [Key] string Url; - [write] string Blocked[]; - [write] string EnsureBlocked[]; - [write] string EnsureAllowed[]; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Key, Description("The URL of the web application to set blocked file types for")] string Url; + [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[]; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof index f6e535682..eb4ad63ec 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppGeneralSettings/MSFT_xSPWebAppGeneralSettings.schema.mof @@ -19,21 +19,21 @@ Any settings not included will be left as the default (or whatever they have bee [ClassVersion("1.0.0"), FriendlyName("xSPWebAppGeneralSettings")] Class MSFT_xSPWebAppGeneralSettings : OMI_BaseResource { - [Key] string Url; - [write] uint32 TimeZone; - [write] boolean Alerts; - [write] uint32 AlertsLimit; - [write] boolean RSS; - [write] boolean BlogAPI; - [write] boolean BlogAPIAuthenticated; - [write, ValueMap{"Strict","Permissive"}, Values{"Stric","Permissive"}] String BrowserFileHandling; - [write] boolean SecurityValidation; - [write] boolean RecycleBinEnabled; - [write] boolean RecycleBinCleanupEnabled; - [write] uint32 RecycleBinRetentionPeriod; - [write] uint32 SecondStageRecycleBinQuota; - [write] uint32 MaximumUploadSize; - [write] boolean CustomerExperienceProgram; - [write] boolean PresenceEnabled; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Key, Description("The URL of the web app to set the general settings for")] string Url; + [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; + [Write, Description("Should RSS feeds be enabled in this web app")] boolean RSS; + [Write, Description("Should the Blog API be enabled in this web app")] boolean BlogAPI; + [Write, Description("Is authentication required for the blog API")] boolean BlogAPIAuthenticated; + [Write, Description("What file handling mode should be used in this web app - strict or permissive"), ValueMap{"Strict","Permissive"}, Values{"Stric","Permissive"}] String BrowserFileHandling; + [Write, Description("Is security validation enforced in this web app")] boolean SecurityValidation; + [Write, Description("Is the recycle bin enabled in this web application")] boolean RecycleBinEnabled; + [Write, Description("Is automatic cleanup of the recycle bin enabled in this web app")] boolean RecycleBinCleanupEnabled; + [Write, Description("How many days does the recycle bin keep content for")] uint32 RecycleBinRetentionPeriod; + [Write, Description("How much content does the second stage recycle bin keep content for")] uint32 SecondStageRecycleBinQuota; + [Write, Description("What is the maximum file upload size for this web app (in MB)")] uint32 MaximumUploadSize; + [Write, Description("Should the customer experience program be enabled in this web app")] boolean CustomerExperienceProgram; + [Write, Description("Is Skype for Business presence enabled for this web app")] boolean PresenceEnabled; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppPolicy/MSFT_xSPWebAppPolicy.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppPolicy/MSFT_xSPWebAppPolicy.schema.mof index ed1cf0d24..f5d7674e7 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppPolicy/MSFT_xSPWebAppPolicy.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppPolicy/MSFT_xSPWebAppPolicy.schema.mof @@ -16,10 +16,10 @@ This resource is used to set the "super user" and "super reader" cache accounts [ClassVersion("1.0.0.0"), FriendlyName("xSPWebAppPolicy")] class MSFT_xSPWebAppPolicy : OMI_BaseResource { - [Key] string WebAppUrl; - [Key] string UserName; - [Required, ValueMap{"Deny All","Deny Write","Full Read","Full Control"}, Values{"Deny All","Deny Write","Full Read","Full Control"}] string PermissionLevel; - [Write] boolean ActAsSystemUser; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The URL of the web application")] string WebAppUrl; + [Key, Description("The username for the policy")] string UserName; + [Required, Description("The policy to apply"), ValueMap{"Deny All","Deny Write","Full Read","Full Control"}, Values{"Deny All","Deny Write","Full Read","Full Control"}] string PermissionLevel; + [Write, Description("Should this user be treated as a system account")] boolean ActAsSystemUser; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppSiteUseAndDeletion/MSFT_xSPWebAppSiteUseAndDeletion.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppSiteUseAndDeletion/MSFT_xSPWebAppSiteUseAndDeletion.schema.mof index b88df2857..5416155e6 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppSiteUseAndDeletion/MSFT_xSPWebAppSiteUseAndDeletion.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppSiteUseAndDeletion/MSFT_xSPWebAppSiteUseAndDeletion.schema.mof @@ -20,10 +20,10 @@ You can enable or disable the Site Use and Deletion feature, specify the amount [ClassVersion("1.0.0"), FriendlyName("xSPWebAppSiteUseAndDeletion")] Class MSFT_xSPWebAppSiteUseAndDeletion : OMI_BaseResource { - [Key] string Url; - [write] boolean SendUnusedSiteCollectionNotifications; - [write] uint32 UnusedSiteNotificationPeriod; - [write] boolean AutomaticallyDeleteUnusedSiteCollections; - [write] uint32 UnusedSiteNotificationsBeforeDeletion; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Key, Description("The URL of the web application")] string Url; + [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; + [Write, Description("How many days before an unused site is deleted should an email be sent to the owner")] uint32 UnusedSiteNotificationsBeforeDeletion; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof index e7673af15..55f608644 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppThrottlingSettings/MSFT_xSPWebAppThrottlingSettings.schema.mof @@ -34,17 +34,17 @@ You can specify the start time of this window as well as how many hours it will [ClassVersion("1.0.0"), FriendlyName("xSPWebAppThrottlingSettings")] Class MSFT_xSPWebAppThrottlingSettings : OMI_BaseResource { - [Key] string Url; - [write] uint32 ListViewThreshold; - [write] boolean AllowObjectModelOverride; - [write] uint32 AdminThreshold; - [write] uint32 ListViewLookupThreshold; - [write] boolean HappyHourEnabled; - [Write, EmbeddedInstance("MSFT_xSPWebApplicationHappyHour")] string HappyHour; - [write] uint32 UniquePermissionThreshold; - [write] boolean RequestThrottling; - [write] boolean ChangeLogEnabled; - [write] uint32 ChangeLogExpiryDays; - [write] boolean EventHandlersEnabled; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Key, Description("The URL of the web application")] string Url; + [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("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; + [Write, Description("The time window for happy hour"), EmbeddedInstance("MSFT_xSPWebApplicationHappyHour")] string HappyHour; + [Write, Description("What is the limit for unique permissions on a single object in this web app")] uint32 UniquePermissionThreshold; + [Write, Description("Is request throttling enabled on this web app")] boolean RequestThrottling; + [Write, Description("Is the change log enabled for this web app")] boolean ChangeLogEnabled; + [Write, Description("How many days does the change log store data for")] uint32 ChangeLogExpiryDays; + [Write, Description("Are event handlers enabled in the web application")] boolean EventHandlersEnabled; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; \ No newline at end of file diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof index 4dfa86c7f..1d218de73 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebAppWorkflowSettings/MSFT_xSPWebAppWorkflowSettings.schema.mof @@ -18,9 +18,9 @@ Any settings not included will be left as the default (or whatever they have bee [ClassVersion("1.0.0"), FriendlyName("xSPWebAppWorkflowSettings")] Class MSFT_xSPWebAppWorkflowSettings : OMI_BaseResource { - [Key] string Url; - [write] boolean ExternalWorkflowParticipantsEnabled; - [write] boolean UserDefinedWorkflowsEnabled; - [write] boolean EmailToNoPermissionWorkflowParticipantsEnable; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; -}; \ No newline at end of file + [Key, Description("The URL of the web application")] string Url; + [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; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; +}; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index 1aaffa8cc..af3b0d9db 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -14,6 +14,7 @@ function Get-TargetResource [parameter(Mandatory = $false)] [System.String] $HostHeader, [parameter(Mandatory = $false)] [System.String] $Path, [parameter(Mandatory = $false)] [System.String] $Port, + [parameter(Mandatory = $false)] [System.Boolean] $UseSSL, [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) @@ -42,6 +43,7 @@ function Get-TargetResource Path = $wa.IisSettings[0].Path Port = (New-Object System.Uri $wa.Url).Port AuthenticationMethod = $localAuthMode + UseSSL = (New-Object System.Uri $wa.Url).Scheme -eq "https" InstallAccount = $params.InstallAccount } } @@ -64,6 +66,7 @@ function Set-TargetResource [parameter(Mandatory = $false)] [System.String] $HostHeader, [parameter(Mandatory = $false)] [System.String] $Path, [parameter(Mandatory = $false)] [System.String] $Port, + [parameter(Mandatory = $false)] [System.Boolean] $UseSSL, [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) @@ -83,20 +86,21 @@ function Set-TargetResource } if ($params.ContainsKey("AuthenticationMethod") -eq $true) { if ($params.AuthenticationMethod -eq "NTLM") { - $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos + $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos:$true } else { - $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication + $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos:$false } $newWebAppParams.Add("AuthenticationProvider", $ap) } if ($params.ContainsKey("AllowAnonymous")) { - $newWebAppParams.Add("AllowAnonymousAccess", $true) + $newWebAppParams.Add("AllowAnonymousAccess", $params.AllowAnonymous) } if ($params.ContainsKey("DatabaseName") -eq $true) { $newWebAppParams.Add("DatabaseName", $params.DatabaseName) } if ($params.ContainsKey("DatabaseServer") -eq $true) { $newWebAppParams.Add("DatabaseServer", $params.DatabaseServer) } if ($params.ContainsKey("HostHeader") -eq $true) { $newWebAppParams.Add("HostHeader", $params.HostHeader) } if ($params.ContainsKey("Path") -eq $true) { $newWebAppParams.Add("Path", $params.Path) } if ($params.ContainsKey("Port") -eq $true) { $newWebAppParams.Add("Port", $params.Port) } + if ($params.ContainsKey("UseSSL") -eq $true) { $newWebAppParams.Add("SecureSocketsLayer", $params.UseSSL) } $wa = New-SPWebApplication @newWebAppParams } @@ -120,6 +124,7 @@ function Test-TargetResource [parameter(Mandatory = $false)] [System.String] $HostHeader, [parameter(Mandatory = $false)] [System.String] $Path, [parameter(Mandatory = $false)] [System.String] $Port, + [parameter(Mandatory = $false)] [System.Boolean] $UseSSL, [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof index fff10e1a3..fdf964d38 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.schema.mof @@ -23,17 +23,18 @@ The resource will provision the web application with all of the current settings [ClassVersion("1.1.0.0"), FriendlyName("xSPWebApplication")] class MSFT_xSPWebApplication : OMI_BaseResource { - [Key] string Name; - [Required] string ApplicationPool; - [Required] string ApplicationPoolAccount; - [Required] string Url; - [Write] boolean AllowAnonymous; - [Write, ValueMap{"NTLM","Kerberos"}, Values{"NTLM","Kerberos"}] string AuthenticationMethod; - [Write] string DatabaseName; - [Write] string DatabaseServer; - [Write] string HostHeader; - [Write] string Path; - [Write] string Port; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [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; + [Write, Description("Should anonymous access be enabled for this web app")] boolean AllowAnonymous; + [Write, Description("What authentication mode should be used for the web app"), ValueMap{"NTLM","Kerberos"}, Values{"NTLM","Kerberos"}] string AuthenticationMethod; + [Write, Description("The name of the first content database to be created with this web app")] string DatabaseName; + [Write, Description("The name of the database server to host the default content DB")] string DatabaseServer; + [Write, Description("The host header to use for the web app")] string HostHeader; + [Write, Description("The path on the local servers to host the IIS web site from")] string Path; + [Write, Description("The port to run the site on")] string Port; + [Write, Description("Should this web app use SSL")] boolean UseSSL; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplicationAppDomain/MSFT_xSPWebApplicationAppDomain.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplicationAppDomain/MSFT_xSPWebApplicationAppDomain.schema.mof index f16a1e137..b8ad38a0c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplicationAppDomain/MSFT_xSPWebApplicationAppDomain.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplicationAppDomain/MSFT_xSPWebApplicationAppDomain.schema.mof @@ -22,10 +22,10 @@ The app prefix should still be set using the xSPAppDomain resource before this i [ClassVersion("1.0.0.0"), FriendlyName("xSPWebApplicationAppDomain")] class MSFT_xSPWebApplicationAppDomain : OMI_BaseResource { - [Key] string WebApplication; - [Key, ValueMap{"Default","Internet","Intranet","Extranet","Custom"}, Values{"Default","Internet","Intranet","Extranet","Custom"}] string Zone; - [Required] string AppDomain; - [Write] string Port; - [Write] boolean SSL; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; + [Key, Description("The URL of the web application to set the app domain for")] string WebApplication; + [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; + [Write, Description("Should apps run under SSL")] boolean SSL; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWordAutomationServiceApp/MSFT_xSPWordAutomationServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWordAutomationServiceApp/MSFT_xSPWordAutomationServiceApp.schema.mof index 6736e911b..6fd3a950c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWordAutomationServiceApp/MSFT_xSPWordAutomationServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWordAutomationServiceApp/MSFT_xSPWordAutomationServiceApp.schema.mof @@ -48,23 +48,23 @@ Make sure the service application does not exist and remove when it does [ClassVersion("1.0.0.0"), FriendlyName("xSPWordAutomationServiceApp")] class MSFT_xSPWordAutomationServiceApp : OMI_BaseResource { - [Key] string Name; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; - [Write] string ApplicationPool; - [Write] string DatabaseName; - [Write] string DatabaseServer; - [Write, ValueMap{"docx","doc","mht","rtf","xml"}, Values{"docx","doc","mht","rtf","xml"}] string SupportedFileFormats[]; - [Write] boolean DisableEmbeddedFonts; - [Write] uint32 MaximumMemoryUsage; - [Write] uint32 RecycleThreshold; - [Write] boolean DisableBinaryFileScan; - [Write] uint32 ConversionProcesses; - [Write] uint32 JobConversionFrequency; - [Write] uint32 NumberOfConversionsPerProcess; - [Write] uint32 TimeBeforeConversionIsMonitored; - [Write] uint32 MaximumConversionAttempts; - [Write] uint32 MaximumSyncConversionRequests; - [Write] uint32 KeepAliveTimeout; - [Write] uint32 MaximumConversionTime; - [Write, EmbeddedInstance("MSFT_Credential")] string InstallAccount; + [Key, Description("THe name of the service application")] string Name; + [Required, Description("Present to ensure the app exists, absent to ensure that it does not"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("The name of the application pool to run the service app in")] string ApplicationPool; + [Write, Description("The name of the database for the service app")] string DatabaseName; + [Write, Description("The name of the server that will host the database")] string DatabaseServer; + [Write, Description("The list of supported file types"), ValueMap{"docx","doc","mht","rtf","xml"}, Values{"docx","doc","mht","rtf","xml"}] string SupportedFileFormats[]; + [Write, Description("Should embedded fonts be disabled")] boolean DisableEmbeddedFonts; + [Write, Description("What is the maximum amount of memory the service app should use (in MB)")] uint32 MaximumMemoryUsage; + [Write, Description("What is the recycle threshold for this service app")] uint32 RecycleThreshold; + [Write, Description("Should binary file scans be disabled")] boolean DisableBinaryFileScan; + [Write, Description("How many conversion processes can be run at once")] uint32 ConversionProcesses; + [Write, Description("How frequently should new jobs be started from the queue (in minutes)")] uint32 JobConversionFrequency; + [Write, Description("How many document conversions should be included in a single process")] uint32 NumberOfConversionsPerProcess; + [Write, Description("How long can a conversion be run before it becomes monitored")] uint32 TimeBeforeConversionIsMonitored; + [Write, Description("What is the maximum number of attempts to convert a document")] uint32 MaximumConversionAttempts; + [Write, Description("What is the maximum number of sync conversion requests for the service app")] uint32 MaximumSyncConversionRequests; + [Write, Description("How long is the keep alive timeout set to for the service app")] uint32 KeepAliveTimeout; + [Write, Description("What is the maximum time in seconds for a document conversion to be allowed to run")] uint32 MaximumConversionTime; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] string InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.psm1 index 7bbc8629a..20daf7d58 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.psm1 @@ -77,7 +77,7 @@ function Set-TargetResource Write-Verbose -Message "Creating work management Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $appService = Get-SPServiceApplication -Name $params.Name ` + $appService = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue ` | Where-Object { $_.TypeName -eq "Work Management Service Application" } if($appService -ne $null -and $params.ContainsKey("Ensure") -and $params.Ensure -eq "Absent") @@ -92,8 +92,8 @@ function Set-TargetResource $newParams.Add("ApplicationPool", $params.ApplicationPool) $appService = New-SPWorkManagementServiceApplication @newParams - New-SPWorkManagementServiceApplicationProxy -Name "$($params.Name) Proxy" -DefaultProxyGroup -ServiceApplication $appService -ea Stop | Out-Null - + New-SPWorkManagementServiceApplicationProxy -Name "$($params.Name) Proxy" -DefaultProxyGroup -ServiceApplication $appService | Out-Null + Sleep -Milliseconds 200 } $setParams = @{} if ($params.ContainsKey("MinimumTimeBetweenEwsSyncSubscriptionSearches")) { $setParams.Add("MinimumTimeBetweenEwsSyncSubscriptionSearches", $params.MinimumTimeBetweenEwsSyncSubscriptionSearches) } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.schema.mof index 4ea910359..d4dd1ea9e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWorkManagementServiceApp/MSFT_xSPWorkManagementServiceApp.schema.mof @@ -1,4 +1,4 @@ -/* +/* **Description** This resource is used to provision and manage an instance of the Work Management Services Service Application. @@ -16,22 +16,21 @@ Remarks xSPWorkManagementServiceApp WorkManagementServiceApp { Name = "App Management Service Application" - AppPool = "SharePoint web services" + ApplicationPool = "SharePoint web services" MinimumTimeBetweenEwsSyncSubscriptionSearches = 10 } */ -[ClassVersion("1.0.0.0"), FriendlyName("WorkManagementServiceApp")] -class MSFT_WorkManagementServiceApp : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("xSPWorkManagementServiceApp")] +class MSFT_xSPWorkManagementServiceApp : OMI_BaseResource { - [Key] string Name; - [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; - [Required] String ApplicationPool; - [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; - [Write] System.UInt32 MinimumTimeBetweenEwsSyncSubscriptionSearches; - [Write] System.UInt32 MinimumTimeBetweenProviderRefreshes; - [Write] System.UInt32 MinimumTimeBetweenSearchQueries; - [Write] System.UInt32 NumberOfSubscriptionSyncsPerEwsSyncRun; - [Write] System.UInt32 NumberOfUsersEwsSyncWillProcessAtOnce; - [Write] System.UInt32 NumberOfUsersPerEwsSyncBatch; + [Key, Description("The name of the work management service application")] string Name; + [write, Description("Present to ensure the app exists, absent to ensure it is removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [write, Description("The name of the application pool this will run in")] String ApplicationPool; + [Write, Description("The minimum amount of time bween EWS sync subscription searches")] uint32 MinimumTimeBetweenEwsSyncSubscriptionSearches; + [Write, Description("The minimum time between provider refreshes")] uint32 MinimumTimeBetweenProviderRefreshes; + [Write, Description("The minimum time between search queries")] uint32 MinimumTimeBetweenSearchQueries; + [Write, Description("The number of subscription syncronisations per EWS sync run")] uint32 NumberOfSubscriptionSyncsPerEwsSyncRun; + [Write, Description("How many users will EWS calls include at once")] uint32 NumberOfUsersEwsSyncWillProcessAtOnce; + [Write, Description("How many users are included in a batch for EWS")] uint32 NumberOfUsersPerEwsSyncBatch; + [Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; - diff --git a/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 b/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 index 80f620084..e7720ade4 100644 --- a/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 +++ b/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 @@ -41,6 +41,35 @@ Configuration SharePointServer xWebAppPool RemoveDefaultAppPool { Name = "DefaultAppPool"; Ensure = "Absent" } xWebSite RemoveDefaultWebSite { Name = "Default Web Site"; Ensure = "Absent"; PhysicalPath = "C:\inetpub\wwwroot" } + + #********************************************************** + # Install Binaries + # + # This section installs SharePoint and its Prerequisites + #********************************************************** + + xSPInstallPrereqs InstallPrereqs { + Ensure = "Present" + InstallerPath = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Path "prerequisiteinstaller.exe") + OnlineMode = $false + SQLNCli = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "sqlncli.msi") + PowerShell = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "Windows6.1-KB2506143-x64.msu") + NETFX = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "dotnetfx45_full_x86_x64.exe") + IDFX = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "Windows6.1-KB974405-x64.msu") + Sync = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "Synchronization.msi") + AppFabric = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "WindowsServerAppFabricSetup_x64.exe") + IDFX11 = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "MicrosoftIdentityExtensions-64.msi") + MSIPCClient = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "setup_msipc_x64.msi") + WCFDataServices = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "WcfDataServices.exe") + KB2671763 = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "AppFabric1.1-RTM-KB2671763-x64-ENU.exe") + WCFDataServices56 = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "WcfDataServices56.exe") + } + xSPInstall InstallSharePoint { + Ensure = "Present" + BinaryDir = $ConfigurationData.NonNodeData.SharePoint.Binaries.Path + ProductKey = $ConfigurationData.NonNodeData.SharePoint.ProductKey + DependsOn = "[xSPInstallPrereqs]InstallPrereqs" + } #********************************************************** # Basic farm configuration @@ -57,6 +86,7 @@ Configuration SharePointServer FarmAccount = $FarmAccount PsDscRunAsCredential = $SPSetupAccount AdminContentDatabaseName = $ConfigurationData.NonNodeData.SharePoint.Farm.AdminContentDatabase + DependsOn = "[xSPInstall]InstallSharePoint" } xSPManagedAccount ServicePoolManagedAccount { diff --git a/Modules/xSharePoint/Examples/Single Server/SharePoint.psd1 b/Modules/xSharePoint/Examples/Single Server/SharePoint.psd1 index 5595b3490..4f40f74bd 100644 --- a/Modules/xSharePoint/Examples/Single Server/SharePoint.psd1 +++ b/Modules/xSharePoint/Examples/Single Server/SharePoint.psd1 @@ -24,6 +24,13 @@ FarmDatabaseServer = "sql1.contoso.local" } SharePoint = @{ + ProductKey = "INSERT PRODUCT KEY HERE" + Binaries = @{ + Path = "C:\Binaries\SharePoint" + Prereqs = @{ + OfflineInstallDir = "C:\Binaries\SharePoint\PrerequisitesInstallerfiles" + } + } Farm = @{ ConfigurationDatabase = "SP_Config" Passphrase = "ExamplePassphase!" diff --git a/Modules/xSharePoint/Examples/Small Farm/SharePoint.ps1 b/Modules/xSharePoint/Examples/Small Farm/SharePoint.ps1 index 82c20f0a1..1cf0d5034 100644 --- a/Modules/xSharePoint/Examples/Small Farm/SharePoint.ps1 +++ b/Modules/xSharePoint/Examples/Small Farm/SharePoint.ps1 @@ -52,6 +52,34 @@ Configuration SharePointServer xWebAppPool RemoveDefaultAppPool { Name = "DefaultAppPool"; Ensure = "Absent"; } xWebSite RemoveDefaultWebSite { Name = "Default Web Site"; Ensure = "Absent"; PhysicalPath = "C:\inetpub\wwwroot"; } + #********************************************************** + # Install Binaries + # + # This section installs SharePoint and its Prerequisites + #********************************************************** + + xSPInstallPrereqs InstallPrereqs { + Ensure = "Present" + InstallerPath = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Path "prerequisiteinstaller.exe") + OnlineMode = $false + SQLNCli = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "sqlncli.msi") + PowerShell = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "Windows6.1-KB2506143-x64.msu") + NETFX = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "dotnetfx45_full_x86_x64.exe") + IDFX = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "Windows6.1-KB974405-x64.msu") + Sync = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "Synchronization.msi") + AppFabric = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "WindowsServerAppFabricSetup_x64.exe") + IDFX11 = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "MicrosoftIdentityExtensions-64.msi") + MSIPCClient = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "setup_msipc_x64.msi") + WCFDataServices = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "WcfDataServices.exe") + KB2671763 = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "AppFabric1.1-RTM-KB2671763-x64-ENU.exe") + WCFDataServices56 = (Join-Path $ConfigurationData.NonNodeData.SharePoint.Binaries.Prereqs.OfflineInstallDir "WcfDataServices56.exe") + } + xSPInstall InstallSharePoint { + Ensure = "Present" + BinaryDir = $ConfigurationData.NonNodeData.SharePoint.Binaries.Path + ProductKey = $ConfigurationData.NonNodeData.SharePoint.ProductKey + DependsOn = "[xSPInstallPrereqs]InstallPrereqs" + } #********************************************************** # Basic farm configuration @@ -73,7 +101,7 @@ Configuration SharePointServer FarmAccount = $FarmAccount PsDscRunAsCredential = $SPSetupAccount AdminContentDatabaseName = $ConfigurationData.NonNodeData.SharePoint.Farm.AdminContentDatabase - DependsOn = "[xComputer]DomainJoin" + DependsOn = "[xSPInstall]InstallSharePoint" } $FarmWaitTask = "[xSPCreateFarm]CreateSPFarm" diff --git a/Modules/xSharePoint/Examples/Small Farm/SharePoint.psd1 b/Modules/xSharePoint/Examples/Small Farm/SharePoint.psd1 index 0967849cf..6cc945058 100644 --- a/Modules/xSharePoint/Examples/Small Farm/SharePoint.psd1 +++ b/Modules/xSharePoint/Examples/Small Farm/SharePoint.psd1 @@ -49,6 +49,13 @@ FarmDatabaseServer = "sql1.contoso.local" } SharePoint = @{ + ProductKey = "INSERT PRODUCT KEY HERE" + Binaries = @{ + Path = "C:\Binaries\SharePoint" + Prereqs = @{ + OfflineInstallDir = "C:\Binaries\SharePoint\PrerequisitesInstallerfiles" + } + } Farm = @{ ConfigurationDatabase = "SP_Config" Passphrase = "SharePoint156!" diff --git a/Modules/xSharePoint/en-us/about_xSPAlternateUrl.help.txt b/Modules/xSharePoint/en-us/about_xSPAlternateUrl.help.txt new file mode 100644 index 000000000..b584fd88a --- /dev/null +++ b/Modules/xSharePoint/en-us/about_xSPAlternateUrl.help.txt @@ -0,0 +1,41 @@ +.NAME + xSPAlternateUrl + +.SYNOPSIS + +This resource is used to define an alternate access mapping URL for a specified web application. + + +.EXAMPLE + + xSPAlternateUrl CentralAdminAAM + { + WebAppUrl = "http://sharepoint1:9999" + Zone = "Intranet" + Url = "https://admin.sharepoint.contoso.com" + PsDscRunAsCredential = $SPSetupAccount + } + +.PARAMETER WebAppUrl + Key - String + The URL of the web application to apply the alternate URL to + +.PARAMETER Zone + Key - String + Allowed values: Default, Intranet, Extranet, Custom, Internet + The Zone to use for the alternate URL + +.PARAMETER Url + Write - String + The new alternate URL + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present ensures the URL is set for this zone on this web app, Absent ensures it is removed + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPAntivirusSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPAntivirusSettings.help.txt index 36c109a8e..559efe017 100644 --- a/Modules/xSharePoint/en-us/about_xSPAntivirusSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPAntivirusSettings.help.txt @@ -1,22 +1,13 @@ -NAME +.NAME xSPAntivirusSettings -PARAMETERS - ScanOnDownload (Key, Boolean) - ScanOnUpload (Write, Boolean) - AllowDownloadInfected (Write, Boolean) - AttemptToClean (Write, Boolean) - TimeoutDuration (Write, Uint16) - NumberOfThreads (Write, Uint16) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 scanning tool that is able to integrate with SharePoint. Note that this will not scan documents for viruses on it's own, an external tool still needs to be installed on the servers that integrates with SharePoint. -EXAMPLE +.EXAMPLE xSPAntivirusSettings AVSettings { @@ -26,3 +17,32 @@ EXAMPLE AttemptToClean = $false } +.PARAMETER ScanOnDownload + Key - Boolean + Should documents be scanned before being downloaded + +.PARAMETER ScanOnUpload + Write - Boolean + Should documents be scanned on upload + +.PARAMETER AllowDownloadInfected + Write - Boolean + Should documents that are infected be allowed to be downloaded + +.PARAMETER AttemptToClean + Write - Boolean + Should infected documents be handed to the AV engine to attempt cleaning + +.PARAMETER TimeoutDuration + Write - Uint16 + What is the timeout for an AV scan in seconds + +.PARAMETER NumberOfThreads + Write - Uint16 + How many concurrent threads should the AV engine be able to run on a server + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPAppCatalog.help.txt b/Modules/xSharePoint/en-us/about_xSPAppCatalog.help.txt index 2517b9435..48e7c6dcd 100644 --- a/Modules/xSharePoint/en-us/about_xSPAppCatalog.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPAppCatalog.help.txt @@ -1,16 +1,12 @@ -NAME +.NAME xSPAppCatalog -PARAMETERS - SiteUrl (Key, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 have been created using the correct template (APPCATALOG#0). -EXAMPLE +.EXAMPLE xSPAppCatalog MainAppCatalog { @@ -19,3 +15,12 @@ EXAMPLE } +.PARAMETER SiteUrl + Key - string + The URL of the site collection that will be the app catalog for the web app that it is in + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPAppDomain.help.txt b/Modules/xSharePoint/en-us/about_xSPAppDomain.help.txt index 0c0fb216e..bf667281b 100644 --- a/Modules/xSharePoint/en-us/about_xSPAppDomain.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPAppDomain.help.txt @@ -1,18 +1,13 @@ -NAME +.NAME xSPAppDomain -PARAMETERS - AppDomain (Key, string) - Prefix (Required, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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. -EXAMPLE +.EXAMPLE xSPAppDomain LocalFarmAppUrls { @@ -22,3 +17,16 @@ EXAMPLE } +.PARAMETER AppDomain + Key - string + The domain name for apps to use in this farm + +.PARAMETER Prefix + Required - string + The prefix to go on to app URLs + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPAppManagementServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPAppManagementServiceApp.help.txt index 907b721de..ec40318d4 100644 --- a/Modules/xSharePoint/en-us/about_xSPAppManagementServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPAppManagementServiceApp.help.txt @@ -1,21 +1,14 @@ -NAME +.NAME xSPAppManagementServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, String) - DatabaseName (Write, string) - DatabaseServer (Write, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 management service application through the application display name. Currently the resource will provision the app if it does not yet exist, and will change the application pool associated to the app if it does not match the configuration. Database names or server name will not be changed if the configuration does not match, these parameters are only used for the initial provisioning of the service application. -EXAMPLE +.EXAMPLE xSPAppManagementServiceApp AppManagementServiceApp { @@ -25,3 +18,24 @@ EXAMPLE DatabaseName = "SP_ManagedMetadata" } +.PARAMETER Name + Key - string + The name of the app management service application + +.PARAMETER ApplicationPool + Required - String + The app pool that should be used to run the service app + +.PARAMETER DatabaseName + Write - string + The name of the database for the service application + +.PARAMETER DatabaseServer + Write - String + The name of the server for the database + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPBCSServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPBCSServiceApp.help.txt index 1ae922739..8e809ec62 100644 --- a/Modules/xSharePoint/en-us/about_xSPBCSServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPBCSServiceApp.help.txt @@ -1,21 +1,14 @@ -NAME +.NAME xSPBCSServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, String) - DatabaseName (Write, string) - DatabaseServer (Write, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is used to provision and manage an instance of the Business Connectivity Services Service Application. It will identify an instance of the BCS app through the application display name. Currently the resource will provision the app if it does not yet exist, and will change the service account associated to the app if it does not match the configuration. Database names or server name will not be changed if the configuration does not match, these parameters are only used for the initial provisioning of the service application. -EXAMPLE +.EXAMPLE xSPBCSServiceApp BCSServiceApp { @@ -26,3 +19,24 @@ EXAMPLE InstallAccount = $InstallAccount } +.PARAMETER Name + Key - string + The name of the BCS service app + +.PARAMETER ApplicationPool + Required - String + The application pool it should run in + +.PARAMETER DatabaseName + Write - string + Name of the database to create for the service app + +.PARAMETER DatabaseServer + Write - String + Name of the database server to host the database on + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPCacheAccounts.help.txt b/Modules/xSharePoint/en-us/about_xSPCacheAccounts.help.txt index ff8f5448e..8d4ef967c 100644 --- a/Modules/xSharePoint/en-us/about_xSPCacheAccounts.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPCacheAccounts.help.txt @@ -1,17 +1,11 @@ -NAME +.NAME xSPCacheAccounts -PARAMETERS - WebAppUrl (Key, string) - SuperUserAlias (Required, string) - SuperReaderAlias (Required, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 [Configure object cache user accounts in SharePoint Server 2013](https://technet.microsoft.com/en-us/library/ff758656.aspx)). -EXAMPLE +.EXAMPLE xSPCacheAccounts SetCacheAccounts { @@ -21,3 +15,20 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER WebAppUrl + Key - string + The URL of the web application to set the accounts for + +.PARAMETER SuperUserAlias + Required - string + The account name for the super user + +.PARAMETER SuperReaderAlias + Required - string + The account name fo the super reader + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPCreateFarm.help.txt b/Modules/xSharePoint/en-us/about_xSPCreateFarm.help.txt index 3a963643f..fe8b147ec 100644 --- a/Modules/xSharePoint/en-us/about_xSPCreateFarm.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPCreateFarm.help.txt @@ -1,17 +1,7 @@ -NAME +.NAME xSPCreateFarm -PARAMETERS - FarmConfigDatabaseName (Key, String) - DatabaseServer (Key, String) - FarmAccount (Required, String) - InstallAccount (Write, String) - Passphrase (Required, String) - AdminContentDatabaseName (Required, String) - CentralAdministrationPort (Write, uint32) - ServerRole (Write, string, Allowed values: Application, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, SpecialLoad, WebFrontEnd) - -DESCRIPTION +.SYNOPSIS This resource is used to provision a new SharePoint farm. It should only be used on the first server in the farm to create the configuration database, all servers to join the farm after the first server creates the configuration database should use [xSPJoinFarm](xSPJoinFarm). @@ -22,7 +12,7 @@ However this setting will not impact existing deployments that already have Cent Also when a farm is created, the current behavior is to not enroll the server as a cache server (which is the default behavior of SharePoint). This means you need to use [xSPDistributedCacheService](xSPDistributedCacheService) on at least one server in the farm to designate it as a cache server. -EXAMPLE +.EXAMPLE xSPCreateFarm CreateSPFarm { @@ -36,3 +26,37 @@ EXAMPLE ServerRole = Custom } +.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 ServerRole + Write - string + Allowed values: Application, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, SpecialLoad, WebFrontEnd + 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 PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPDatabaseAAG.help.txt b/Modules/xSharePoint/en-us/about_xSPDatabaseAAG.help.txt new file mode 100644 index 000000000..5d364bd33 --- /dev/null +++ b/Modules/xSharePoint/en-us/about_xSPDatabaseAAG.help.txt @@ -0,0 +1,43 @@ +.NAME + xSPDatabaseAAG + +.SYNOPSIS + +This resource will allow specifying which SQL Server AlwaysOn Availability group a resource should be in. +This resource does not configure the Availability Groups on SQL Server, they must already exist. +It simply adds the specified database to the group. + + +.EXAMPLE + + xSPDatabaseAAG ConfigDBAAG + { + DatabaseName = "SP_Config" + AGName = "MyAvailabilityGroup" + FileShare = "\\SQL\Backups" + Ensure = "Present" + PsDscRunAsCredential = $InstallAccount + }s + +.PARAMETER DatabaseName + Key - string + The name of the database to put in the AlwaysOn group + +.PARAMETER AGName + Required - string + Name of the AlwaysOn group on the SQL server - this must already exist + +.PARAMETER FileShare + Write - string + The fileshare to use for the SQL backup when adding to the group + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present if the database should be in this AlwaysOn group, or Absent if it should not be in the group + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPDesignerSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPDesignerSettings.help.txt index 3f633ae0a..8ccd1f21e 100644 --- a/Modules/xSharePoint/en-us/about_xSPDesignerSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPDesignerSettings.help.txt @@ -1,19 +1,7 @@ -NAME +.NAME xSPDesignerSettings -PARAMETERS - Url (Key, string) - SettingsScope (Required, string, Allowed values: WebApplication, SiteCollection) - AllowSharePointDesigner (Write, Boolean) - AllowDetachPagesFromDefinition (Write, Boolean) - AllowCustomiseMasterPage (Write, Boolean) - AllowManageSiteURLStructure (Write, Boolean) - AllowCreateDeclarativeWorkflow (Write, Boolean) - AllowSavePublishDeclarativeWorkflow (Write, Boolean) - AllowSaveDeclarativeWorkflowAsTemplate (Write, Boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 allowed to make changes using SharePoint Designer. @@ -27,7 +15,7 @@ When using PowerShell v4 or PowerShell v5 with the InstallAccount switch (instea Due to an issue with Remote PowerShell and SharePoint, changing the Site Collection settings results in an Access Denied error. Consider implementing PowerShell v5 and switching to the PsDscRunAsCredential configuration. -EXAMPLE +.EXAMPLE xSPDesignerSettings MainWebAppSPDSettings { @@ -43,3 +31,45 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the web application or site collection to configure + +.PARAMETER SettingsScope + Required - string + Allowed values: WebApplication, SiteCollection + Define the scope of the configuration - either WebApplication or SiteCollection + +.PARAMETER AllowSharePointDesigner + Write - Boolean + Allow the use of SharePoint Designer + +.PARAMETER AllowDetachPagesFromDefinition + Write - Boolean + Allow pages to be un-ghosted by SharePoint Designer + +.PARAMETER AllowCustomiseMasterPage + Write - Boolean + Allow masterpages to be changed by SharePoint Designer + +.PARAMETER AllowManageSiteURLStructure + Write - Boolean + Allow site URL structure to be changed by SharePoint Designer + +.PARAMETER AllowCreateDeclarativeWorkflow + Write - Boolean + Allow users to create declarative workflows with SharePoint Designer + +.PARAMETER AllowSavePublishDeclarativeWorkflow + Write - Boolean + Allow users to save and re-publish declarative workflows with SharePoint Designer + +.PARAMETER AllowSaveDeclarativeWorkflowAsTemplate + Write - Boolean + Allow users to save declarative workflows as a template from SharePoint Designer + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPDiagnosticLoggingSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPDiagnosticLoggingSettings.help.txt index e7aed4e26..3b6330825 100644 --- a/Modules/xSharePoint/en-us/about_xSPDiagnosticLoggingSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPDiagnosticLoggingSettings.help.txt @@ -1,33 +1,12 @@ -NAME +.NAME xSPDiagnosticLoggingSettings -PARAMETERS - LogPath (Key, string) - LogSpaceInGB (Required, uint32) - AppAnalyticsAutomaticUploadEnabled (Write, boolean) - CustomerExperienceImprovementProgramEnabled (Write, boolean) - DaysToKeepLogs (Write, uint32) - DownloadErrorReportingUpdatesEnabled (Write, boolean) - ErrorReportingAutomaticUploadEnabled (Write, boolean) - ErrorReportingEnabled (Write, boolean) - EventLogFloodProtectionEnabled (Write, boolean) - EventLogFloodProtectionNotifyInterval (Write, uint32) - EventLogFloodProtectionQuietPeriod (Write, uint32) - EventLogFloodProtectionThreshold (Write, uint32) - EventLogFloodProtectionTriggerPeriod (Write, uint32) - LogCutInterval (Write, uint32) - LogMaxDiskSpaceUsageEnabled (Write, boolean) - ScriptErrorReportingDelay (Write, uint32) - ScriptErrorReportingEnabled (Write, boolean) - ScriptErrorReportingRequireAuth (Write, boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 they are set. -EXAMPLE +.EXAMPLE xSPDiagnosticLoggingSettings ApplyDiagnosticLogSettings { @@ -52,3 +31,80 @@ EXAMPLE ScriptErrorReportingRequireAuth = $true } +.PARAMETER LogPath + Key - string + The physical path on each server to store ULS logs + +.PARAMETER LogSpaceInGB + Required - uint32 + The space in GB that should be used to store ULS logs + +.PARAMETER AppAnalyticsAutomaticUploadEnabled + Write - boolean + Should app analytics automatically be uploaded + +.PARAMETER CustomerExperienceImprovementProgramEnabled + Write - boolean + Should the customer experience program be enabled in this farm + +.PARAMETER DaysToKeepLogs + Write - uint32 + How many days should ULS logs be kept for + +.PARAMETER DownloadErrorReportingUpdatesEnabled + Write - boolean + Should updates to error reporting tools be automatically downloaded + +.PARAMETER ErrorReportingAutomaticUploadEnabled + Write - boolean + Should error reports be automatically uploaded + +.PARAMETER ErrorReportingEnabled + Write - boolean + Should reporting of errors be enabled + +.PARAMETER EventLogFloodProtectionEnabled + Write - boolean + Protect event logs with Event Log Flood Protection + +.PARAMETER EventLogFloodProtectionNotifyInterval + Write - uint32 + What interval should the event logs report a flood event + +.PARAMETER EventLogFloodProtectionQuietPeriod + Write - uint32 + What quiet period should reset the event log flood protection thresholds + +.PARAMETER EventLogFloodProtectionThreshold + Write - uint32 + What is the event log flood protection threshold + +.PARAMETER EventLogFloodProtectionTriggerPeriod + Write - uint32 + What is the time period that will trigger event log flood protection + +.PARAMETER LogCutInterval + Write - uint32 + How many minutes of activity will a ULS log file leep in an individual file + +.PARAMETER LogMaxDiskSpaceUsageEnabled + Write - boolean + Will the maximum disk space setting be enabled + +.PARAMETER ScriptErrorReportingDelay + Write - uint32 + What delay will be set before script error reporting is triggered + +.PARAMETER ScriptErrorReportingEnabled + Write - boolean + Is script error reporting enabled in this farm + +.PARAMETER ScriptErrorReportingRequireAuth + Write - boolean + Require users to be authenticated to allow script errors to be reported + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPDistributedCacheService.help.txt b/Modules/xSharePoint/en-us/about_xSPDistributedCacheService.help.txt index 8801f477f..b1492cc95 100644 --- a/Modules/xSharePoint/en-us/about_xSPDistributedCacheService.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPDistributedCacheService.help.txt @@ -1,30 +1,59 @@ -NAME +.NAME xSPDistributedCacheService -PARAMETERS - Name (Key, String) - Ensure (Required, string, Allowed values: Present, Absent) - CacheSizeInMB (Required, UInt32) - ServiceAccount (Required, String) - InstallAccount (Write, String) - CreateFirewallRules (Required, Boolean) - -DESCRIPTION +.SYNOPSIS 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 the behavior of [xSPCreateFarm](xSPCreateFarm) and [xSPJoinFarm](xSPJoinFarm) is to not enroll every server as a cache server). The service will be provisioned or de-provisioned based on the Ensure property, and when provisioned the CacheSizeInMB property and ServiceAccount property will be used to configure it. The property createFirewallRules is used to determine if exceptions should be added to the windows firewall to allow communication between servers on the appropriate ports. -EXAMPLE +The ServerProvisionOrder optional property is used when a pull server is handing out configurations to nodes in order to tell this resource about a specific order of enabling the caches. +This allows for multiple servers to receive the same configuration, but they will always check for the server before them in the list first to ensure that it is running distributed cache. +By doing this you can ensure that you do not create conflicts with two or more servers provisioning a cache at the same time. +Note, this approach only makes a server check the others for distributed cache, it does not provision the cache automatically on all servers. +If a previous server in the sequence does not appear to be running distributed cache after 30 minutes, the local server that was waiting will begin anyway. + +.EXAMPLE xSPDistributedCacheService EnableDistributedCache { - Name = "AppFabricCachingService" - Ensure = "Present" - CacheSizeInMB = 8192 - ServiceAccount = "DEMO\ServiceAccount" - InstallAccount = $InstallAccount - CreateFirewallRules = $true + Name = "AppFabricCachingService" + Ensure = "Present" + CacheSizeInMB = 8192 + ServiceAccount = "DEMO\ServiceAccount" + InstallAccount = $InstallAccount + ServerProvisionOrder = @("server1", "server2") + CreateFirewallRules = $true } +.PARAMETER Name + Key - String + A name to assign to this resource - not really used. For example - AppFabricCachingService + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to ensure the current server should be running distributed cache, absent to ensure that it isn't running + +.PARAMETER CacheSizeInMB + Required - UInt32 + How many MB should be used for the cache. The maximum supported is 16384 + +.PARAMETER ServiceAccount + Required - String + The name of the service account to run the service as. This should already be registered as a managed account in SharePoint + +.PARAMETER ServerProvisionOrder + Write - String + A list of servers which specifies the order they should provision the cache in to ensure that two servers do not do it at the same time + +.PARAMETER CreateFirewallRules + Required - Boolean + Should the Windows Firewall rules for distributed cache be created? + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPFarmAdministrators.help.txt b/Modules/xSharePoint/en-us/about_xSPFarmAdministrators.help.txt index e93f8e886..8b70a3edd 100644 --- a/Modules/xSharePoint/en-us/about_xSPFarmAdministrators.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPFarmAdministrators.help.txt @@ -1,21 +1,14 @@ -NAME +.NAME xSPFarmAdministrators -PARAMETERS - Name (Key, String) - Members (Write, String) - MembersToInclude (Write, String) - MembersToExclude (Write, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 "members" property will set a specific list of members for the group, making sure that every user/group in the list is in the group and all others that are members and who are not in this list will be removed. The "MembersToInclude" and "MembersToExclude" properties will allow you to control a specific set of users to add or remove, without changing any other members that are in the group already that may not be specified here, allowing for some manual management outside of this configuration resource. -EXAMPLE +.EXAMPLE xSPFarmAdministrators LocalFarmAdmins { @@ -23,3 +16,24 @@ EXAMPLE Members = @("CONTOSO\user1", "CONTOSO\user2") } +.PARAMETER Name + Key - String + A generic name for this resource, its value is not important + +.PARAMETER Members + Write - String + A list of members to set the group to. Those not in this list will be removed + +.PARAMETER MembersToInclude + Write - String + A list of members to add. Members not in this list will be left in the group + +.PARAMETER MembersToExclude + Write - String + A list of members to remove. Members not in this list will be left in the group + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPFarmSolution.help.txt b/Modules/xSharePoint/en-us/about_xSPFarmSolution.help.txt new file mode 100644 index 000000000..41c90a5af --- /dev/null +++ b/Modules/xSharePoint/en-us/about_xSPFarmSolution.help.txt @@ -0,0 +1,58 @@ +.NAME + xSPFarmSolution + + +.SYNOPSIS + +This resource is used to make sure that a specific farm solution is either present or absent in a farm. +The Ensure property will dictate if the solution should be present or absent. +The name property is the name of the solution including the wsp extension (i.e. MySolution.wsp). +The LiteralPath is required and points to the solution in the files system that is used to upload it if it does not exist. +The Version will be stored in the property bag to determine later if the correct version is installed. +I the version in the farm does not match the desired version an upgrade of the solution will be performed. + +The solution can be deployed to one or more web application passing an array of URL's to the WebApplications property. +If the solution contains resources scoped for web applications and no WebApplications are specified, the solution will be deployed to all web applications. +If the solution does not contain resources scoped for web applications the property is ignored and the solution is deployed globally. + +.EXAMPLE + + xSPFarmSolution SampleWsp + { + Name = "MySolution.wsp" + LiteralPath = "C:\src\MySolution.wsp" + Ensure = "Present" + Version = "1.0.0" + WebApplications = @("http://collaboration", "http://mysites") + PsDscRunAsCredential = $InstallAccount + } + +.PARAMETER Name + Key - string + The filename of the WSP package + +.PARAMETER LiteralPath + Required - string + The full path to the WSP file + +.PARAMETER WebApplications + Write - string + A list of the web applications to deploy this to + +.PARAMETER Ensure + Write - string + Present if the WSP should be deployed, or Absent if it should be removed + +.PARAMETER Version + Write - string + The version of the package that is being modified + +.PARAMETER Deployed + Write - Boolean + Should the solution be deployed to the farm, or just installed to the farm + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPFeature.help.txt b/Modules/xSharePoint/en-us/about_xSPFeature.help.txt index 819300593..ad41c653a 100644 --- a/Modules/xSharePoint/en-us/about_xSPFeature.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPFeature.help.txt @@ -1,20 +1,13 @@ -NAME +.NAME xSPFeature -PARAMETERS - Name (Key, string) - FeatureScope (Required, string, Allowed values: Farm, WebApplication, Site, Web) - Url (Key, string) - InstallAccount (Write, String) - Ensure (Required, string, Allowed values: Present, Absent) - -DESCRIPTION +.SYNOPSIS 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 feature should be on or off. The name property is the name of the feature based on its folder name in the FEATURES folder in the SharePoint hive directory. -EXAMPLE +.EXAMPLE xSPFeature EnableViewFormsLockDown { @@ -22,6 +15,34 @@ EXAMPLE Url = "http://www.contoso.com" Ensure = "Present" Scope = "Site" - PsDscRunAsCredential = $SetupAccuount + PsDscRunAsCredential = $SetupAccuount + Version = "1.0.0.0" } +.PARAMETER Name + Key - string + The name of the feature + +.PARAMETER FeatureScope + Required - string + Allowed values: Farm, WebApplication, Site, Web + The scope to change the feature at - Farm, WebApplication, SiteCollection or Site + +.PARAMETER Url + Key - string + The URL to change the feature at + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present if the feature is to be enabled, Absent if it is to be disabled + +.PARAMETER Version + Write - string + The version of the feature to check against + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPHealthAnalyzerRuleState.help.txt b/Modules/xSharePoint/en-us/about_xSPHealthAnalyzerRuleState.help.txt index 46f3efb57..075215533 100644 --- a/Modules/xSharePoint/en-us/about_xSPHealthAnalyzerRuleState.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPHealthAnalyzerRuleState.help.txt @@ -1,20 +1,12 @@ -NAME +.NAME xSPHealthAnalyzerRuleState -PARAMETERS - Name (Key, String) - Enabled (Required, Boolean) - RuleScope (Write, String, Allowed values: All Servers, Any Server) - Schedule (Write, String, Allowed values: Hourly, Daily, Weekly, Monthly, OnDemandOnly) - FixAutomatically (Write, Boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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. -EXAMPLE +.EXAMPLE xSPHealthAnalyzerRuleState DisableDiskSpaceRule { @@ -26,3 +18,30 @@ EXAMPLE InstallAccount = $InstallAccount } +.PARAMETER Name + Key - String + The name of the rule exactly as it appears in central admin + +.PARAMETER Enabled + Required - Boolean + Should the rule be enabled? + +.PARAMETER RuleScope + Write - String + Allowed values: All Servers, Any Server + What is the scope of this rule + +.PARAMETER Schedule + Write - String + Allowed values: Hourly, Daily, Weekly, Monthly, OnDemandOnly + How often should the rule check + +.PARAMETER FixAutomatically + Write - Boolean + Should the rule fix itself automatically + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPInstall.help.txt b/Modules/xSharePoint/en-us/about_xSPInstall.help.txt index 11fd1b24d..c36116844 100644 --- a/Modules/xSharePoint/en-us/about_xSPInstall.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPInstall.help.txt @@ -1,19 +1,14 @@ -NAME +.NAME xSPInstall -PARAMETERS - BinaryDir (Key, String) - ProductKey (Required, String) - Ensure (Required, string, Allowed values: Present, Absent) - -DESCRIPTION +.SYNOPSIS 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 itself). The ProductKey parameter is used to inject in to the configuration file and validate the license key during the installation process. This module depends on the prerequisites already being installed, which can be done through the use of [xSPInstallPreReqs](xSPInstallPreReqs). -EXAMPLE +.EXAMPLE xSPInstall InstallBinaries { @@ -35,3 +30,17 @@ Currently SharePoint Foundation is not supported by xSPInstall (see [Issue #81]( ReturnCode = 0 } +.PARAMETER BinaryDir + Key - String + The directory that contains all of the SharePoint binaries + +.PARAMETER ProductKey + Required - String + The product key to use during the installation + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to install SharePoint. Absent is currently not supported + + diff --git a/Modules/xSharePoint/en-us/about_xSPInstallPrereqs.help.txt b/Modules/xSharePoint/en-us/about_xSPInstallPrereqs.help.txt index 2df04ba51..a8d8d120c 100644 --- a/Modules/xSharePoint/en-us/about_xSPInstallPrereqs.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPInstallPrereqs.help.txt @@ -1,29 +1,7 @@ -NAME +.NAME xSPInstallPrereqs -PARAMETERS - InstallerPath (Key, String) - OnlineMode (Required, Boolean) - SQLNCli (Write, String) - PowerShell (Write, String) - NETFX (Write, String) - IDFX (Write, String) - Sync (Write, String) - AppFabric (Write, String) - IDFX11 (Write, String) - MSIPCClient (Write, String) - WCFDataServices (Write, String) - KB2671763 (Write, String) - WCFDataServices56 (Write, String) - KB2898850 (Write, String) - MSVCRT11 (Write, String) - MSVCRT14 (Write, String) - KB3092423 (Write, String) - ODBC (Write, String) - DotNet452 (Write, String) - Ensure (Required, string, Allowed values: Present, Absent) - -DESCRIPTION +.SYNOPSIS This resource is responsible for ensuring the installation of all SharePoint prerequisites. It makes use of the PrerequisiteInstaller.exe file that is part of the SharePoint binaries, and will install the required Windows features as well as additional software. @@ -67,3 +45,85 @@ Offline example: WCFDataServices56 = "C:\SPInstall\prerequisiteinstallerfiles\WcfDataServices56.exe" } +.PARAMETER InstallerPath + Key - String + The full path to prerequisiteinstaller.exe + +.PARAMETER OnlineMode + Required - Boolean + Should the installer download prerequisites from the internet or not + +.PARAMETER SQLNCli + Write - String + The path to the installer for this prerequisite + +.PARAMETER PowerShell + Write - String + The path to the installer for this prerequisite + +.PARAMETER NETFX + Write - String + The path to the installer for this prerequisite + +.PARAMETER IDFX + Write - String + The path to the installer for this prerequisite + +.PARAMETER Sync + Write - String + The path to the installer for this prerequisite + +.PARAMETER AppFabric + Write - String + The path to the installer for this prerequisite + +.PARAMETER IDFX11 + Write - String + The path to the installer for this prerequisite + +.PARAMETER MSIPCClient + Write - String + The path to the installer for this prerequisite + +.PARAMETER WCFDataServices + Write - String + The path to the installer for this prerequisite + +.PARAMETER KB2671763 + Write - String + The path to the installer for this prerequisite + +.PARAMETER WCFDataServices56 + Write - String + The path to the installer for this prerequisite + +.PARAMETER KB2898850 + Write - String + The path to the installer for this prerequisite + +.PARAMETER MSVCRT11 + Write - String + The path to the installer for this prerequisite + +.PARAMETER MSVCRT14 + Write - String + The path to the installer for this prerequisite + +.PARAMETER KB3092423 + Write - String + The path to the installer for this prerequisite + +.PARAMETER ODBC + Write - String + The path to the installer for this prerequisite + +.PARAMETER DotNet452 + Write - String + The path to the installer for this prerequisite + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to install the prerequisites. Absent is currently not supported + + diff --git a/Modules/xSharePoint/en-us/about_xSPJoinFarm.help.txt b/Modules/xSharePoint/en-us/about_xSPJoinFarm.help.txt index 5c3151c05..527643e07 100644 --- a/Modules/xSharePoint/en-us/about_xSPJoinFarm.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPJoinFarm.help.txt @@ -1,20 +1,13 @@ -NAME +.NAME xSPJoinFarm -PARAMETERS - FarmConfigDatabaseName (Key, string) - DatabaseServer (Key, string) - InstallAccount (Write, String) - Passphrase (Required, string) - ServerRole (Write, string, Allowed values: Application, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, SpecialLoad, WebFrontEnd) - -DESCRIPTION +.SYNOPSIS This resource will be responsible for joining a server to an existing SharePoint farm. To create a new farm use the [xSPCreateFarm](xSPCreateFarm) resource on a different server to begin with, and then pass the same database server and configuration database name parameters to the additional servers using this resource. After the server has joined the farm, the process will wait for 5 minutes to allow farm specific configuration to take place on the server, before allowing further DSC configuration to take place. -EXAMPLE +.EXAMPLE xSPJoinFarm JoinSPFarm { @@ -24,3 +17,25 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.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, Custom, DistributedCache, Search, SingleServer, SingleServerFarm, SpecialLoad, WebFrontEnd + 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 PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPManagedAccount.help.txt b/Modules/xSharePoint/en-us/about_xSPManagedAccount.help.txt index b9a08d091..b25bc8a59 100644 --- a/Modules/xSharePoint/en-us/about_xSPManagedAccount.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPManagedAccount.help.txt @@ -1,21 +1,13 @@ -NAME +.NAME xSPManagedAccount -PARAMETERS - AccountName (Key, string) - Account (Required, String) - InstallAccount (Write, String) - EmailNotification (Write, Uint32) - PreExpireDays (Write, Uint32) - Schedule (Write, string) - -DESCRIPTION +.SYNOPSIS This resource will ensure a managed account is provisioned in to the SharePoint farm. The Account object specific the credential to store (including username and password) to set as the managed account. The settings for EmailNotification, PreExpireDays and Schedule all relate to enabling automatic password change for the managed account, leaving these option out of the resource will ensure that no automatic password changing from SharePoint occurs. -EXAMPLE +.EXAMPLE xSPManagedAccount WebPoolManagedAccount { @@ -24,3 +16,28 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER AccountName + Key - string + The username of the account + +.PARAMETER Account + Required - String + The credential with password of the account + +.PARAMETER EmailNotification + Write - Uint32 + How many days before a password change should an email be sent + +.PARAMETER PreExpireDays + Write - Uint32 + How many days before a password expires should it be changed + +.PARAMETER Schedule + Write - string + What is the schedule for the password reset + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPManagedMetaDataServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPManagedMetaDataServiceApp.help.txt index ddf468d41..065138573 100644 --- a/Modules/xSharePoint/en-us/about_xSPManagedMetaDataServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPManagedMetaDataServiceApp.help.txt @@ -1,20 +1,13 @@ -NAME +.NAME xSPManagedMetaDataServiceApp -PARAMETERS - Name (Key, string) - InstallAccount (Write, String) - ApplicationPool (Required, string) - DatabaseServer (Write, string) - DatabaseName (Write, string) - -DESCRIPTION +.SYNOPSIS Creates a managed metadata service application. The application pool property specifies which application pool it should use, and will reset the application back to this pool if it is changed after its initial provisioning. The database server and database name properties are only used during provisioning, and will not be altered as part of the ongoing operation of the DSC resource. -EXAMPLE +.EXAMPLE xSPManagedMetaDataServiceApp ManagedMetadataServiceApp { @@ -25,3 +18,24 @@ EXAMPLE DatabaseName = "SP_ManagedMetadata" } +.PARAMETER Name + Key - string + The name of the managed metadata service application + +.PARAMETER ApplicationPool + Required - string + The application pool that the service app will use + +.PARAMETER DatabaseServer + Write - string + The name of the database server which will host the application + +.PARAMETER DatabaseName + Write - string + The name of the database for the service application + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPManagedPath.help.txt b/Modules/xSharePoint/en-us/about_xSPManagedPath.help.txt index 28e0a61f8..5f3c43cc5 100644 --- a/Modules/xSharePoint/en-us/about_xSPManagedPath.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPManagedPath.help.txt @@ -1,21 +1,14 @@ -NAME +.NAME xSPManagedPath -PARAMETERS - WebAppUrl (Key, string) - InstallAccount (Write, String) - RelativeUrl (Key, string) - Explicit (Required, boolean) - HostHeader (Required, boolean) - -DESCRIPTION +.SYNOPSIS This resource is responsible for creating managed paths associated with a specific web application. The WebAppUrl parameter is used to specify the web application to create the path against, and the RelativeUrl parameter lets you set the URL. Explicit when set to true will create an explicit inclusion path, if set to false the path is created as wildcard inclusion. If you are using host named site collections set HostHeader to true and the path will be created as a host header path to be applied for host named site collections. -EXAMPLE +.EXAMPLE xSPManagedPath TeamsManagedPath { @@ -26,3 +19,24 @@ EXAMPLE HostHeader = $true } +.PARAMETER WebAppUrl + Key - string + The URL of the web application to apply the managed path to - this is ignored for host header web applications + +.PARAMETER RelativeUrl + Key - string + The relative URL of the managed path + +.PARAMETER Explicit + Required - boolean + Should the host header be explicit? If false then it is a wildcard + +.PARAMETER HostHeader + Required - boolean + Is this a host header web application? + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPOutgoingEmailSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPOutgoingEmailSettings.help.txt index a04ccfe2c..216aa9b25 100644 --- a/Modules/xSharePoint/en-us/about_xSPOutgoingEmailSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPOutgoingEmailSettings.help.txt @@ -1,21 +1,13 @@ -NAME +.NAME xSPOutgoingEmailSettings -PARAMETERS - WebAppUrl (key, string) - SMTPServer (Required, string) - FromAddress (Required, string) - ReplyToAddress (Required, string) - CharacterSet (Required, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 web app, use the URL of the web application for the WebAppUrl property, to change the settings for the whole farm use the URL of the central admin website instead. It is possible to set the outgoing server, from address, reply to address and the character set to be used for emails. -EXAMPLE +.EXAMPLE xSPOutgoingEmailSettings FarmWideEmailSettings { @@ -26,3 +18,28 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER WebAppUrl + key - string + The URL of the web application. If you want to set the global settings use the Central Admin URL + +.PARAMETER SMTPServer + Required - string + The SMTP server for outgoing mail + +.PARAMETER FromAddress + Required - string + The from address to put on messages + +.PARAMETER ReplyToAddress + Required - string + The email address that replies should be directed to + +.PARAMETER CharacterSet + Required - string + The character set to use on messages + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPPasswordChangeSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPPasswordChangeSettings.help.txt index 500f86ecb..611880bb2 100644 --- a/Modules/xSharePoint/en-us/about_xSPPasswordChangeSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPPasswordChangeSettings.help.txt @@ -1,20 +1,13 @@ -NAME +.NAME xSPPasswordChangeSettings -PARAMETERS - MailAddress (key, string) - DaysBeforeExpiry (Write, Uint32) - PasswordChangeWaitTimeSeconds (Write, Uint32) - NumberOfRetries (Write, Uint32) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 SharePoint). These settings can be manually controlled through central administration, or configured in this resource. The settings relate to email notifications of when passwords are reset, as well as behavior when a reset occurs such as a time out and number of retries. -EXAMPLE +.EXAMPLE xSPPasswordChangeSettings ManagedAccountPasswordResetSettings { @@ -25,3 +18,24 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER MailAddress + key - string + The email address to send notifications of password changes to + +.PARAMETER DaysBeforeExpiry + Write - Uint32 + The number of days before password expiry to send send emails + +.PARAMETER PasswordChangeWaitTimeSeconds + Write - Uint32 + The duration that a password reset will wait for before it times out + +.PARAMETER NumberOfRetries + Write - Uint32 + How many retries if the password change fails + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPQuotaTemplate.help.txt b/Modules/xSharePoint/en-us/about_xSPQuotaTemplate.help.txt index 8e259c1c1..65e8b9166 100644 --- a/Modules/xSharePoint/en-us/about_xSPQuotaTemplate.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPQuotaTemplate.help.txt @@ -1,21 +1,12 @@ -NAME +.NAME xSPQuotaTemplate -PARAMETERS - Name (Key, string) - StorageMaxInMB (Write, uint32) - StorageWarningInMB (Write, uint32) - MaximumUsagePointsSolutions (Write, uint32) - WarningUsagePointsSolutions (Write, uint32) - Ensure (Required, string, Allowed values: Present, Absent) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 exists, it will also make sure the settings are configured as specified. -EXAMPLE +.EXAMPLE xSPQuotaTemplate TeamsiteTemplate { @@ -27,3 +18,33 @@ EXAMPLE Ensure = "Present" } +.PARAMETER Name + Key - string + The name of the quota template + +.PARAMETER StorageMaxInMB + Write - uint32 + The maximum storage for sites of this template in MB + +.PARAMETER StorageWarningInMB + Write - uint32 + The amount of storage for sites of this template that triggers a warning + +.PARAMETER MaximumUsagePointsSolutions + Write - uint32 + The maximum number of performance points for sandbox solutions for this template + +.PARAMETER WarningUsagePointsSolutions + Write - uint32 + The warning number of performance points for sandbox solutions for this template + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to create this template, absent to ensure it does not exist + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSearchIndexPartition.help.txt b/Modules/xSharePoint/en-us/about_xSPSearchIndexPartition.help.txt index 1f04f5bb9..85bd6fe3d 100644 --- a/Modules/xSharePoint/en-us/about_xSPSearchIndexPartition.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSearchIndexPartition.help.txt @@ -1,14 +1,7 @@ -NAME +.NAME xSPSearchIndexPartition -PARAMETERS - Index (Key, Uint32) - Servers (Required, String) - RootDirectory (Write, String) - ServiceAppName (Required, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is responsible for creating search indexes. It works by creating the index topology components and updating the topology from the server that runs this resource. @@ -21,7 +14,7 @@ Note that for the search topology to apply correctly, the path specified for Roo For example, if the below example was executed on "Server1" it would also need to ensure that it was able to create the index path at I:\. If no disk labeled I: was available on server1, this would fail, even though it will not hold an actual index component. -EXAMPLE +.EXAMPLE xSPSearchIndexPartition MainSearchPartition { @@ -33,3 +26,24 @@ EXAMPLE DependsOn = "[xSPSearchRoles]LocalSearchRoles" } +.PARAMETER Index + Key - Uint32 + The number of the partition in this farm + +.PARAMETER Servers + Required - String + A list of the servers that this partition should exist on + +.PARAMETER RootDirectory + Write - String + The directory that the index should use locally on each server to store data + +.PARAMETER ServiceAppName + Required - String + The name of the search service application + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSearchServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPSearchServiceApp.help.txt index e8a2d3cd5..431385fa6 100644 --- a/Modules/xSharePoint/en-us/about_xSPSearchServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSearchServiceApp.help.txt @@ -1,21 +1,14 @@ -NAME +.NAME xSPSearchServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, string) - DatabaseName (Write, string) - DatabaseServer (Write, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is responsible for provisioning the search service application. The current version lets you specify the database name and server, as well as the application pool. If the application pool is changed the DSC resource will set it back as per what is set in the resource. The database name parameter is used as the prefix for all search databases (so you will end up with one for the admin database which matches the name, and then "_analyticsreportingstore", "_crawlstore" and "_linkstore" databases as well). -EXAMPLE +.EXAMPLE xSPSearchServiceApp SearchServiceApp { @@ -25,3 +18,28 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Name + Key - string + The name of the search service application + +.PARAMETER ApplicationPool + Required - string + The application pool that it should run in + +.PARAMETER DatabaseName + Write - string + The name of the database (noting that some search databases will use this as a prefix) + +.PARAMETER DatabaseServer + Write - string + The server that host the databases for this service application + +.PARAMETER DefaultContentAccessAccount + Write - String + The default content access account for this search service app + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSearchTopology.help.txt b/Modules/xSharePoint/en-us/about_xSPSearchTopology.help.txt index 74352442f..4e43923f8 100644 --- a/Modules/xSharePoint/en-us/about_xSPSearchTopology.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSearchTopology.help.txt @@ -1,18 +1,7 @@ -NAME +.NAME xSPSearchTopology -PARAMETERS - ServiceAppName (Key, String) - Admin (Required, String) - Crawler (Required, String) - ContentProcessing (Required, String) - AnalyticsProcessing (Required, String) - QueryProcessing (Required, String) - IndexPartition (Required, String) - FirstPartitionDirectory (Required, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is responsible for provisioning a search topology in to the current farm. It allows the configuration to dictate the search topology roles that the current server should be running. @@ -25,7 +14,7 @@ Note that for the search topology to apply correctly, the path specified for Fir For example, if the below example was executed on "Server1" it would also need to ensure that it was able to create the index path at I:\. If no disk labeled I: was available on server1, this would fail, even though it will not hold an actual index component. -EXAMPLE +.EXAMPLE xSPSearchRoles LocalSearchRoles { @@ -40,3 +29,40 @@ EXAMPLE IndexPartition = @("Server3","Server4") } +.PARAMETER ServiceAppName + Key - String + The name of the search service application for this topology + +.PARAMETER Admin + Required - String + A list of servers that will run the admin component + +.PARAMETER Crawler + Required - String + A list of servers that will run the crawler component + +.PARAMETER ContentProcessing + Required - String + A list of servers that will run the content processing component + +.PARAMETER AnalyticsProcessing + Required - String + A list of servers that will run the analytics processing component + +.PARAMETER QueryProcessing + Required - String + A list of servers that will run the query processing component + +.PARAMETER IndexPartition + Required - String + A list of servers that will host the first (0) index partition + +.PARAMETER FirstPartitionDirectory + Required - String + The local directory servers will use to store the first index partition + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSecureStoreServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPSecureStoreServiceApp.help.txt index 0c4281926..2dcd4bb2d 100644 --- a/Modules/xSharePoint/en-us/about_xSPSecureStoreServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSecureStoreServiceApp.help.txt @@ -1,26 +1,12 @@ -NAME +.NAME xSPSecureStoreServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, string) - AuditingEnabled (Required, boolean) - AuditlogMaxSize (Write, uint32) - DatabaseCredentials (Write, String) - DatabaseName (Write, string) - DatabaseServer (Write, string) - DatabaseAuthenticationType (Write, string, Allowed values: Windows, SQL) - FailoverDatabaseServer (Write, string) - PartitionMode (Write, boolean) - Sharing (Write, boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is responsible for provisioning and configuring the secure store service application. The parameters passed in (except those related to database specifics) are validated and set when the resource is run, the database values are only used in provisioning of the service application. -EXAMPLE +.EXAMPLE xSPSecureStoreServiceApp SecureStoreServiceApp { @@ -32,3 +18,53 @@ EXAMPLE InstallAccount = $InstallAccount } +.PARAMETER Name + Key - string + The name of the secure store service app + +.PARAMETER ApplicationPool + Required - string + The name of the application pool it will run in + +.PARAMETER AuditingEnabled + Required - boolean + Is auditing enabled for this service app + +.PARAMETER AuditlogMaxSize + Write - uint32 + What is the maximum size of the audit log in MB + +.PARAMETER DatabaseCredentials + Write - String + What SQL credentials should be used to access the database + +.PARAMETER DatabaseName + Write - string + The name of the database for the service app + +.PARAMETER DatabaseServer + Write - string + The name of the database server to host the database + +.PARAMETER DatabaseAuthenticationType + Write - string + Allowed values: Windows, SQL + What type of authentication should be used to access the database + +.PARAMETER FailoverDatabaseServer + Write - string + The name of the database server hosting a failover instance of the database + +.PARAMETER PartitionMode + Write - boolean + Is partition mode enabled for this service app + +.PARAMETER Sharing + Write - boolean + Is sharing enabled for this service app + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPServiceAppPool.help.txt b/Modules/xSharePoint/en-us/about_xSPServiceAppPool.help.txt index 0290e3773..9e8c924c1 100644 --- a/Modules/xSharePoint/en-us/about_xSPServiceAppPool.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPServiceAppPool.help.txt @@ -1,17 +1,12 @@ -NAME +.NAME xSPServiceAppPool -PARAMETERS - Name (Key, string) - ServiceAccount (Required, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 registered as a managed account (which can be provisioned through [xSPManagedAccount](xSPManagedAccount)). -EXAMPLE +.EXAMPLE xSPServiceAppPool MainServiceAppPool { @@ -20,3 +15,16 @@ EXAMPLE InstallAccount = $InstallAccount } +.PARAMETER Name + Key - string + The name of application pool + +.PARAMETER ServiceAccount + Required - string + The name of the managed account to run this service account as + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPServiceInstance.help.txt b/Modules/xSharePoint/en-us/about_xSPServiceInstance.help.txt index 54e28c49c..1cef3d5fb 100644 --- a/Modules/xSharePoint/en-us/about_xSPServiceInstance.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPServiceInstance.help.txt @@ -1,12 +1,7 @@ -NAME +.NAME xSPServiceInstance -PARAMETERS - Name (Key, string) - InstallAccount (Write, String) - Ensure (Required, string, Allowed values: Present, Absent) - -DESCRIPTION +.SYNOPSIS This resource is used to specify if a specific service should be running (Ensure = "Present") or not running (Ensure = "Absent") on the current server. The name is the display name of the service as shown in the Central Admin website. @@ -27,3 +22,17 @@ The name is the display name of the service as shown in the Central Admin websit InstallAccount = $InstallAccount } +.PARAMETER Name + Key - string + The name of the service instance to manage + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to ensure it runs on this server, or absent to ensure it is stopped + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSessionStateService.help.txt b/Modules/xSharePoint/en-us/about_xSPSessionStateService.help.txt index ac4c84fe8..3a79ec0a3 100644 --- a/Modules/xSharePoint/en-us/about_xSPSessionStateService.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSessionStateService.help.txt @@ -1,20 +1,13 @@ -NAME +.NAME xSPSessionStateService -PARAMETERS - DatabaseName (Key, string) - DatabaseServer (Key, string) - Enabled (Required, boolean) - SessionTimeout (Write, uint32) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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, and optionally include the session timeout value. If session timeout is not provided it will default to 60. -EXAMPLE +.EXAMPLE xSPSessionStateService StateServiceApp { @@ -24,3 +17,24 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER DatabaseName + Key - string + The name of the database for the service + +.PARAMETER DatabaseServer + Key - string + The name of the database server for the database + +.PARAMETER Enabled + Required - boolean + Is the state service enabled + +.PARAMETER SessionTimeout + Write - uint32 + What is the timeout on sessions + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPShellAdmins.help.txt b/Modules/xSharePoint/en-us/about_xSPShellAdmins.help.txt index 99744b488..3f4639484 100644 --- a/Modules/xSharePoint/en-us/about_xSPShellAdmins.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPShellAdmins.help.txt @@ -1,16 +1,7 @@ -NAME +.NAME xSPShellAdmins -PARAMETERS - Name (Key, String) - Members (Write, String) - MembersToInclude (Write, String) - MembersToExclude (Write, String) - ContentDatabases (Write, String) - AllContentDatabases (Write, Boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is used to manage the users with Shell Admin permissions. There are a number of approaches to how this can be implemented. @@ -28,7 +19,7 @@ Notes: When this is true, you cannot add it to the Shell Admins (common for AllContentDatabases parameter) and the resource will throw an error. Workaround: Change database owner in SQL Server. -EXAMPLE +.EXAMPLE xSPShellAdmins ShellAdmins { @@ -54,3 +45,32 @@ EXAMPLE } +.PARAMETER Name + Key - String + Name for the config, used for administration purposes + +.PARAMETER Members + Write - String + Exact list of accounts that will have to get Shell Admin permissions + +.PARAMETER MembersToInclude + Write - String + List of all accounts that must be in the Shell Admins group + +.PARAMETER MembersToExclude + Write - String + List of all accounts that are not allowed to have Shell Admin permissions + +.PARAMETER ContentDatabases + Write - String + Shell Admin configuration of Content Databases + +.PARAMETER AllContentDatabases + Write - Boolean + Specify if all content databases must get the same config as the general config + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSite.help.txt b/Modules/xSharePoint/en-us/about_xSPSite.help.txt index 86229eb8a..35cc8159e 100644 --- a/Modules/xSharePoint/en-us/about_xSPSite.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSite.help.txt @@ -1,30 +1,14 @@ -NAME +.NAME xSPSite -PARAMETERS - Url (Key, string) - OwnerAlias (Required, string) - CompatibilityLevel (Write, uint32) - ContentDatabase (Write, string) - Description (Write, string) - HostHeaderWebApplication (Write, string) - Language (Write, uint32) - Name (Write, string) - OwnerEmail (Write, string) - QuotaTemplate (Write, string) - SecondaryEmail (Write, string) - SecondaryOwnerAlias (Write, string) - Template (Write, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 cmdlet and accept the same values and types. The current version of xSharePoint is only able to check for the existence of a site collection, the additional parameters are not checked for yet, but will be in a later release -EXAMPLE +.EXAMPLE xSPSite TeamSite { @@ -36,3 +20,60 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the site collection + +.PARAMETER OwnerAlias + Required - string + The username of the site collection administrator + +.PARAMETER CompatibilityLevel + Write - uint32 + The compatibility level of the site + +.PARAMETER ContentDatabase + Write - string + The name of the content database to create the site in + +.PARAMETER Description + Write - string + The description to apply to the site collection + +.PARAMETER HostHeaderWebApplication + Write - string + The URL of the host header web application to create this site in + +.PARAMETER Language + Write - uint32 + The language code of the site + +.PARAMETER Name + Write - string + The display name of the site collection + +.PARAMETER OwnerEmail + Write - string + The email address of the site collection administrator + +.PARAMETER QuotaTemplate + Write - string + The quota template to apply to the site collection + +.PARAMETER SecondaryEmail + Write - string + The secondary site collection admin email address + +.PARAMETER SecondaryOwnerAlias + Write - string + The secondary site collection admin username + +.PARAMETER Template + Write - string + The template to apply to the site collection + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPStateServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPStateServiceApp.help.txt index 8549522bb..c718dd404 100644 --- a/Modules/xSharePoint/en-us/about_xSPStateServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPStateServiceApp.help.txt @@ -1,19 +1,12 @@ -NAME +.NAME xSPStateServiceApp -PARAMETERS - Name (Key, string) - DatabaseCredentials (Write, String) - DatabaseName (Required, string) - DatabaseServer (Write, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 the app, and will not change database settings beyond the initial deployment. -EXAMPLE +.EXAMPLE xSPStateServiceApp StateServiceApp { @@ -22,3 +15,24 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Name + Key - string + The name of the state service app + +.PARAMETER DatabaseCredentials + Write - String + The database credentials for accessing the database + +.PARAMETER DatabaseName + Required - string + The name of the database for the service app + +.PARAMETER DatabaseServer + Write - string + The name of the database server + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPSubscriptionSettingsServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPSubscriptionSettingsServiceApp.help.txt index de49e3053..0a7c23487 100644 --- a/Modules/xSharePoint/en-us/about_xSPSubscriptionSettingsServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPSubscriptionSettingsServiceApp.help.txt @@ -1,21 +1,14 @@ -NAME +.NAME xSPSubscriptionSettingsServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, String) - DatabaseName (Write, string) - DatabaseServer (Write, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 settings service app through the application display name. Currently the resource will provision the app if it does not yet exist, and will change the service account associated to the app if it does not match the configuration. Database names or server name will not be changed if the configuration does not match, these parameters are only used for the initial provisioning of the service application. -EXAMPLE +.EXAMPLE xSPSubscriptionSettingsServiceApp SubscriptionSettingsServiceApp { @@ -25,3 +18,24 @@ EXAMPLE DatabaseName = "SP_ManagedMetadata" } +.PARAMETER Name + Key - string + The name of the subscription settings service app + +.PARAMETER ApplicationPool + Required - String + The name of the application pool the service app runs in + +.PARAMETER DatabaseName + Write - string + The name of the database for the service app + +.PARAMETER DatabaseServer + Write - String + The name of the database server + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPTimerJobState.help.txt b/Modules/xSharePoint/en-us/about_xSPTimerJobState.help.txt index 4bc7d8751..e3b941422 100644 --- a/Modules/xSharePoint/en-us/about_xSPTimerJobState.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPTimerJobState.help.txt @@ -1,14 +1,7 @@ -NAME +.NAME xSPTimerJobState -PARAMETERS - Name (Key, String) - WebApplication (Write, String) - Enabled (Write, Boolean) - Schedule (Write, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 configure the schedule of the job. @@ -25,7 +18,7 @@ Examples are: NOTE: Make sure you use the internal timer job name, not the display name! Use "Get-SPTimerJob -WebApplication "http://servername" | select Name, DisplayName" to find the internal name for each Timer Job. -EXAMPLE +.EXAMPLE xSPTimerJobState DisableTimerJob_DeadSiteDelete { @@ -36,3 +29,24 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Name + Key - String + The internal name of the timer job (not the display name) + +.PARAMETER WebApplication + Write - String + The name of the web application that the timer job belongs to + +.PARAMETER Enabled + Write - Boolean + Should the timer job be enabled or not + +.PARAMETER Schedule + Write - String + The schedule for the timer job to execute on + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPUsageApplication.help.txt b/Modules/xSharePoint/en-us/about_xSPUsageApplication.help.txt index b37395cc5..0efad666b 100644 --- a/Modules/xSharePoint/en-us/about_xSPUsageApplication.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPUsageApplication.help.txt @@ -1,24 +1,12 @@ -NAME +.NAME xSPUsageApplication -PARAMETERS - Name (Key, string) - InstallAccount (Write, String) - DatabaseName (Write, string) - DatabaseServer (Write, string) - DatabaseCredentials (Write, String) - FailoverDatabaseServer (Write, string) - UsageLogCutTime (Write, uint32) - UsageLogLocation (Write, string) - UsageLogMaxFileSizeKB (Write, uint32) - UsageLogMaxSpaceGB (Write, uint32) - -DESCRIPTION +.SYNOPSIS This resource provisions an instance of the usage and health monitoring service application. The database settings are only used for initial provisioning, but the usage settings can be changed and will be enforced as the resource is executed. -EXAMPLE +.EXAMPLE xSPUsageApplication UsageApplication { @@ -30,3 +18,44 @@ EXAMPLE InstallAccount = $InstallAccount } +.PARAMETER Name + Key - string + The name of the service application + +.PARAMETER DatabaseName + Write - string + The name of the database for the service app + +.PARAMETER DatabaseServer + Write - string + The name of the database server + +.PARAMETER DatabaseCredentials + Write - String + The credentials to use to access the database + +.PARAMETER FailoverDatabaseServer + Write - string + The name of the failover database server + +.PARAMETER UsageLogCutTime + Write - uint32 + The time in minutes to cut over to new log files + +.PARAMETER UsageLogLocation + Write - string + The location on each server to store the log files + +.PARAMETER UsageLogMaxFileSizeKB + Write - uint32 + The maximum file size for log files in KB + +.PARAMETER UsageLogMaxSpaceGB + Write - uint32 + The total space of all log files on disk in GB + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPUserProfileProperty.help.txt b/Modules/xSharePoint/en-us/about_xSPUserProfileProperty.help.txt index a6a3c7728..5cd70a24b 100644 --- a/Modules/xSharePoint/en-us/about_xSPUserProfileProperty.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPUserProfileProperty.help.txt @@ -1,33 +1,7 @@ -NAME +.NAME xSPUserProfileProperty -PARAMETERS - Name (Key, string) - Ensure (write, string, Allowed values: Present, Absent) - UserProfileService (required, string) - DisplayName (write, string) - Type (write, string, Allowed values: BigInteger, Binary, Boolean, Date, DateNoYear, DateTime, Email, Float, Guid, HTML, Integer, Person, String, StringMultiValue, TimeZone, URL) - Description (write, string) - PolicySetting (write, string, Allowed values: Mandatory, Optin, Optout, Disabled) - PrivacySetting (write, string, Allowed values: Public, Contacts, Organization, Manager, Private) - MappingConnectionName (write, string) - MappingPropertyName (write, string) - MappingDirection (write, string) - Length (write, uint32) - DisplayOrder (write, uint32) - IsEventLog (write, boolean) - IsVisibleOnEditor (write, boolean) - IsVisibleOnViewer (write, boolean) - IsUserEditable (write, boolean) - IsAlias (write, boolean) - IsSearchable (write, boolean) - UserOverridePrivacy (write, boolean) - TermStore (write, string) - TermGroup (write, string) - TermSet (write, string) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 it . @@ -39,7 +13,7 @@ Length is only relevant if Field type is "String". This Resource doesn't currently support removing existing user profile properties -EXAMPLE +.EXAMPLE xSPUserProfileProperty WorkEmailProperty { Name = "WorkEmail2" @@ -67,3 +41,104 @@ xSPUserProfileProperty WorkEmailProperty } +.PARAMETER Name + Key - string + The internal name of the user profile property + +.PARAMETER Ensure + Write - string + Allowed values: Present, Absent + Present if the property should exist, absent if it should be removed + +.PARAMETER UserProfileService + Required - string + The name of the user profile service application + +.PARAMETER DisplayName + Write - string + The display name of the property + +.PARAMETER Type + Write - string + Allowed values: BigInteger, Binary, Boolean, Date, DateNoYear, DateTime, Email, Float, Guid, HTML, Integer, Person, String, StringMultiValue, TimeZone, URL + The type of the property + +.PARAMETER Description + Write - string + The description of the property + +.PARAMETER PolicySetting + Write - string + Allowed values: Mandatory, Optin, Optout, Disabled + The policy setting to apply to the property + +.PARAMETER PrivacySetting + Write - string + 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 + 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 + +.PARAMETER Length + Write - uint32 + The length of the field + +.PARAMETER DisplayOrder + Write - uint32 + The display order to put the property in to the list at + +.PARAMETER IsEventLog + Write - boolean + Is this field used for event logging + +.PARAMETER IsVisibleOnEditor + Write - boolean + Is this field visible when editing a users profile, or hidden from editing + +.PARAMETER IsVisibleOnViewer + Write - boolean + Is this field visible when viewing a users profile + +.PARAMETER IsUserEditable + Write - boolean + Is this field able to be edited by a user, or only an administrator + +.PARAMETER IsAlias + Write - boolean + Is this field an alias that can be used to refer to a user by + +.PARAMETER IsSearchable + Write - boolean + Is this field able to be searched upon + +.PARAMETER UserOverridePrivacy + Write - boolean + Can users override the default privacy policy + +.PARAMETER TermStore + Write - string + The name of the term store to look up managed terms from + +.PARAMETER TermGroup + Write - string + The name of the term store group that terms are in for this field + +.PARAMETER TermSet + Write - string + The name of the term set to allow values to be selected from + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPUserProfileServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPUserProfileServiceApp.help.txt index a8ed83351..6aacea1d8 100644 --- a/Modules/xSharePoint/en-us/about_xSPUserProfileServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPUserProfileServiceApp.help.txt @@ -1,27 +1,14 @@ -NAME +.NAME xSPUserProfileServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, string) - FarmAccount (Required, String) - InstallAccount (Write, String) - MySiteHostLocation (Write, string) - ProfileDBName (Write, string) - ProfileDBServer (Write, string) - SocialDBName (Write, string) - SocialDBServer (Write, string) - SyncDBName (Write, string) - SyncDBServer (Write, string) - -DESCRIPTION +.SYNOPSIS 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 in to it (although these are only used during the initial provisioning). The farm account is used during the provisioning of the service only (in the set method), and the install account is used in the get and test methods. This is done to ensure that the databases are created with the correct schema owners and allow the user profile sync service to operate correctly. -EXAMPLE +.EXAMPLE xSPUserProfileServiceApp UserProfileServiceApp { @@ -38,3 +25,48 @@ EXAMPLE PsDscRunAsCredential = $SetupAccount } +.PARAMETER Name + Key - string + The name of the user profile service + +.PARAMETER ApplicationPool + Required - string + The name of the application pool to run the service app in + +.PARAMETER FarmAccount + Required - String + The farm account to use when provisioning the app + +.PARAMETER MySiteHostLocation + Write - string + The URL of the my site host collection + +.PARAMETER ProfileDBName + Write - string + The name of the profile database + +.PARAMETER ProfileDBServer + Write - string + The name of the server to host the profile database + +.PARAMETER SocialDBName + Write - string + The name of the social database + +.PARAMETER SocialDBServer + Write - string + The name of the database server to host the social database + +.PARAMETER SyncDBName + Write - string + The name of the sync database + +.PARAMETER SyncDBServer + Write - string + The name of the database server to host the sync database + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPUserProfileSyncConnection.help.txt b/Modules/xSharePoint/en-us/about_xSPUserProfileSyncConnection.help.txt index f62a3588b..15c03bd21 100644 --- a/Modules/xSharePoint/en-us/about_xSPUserProfileSyncConnection.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPUserProfileSyncConnection.help.txt @@ -1,25 +1,12 @@ -NAME +.NAME xSPUserProfileSyncConnection -PARAMETERS - Name (Key, string) - Forest (Required, string) - UserProfileService (Required, string) - ConnectionCredentials (Required, string) - InstallAccount (Write, string) - IncludedOUs (Required, string) - ExcludedOUs (write, string) - Server (write, string) - UseSSL (Write, boolean) - Force (Write, boolean) - ConnectionType (Write, string, Allowed values: ActiveDirectory, BusinessDataCatalog) - -DESCRIPTION +.SYNOPSIS This resource will ensure a specifc user profile sync connection is in place and that it is configured accordingly to its definition This resource currently supports AD only. -EXAMPLE +.EXAMPLE xSPUserProfileSyncConnection MainDomain { @@ -35,3 +22,49 @@ EXAMPLE ConnectionType = "ActiveDirectory" } +.PARAMETER Name + Key - string + The name of the connection + +.PARAMETER Forest + Required - string + The name of the AD forest to read from + +.PARAMETER UserProfileService + Required - string + The name of the user profile service that this connection is attached to + +.PARAMETER ConnectionCredentials + Required - string + The credentials to connect to Active Directory with + +.PARAMETER IncludedOUs + Required - string + A listo f the OUs to import users from + +.PARAMETER ExcludedOUs + Write - string + A list of the OUs to ignore users from + +.PARAMETER Server + Write - string + The specific AD server to connect to + +.PARAMETER UseSSL + Write - boolean + Should SSL be used for the connection + +.PARAMETER Force + Write - boolean + Set to true to run the set method on every call to this resource + +.PARAMETER ConnectionType + Write - string + Allowed values: ActiveDirectory, BusinessDataCatalog + The type of the connection - currently only Active Directory is supported + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPUserProfileSyncService.help.txt b/Modules/xSharePoint/en-us/about_xSPUserProfileSyncService.help.txt index bed8e8027..16111d798 100644 --- a/Modules/xSharePoint/en-us/about_xSPUserProfileSyncService.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPUserProfileSyncService.help.txt @@ -1,20 +1,14 @@ -NAME +.NAME xSPUserProfileSyncService -PARAMETERS - UserProfileServiceAppName (Key, string) - Ensure (Required, string, Allowed values: Present, Absent) - FarmAccount (Required, String) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS This resource is responsible for ensuring that the user profile sync service has been provisioned (Ensure = "Present") or is not running (Ensure = "Absent") on the current server. This resource uses the InstallAccount to validate the current state only, the set method which will do the provisioning uses the FarmAccount to do the actual work - this means that CredSSP authentication will need to be permitted to allow a connection to the local server. To allow successful provisioning the farm account must be in the local administrators group, however it is not best practice to leave this account in the Administrators group. Therefore this resource will add the FarmAccount credential to the local administrators group at the beginning of the set method, and then remove it once it has completed its work. -EXAMPLE +.EXAMPLE xSPUserProfileSyncService UserProfileSyncService { @@ -24,3 +18,21 @@ EXAMPLE InstallAccount = $InstallAccount } +.PARAMETER UserProfileServiceAppName + Key - string + The name of the user profile service for this sync instance + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to ensure the service is running, absent to ensure it is not + +.PARAMETER FarmAccount + Required - String + The farm account, which is needed to provision the service app + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPVisioServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPVisioServiceApp.help.txt index f19b6fcf6..6cadd5359 100644 --- a/Modules/xSharePoint/en-us/about_xSPVisioServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPVisioServiceApp.help.txt @@ -1,18 +1,23 @@ -NAME +.NAME xSPVisioServiceApp -PARAMETERS - Name (Key, string) - ApplicationPool (Required, string) - -DESCRIPTION +.SYNOPSIS This resource is responsible for creating Visio Graphics Service Application instances within the local SharePoint farm. The resource will provision and configure the Visio Graphics Service Application. -EXAMPLE +.EXAMPLE xSPVisioServiceApp VisioServices { Name = "Visio Graphics Service Application" ApplicationPool = "SharePoint Web Services" } +.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 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebAppBlockedFileTypes.help.txt b/Modules/xSharePoint/en-us/about_xSPWebAppBlockedFileTypes.help.txt index f726bdcb3..1b35ec17a 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebAppBlockedFileTypes.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebAppBlockedFileTypes.help.txt @@ -1,24 +1,17 @@ -NAME +.NAME xSPWebAppBlockedFileTypes -PARAMETERS - Url (Key, string) - Blocked (write, string) - EnsureBlocked (write, string) - EnsureAllowed (write, string) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS This resource is responsible for controlling the blocked file type setting on a specific web application. -It has two modes of operation, the first is to use the 'blocked' property, where you are able to define a specific list of file types that will be blocked. +It has two modes of operation, the first is to use the "blocked" property, where you are able to define a specific list of file types that will be blocked. In this mode when it is detected that the list does not match the local farm, it is set to match this list exactly. -The second mode is to use the 'EnsureBlocked' and 'EnsureAllowed' properties. +The second mode is to use the "EnsureBlocked" and "EnsureAllowed" properties. EnsureBlocked will check to make sure that the specified file types are on the list, and if not they will be added. EnsureAllowed checks to make sure that a file type is not on the list, and if it is it will be removed. Both of these properties will only make changes to the file types in their list and will leave the full list as it is otherwise, whereas the blocked property resets the list in full. -EXAMPLE +.EXAMPLE xSPWebAppBlockedFileTypes PrimaryWebAppBlockedFileTypes { @@ -28,3 +21,24 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the web application to set blocked file types for + +.PARAMETER Blocked + write - string + This is a fixed list to use for blocked file types in this web app + +.PARAMETER EnsureBlocked + write - string + 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 + +.PARAMETER EnsureAllowed + write - string + 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 + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebAppGeneralSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPWebAppGeneralSettings.help.txt index 9ac055e73..7f03afd88 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebAppGeneralSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebAppGeneralSettings.help.txt @@ -1,32 +1,13 @@ -NAME +.NAME xSPWebAppGeneralSettings -PARAMETERS - Url (Key, string) - TimeZone (write, uint32) - Alerts (write, boolean) - AlertsLimit (write, uint32) - RSS (write, boolean) - BlogAPI (write, boolean) - BlogAPIAuthenticated (write, boolean) - BrowserFileHandling (write, String, Allowed values: Strict, Permissive) - SecurityValidation (write, boolean) - RecycleBinEnabled (write, boolean) - RecycleBinCleanupEnabled (write, boolean) - RecycleBinRetentionPeriod (write, uint32) - SecondStageRecycleBinQuota (write, uint32) - MaximumUploadSize (write, uint32) - CustomerExperienceProgram (write, boolean) - PresenceEnabled (write, boolean) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS This resource is responsible for setting web application settings that are found under the "general settings" screen in central admin. The web application is specified through the URL property, and then any combination of settings can be applied. Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). -EXAMPLE +.EXAMPLE xSPWebAppGeneralSettings PrimaryWebAppGeneralSettings { @@ -37,3 +18,73 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the web app to set the general settings for + +.PARAMETER TimeZone + Write - uint32 + 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 + +.PARAMETER Alerts + Write - boolean + Should alerts be enabled for this web app + +.PARAMETER AlertsLimit + Write - uint32 + What is the maximum number of alerts that a user can create in this web app + +.PARAMETER RSS + Write - boolean + Should RSS feeds be enabled in this web app + +.PARAMETER BlogAPI + Write - boolean + Should the Blog API be enabled in this web app + +.PARAMETER BlogAPIAuthenticated + Write - boolean + Is authentication required for the blog API + +.PARAMETER BrowserFileHandling + Write - String + Allowed values: Strict, Permissive + What file handling mode should be used in this web app - strict or permissive + +.PARAMETER SecurityValidation + Write - boolean + Is security validation enforced in this web app + +.PARAMETER RecycleBinEnabled + Write - boolean + Is the recycle bin enabled in this web application + +.PARAMETER RecycleBinCleanupEnabled + Write - boolean + Is automatic cleanup of the recycle bin enabled in this web app + +.PARAMETER RecycleBinRetentionPeriod + Write - uint32 + How many days does the recycle bin keep content for + +.PARAMETER SecondStageRecycleBinQuota + Write - uint32 + How much content does the second stage recycle bin keep content for + +.PARAMETER MaximumUploadSize + Write - uint32 + What is the maximum file upload size for this web app (in MB) + +.PARAMETER CustomerExperienceProgram + Write - boolean + Should the customer experience program be enabled in this web app + +.PARAMETER PresenceEnabled + Write - boolean + Is Skype for Business presence enabled for this web app + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebAppPolicy.help.txt b/Modules/xSharePoint/en-us/about_xSPWebAppPolicy.help.txt index 890f39792..156bd476f 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebAppPolicy.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebAppPolicy.help.txt @@ -1,18 +1,11 @@ -NAME +.NAME xSPWebAppPolicy -PARAMETERS - WebAppUrl (Key, string) - UserName (Key, string) - PermissionLevel (Required, string, Allowed values: Deny All, Deny Write, Full Read, Full Control) - ActAsSystemUser (Write, boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 [Configure object cache user accounts in SharePoint Server 2013](https://technet.microsoft.com/en-us/library/ff758656.aspx)). -EXAMPLE +.EXAMPLE xSPCacheAccounts SetCacheAccounts { @@ -22,3 +15,25 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER WebAppUrl + Key - string + The URL of the web application + +.PARAMETER UserName + Key - string + The username for the policy + +.PARAMETER PermissionLevel + Required - string + Allowed values: Deny All, Deny Write, Full Read, Full Control + The policy to apply + +.PARAMETER ActAsSystemUser + Write - boolean + Should this user be treated as a system account + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebAppSiteUseAndDeletion.help.txt b/Modules/xSharePoint/en-us/about_xSPWebAppSiteUseAndDeletion.help.txt index 9119180e2..366cf02bd 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebAppSiteUseAndDeletion.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebAppSiteUseAndDeletion.help.txt @@ -1,20 +1,12 @@ -NAME +.NAME xSPWebAppSiteUseAndDeletion -PARAMETERS - Url (Key, string) - SendUnusedSiteCollectionNotifications (write, boolean) - UnusedSiteNotificationPeriod (write, uint32) - AutomaticallyDeleteUnusedSiteCollections (write, boolean) - UnusedSiteNotificationsBeforeDeletion (write, uint32) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS 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 days this has to be done. -EXAMPLE +.EXAMPLE xSPWebAppSiteUseAndDeletion ConfigureSiteUseAndDeletion { @@ -26,3 +18,28 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the web application + +.PARAMETER SendUnusedSiteCollectionNotifications + Write - boolean + Should emails be sent to notify site owners of unused site collections + +.PARAMETER UnusedSiteNotificationPeriod + Write - uint32 + How many days should pass before a site is flagged as unused + +.PARAMETER AutomaticallyDeleteUnusedSiteCollections + Write - boolean + Should unused site collection be automatically deleted + +.PARAMETER UnusedSiteNotificationsBeforeDeletion + Write - uint32 + How many days before an unused site is deleted should an email be sent to the owner + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebAppThrottlingSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPWebAppThrottlingSettings.help.txt index b56203227..2fd1998b9 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebAppThrottlingSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebAppThrottlingSettings.help.txt @@ -1,22 +1,7 @@ -NAME +.NAME xSPWebAppThrottlingSettings -PARAMETERS - Url (Key, string) - ListViewThreshold (write, uint32) - AllowObjectModelOverride (write, boolean) - AdminThreshold (write, uint32) - ListViewLookupThreshold (write, uint32) - HappyHourEnabled (write, boolean) - HappyHour (Write, string) - UniquePermissionThreshold (write, uint32) - RequestThrottling (write, boolean) - ChangeLogEnabled (write, boolean) - ChangeLogExpiryDays (write, uint32) - EventHandlersEnabled (write, boolean) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS This resource is responsible for setting web application settings that are found under the "resource throttling" screen in central admin. The web application is specified through the URL property, and then any combination of settings can be applied. @@ -24,7 +9,7 @@ Any settings not included will be left as the default (or whatever they have bee Happy hour is the setting used to control the window where threshold do not apply throughout the day. You can specify the start time of this window as well as how many hours it will last. -EXAMPLE +.EXAMPLE xSPWebAppThrottlingSettings PrimaryWebAppThrottlingSettings { @@ -40,3 +25,56 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the web application + +.PARAMETER ListViewThreshold + Write - uint32 + What should the list view threshold for this site be set to + +.PARAMETER AllowObjectModelOverride + Write - boolean + Should object model code be able to be override the list view threshold + +.PARAMETER AdminThreshold + Write - uint32 + What is the list view threshold for site administrators + +.PARAMETER ListViewLookupThreshold + Write - uint32 + What is the maximum number of lookup fields in a single list view + +.PARAMETER HappyHourEnabled + Write - boolean + Should the happy hour window be enabled for this web app + +.PARAMETER HappyHour + Write - string + The time window for happy hour + +.PARAMETER UniquePermissionThreshold + Write - uint32 + What is the limit for unique permissions on a single object in this web app + +.PARAMETER RequestThrottling + Write - boolean + Is request throttling enabled on this web app + +.PARAMETER ChangeLogEnabled + Write - boolean + Is the change log enabled for this web app + +.PARAMETER ChangeLogExpiryDays + Write - uint32 + How many days does the change log store data for + +.PARAMETER EventHandlersEnabled + Write - boolean + Are event handlers enabled in the web application + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebAppWorkflowSettings.help.txt b/Modules/xSharePoint/en-us/about_xSPWebAppWorkflowSettings.help.txt index 1b8513563..f66625561 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebAppWorkflowSettings.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebAppWorkflowSettings.help.txt @@ -1,20 +1,13 @@ -NAME +.NAME xSPWebAppWorkflowSettings -PARAMETERS - Url (Key, string) - ExternalWorkflowParticipantsEnabled (write, boolean) - UserDefinedWorkflowsEnabled (write, boolean) - EmailToNoPermissionWorkflowParticipantsEnable (write, boolean) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS This resource is responsible for setting web application settings that are found under the "workflow settings" screen in central admin. The web application is specified through the URL property, and then any combination of settings can be applied. Any settings not included will be left as the default (or whatever they have been manually changed to within SharePoint). -EXAMPLE +.EXAMPLE xSPWebAppWorkflowSettings PrimaryWebAppWorkflowSettings { @@ -24,3 +17,24 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Url + Key - string + The URL of the web application + +.PARAMETER ExternalWorkflowParticipantsEnabled + Write - boolean + Are external workflow participants enabled in the web app + +.PARAMETER UserDefinedWorkflowsEnabled + Write - boolean + Are user defined workflows enabled in this web app + +.PARAMETER EmailToNoPermissionWorkflowParticipantsEnable + Write - boolean + Are documents sent via email to external participants of workflow + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebApplication.help.txt b/Modules/xSharePoint/en-us/about_xSPWebApplication.help.txt index 0810cc7c8..79ab329b1 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebApplication.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebApplication.help.txt @@ -1,26 +1,12 @@ -NAME +.NAME xSPWebApplication -PARAMETERS - Name (Key, string) - ApplicationPool (Required, string) - ApplicationPoolAccount (Required, string) - Url (Required, string) - AllowAnonymous (Write, boolean) - AuthenticationMethod (Write, string, Allowed values: NTLM, Kerberos) - DatabaseName (Write, string) - DatabaseServer (Write, string) - HostHeader (Write, string) - Path (Write, string) - Port (Write, string) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS This resource is responsible for creating a web application within the local SharePoint farm. The resource will provision the web application with all of the current settings, and then ensure that it stays part of the correct application pool beyond that (additional checking and setting of properties will be added in future releases). -EXAMPLE +.EXAMPLE xSPWebApplication HostNameSiteCollectionWebApp { @@ -36,3 +22,57 @@ EXAMPLE PsDscRunAsCredential = $InstallAccount } +.PARAMETER Name + Key - string + The name of the web application + +.PARAMETER ApplicationPool + Required - string + The name of the application pool to run this site in + +.PARAMETER ApplicationPoolAccount + Required - string + The name of the managed account to run the app pool with + +.PARAMETER Url + Required - string + The URL of the web application + +.PARAMETER AllowAnonymous + Write - boolean + Should anonymous access be enabled for this web app + +.PARAMETER AuthenticationMethod + Write - string + Allowed values: NTLM, Kerberos + What authentication mode should be used for the web app + +.PARAMETER DatabaseName + Write - string + The name of the first content database to be created with this web app + +.PARAMETER DatabaseServer + Write - string + The name of the database server to host the default content DB + +.PARAMETER HostHeader + Write - string + The host header to use for the web app + +.PARAMETER Path + Write - string + The path on the local servers to host the IIS web site from + +.PARAMETER Port + Write - string + The port to run the site on + +.PARAMETER UseSSL + Write - boolean + Should this web app use SSL + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWebApplicationAppDomain.help.txt b/Modules/xSharePoint/en-us/about_xSPWebApplicationAppDomain.help.txt index 09814c517..878683c6f 100644 --- a/Modules/xSharePoint/en-us/about_xSPWebApplicationAppDomain.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWebApplicationAppDomain.help.txt @@ -1,22 +1,14 @@ -NAME +.NAME xSPWebApplicationAppDomain -PARAMETERS - WebApplication (Key, string) - Zone (Key, string, Allowed values: Default, Internet, Intranet, Extranet, Custom) - AppDomain (Required, string) - Port (Write, string) - SSL (Write, boolean) - InstallAccount (Write, String) - -DESCRIPTION +.SYNOPSIS 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 application, allowing for the setting of unique app domains for each extension of a web application. The app prefix should still be set using the xSPAppDomain resource before this is applied to customise a specific zone. -EXAMPLE +.EXAMPLE xSPWebApplicationAppDomain Domain { @@ -29,3 +21,29 @@ EXAMPLE } +.PARAMETER WebApplication + Key - string + The URL of the web application to set the app domain for + +.PARAMETER Zone + Key - string + Allowed values: Default, Internet, Intranet, Extranet, Custom + The zone that this app domain applies to + +.PARAMETER AppDomain + Required - string + The domain for apps in this web app zone + +.PARAMETER Port + Write - string + The port to run apps on + +.PARAMETER SSL + Write - boolean + Should apps run under SSL + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWordAutomationServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPWordAutomationServiceApp.help.txt index 7aa2c5d23..3ddf45180 100644 --- a/Modules/xSharePoint/en-us/about_xSPWordAutomationServiceApp.help.txt +++ b/Modules/xSharePoint/en-us/about_xSPWordAutomationServiceApp.help.txt @@ -1,28 +1,7 @@ -NAME +.NAME xSPWordAutomationServiceApp -PARAMETERS - Name (Key, string) - Ensure (Required, string, Allowed values: Present, Absent) - ApplicationPool (Write, string) - DatabaseName (Write, string) - DatabaseServer (Write, string) - SupportedFileFormats (Write, string, Allowed values: docx, doc, mht, rtf, xml) - DisableEmbeddedFonts (Write, boolean) - MaximumMemoryUsage (Write, uint32) - RecycleThreshold (Write, uint32) - DisableBinaryFileScan (Write, boolean) - ConversionProcesses (Write, uint32) - JobConversionFrequency (Write, uint32) - NumberOfConversionsPerProcess (Write, uint32) - TimeBeforeConversionIsMonitored (Write, uint32) - MaximumConversionAttempts (Write, uint32) - MaximumSyncConversionRequests (Write, uint32) - KeepAliveTimeout (Write, uint32) - MaximumConversionTime (Write, uint32) - InstallAccount (Write, string) - -DESCRIPTION +.SYNOPSIS The resource is able to provision, unprovision and configure the Word Automation Service Application. All settings that you can configure on the Service Application administration page are configurable using this resource. @@ -31,7 +10,7 @@ Important: When you specify Ensure=Present, the Application Pool and DatabaseName parameters are required. When you specify Ensure=Absent, no other parameters are allowed (with the exception of Name, InstallAccount or PsDscRunAsCredential). -EXAMPLE +.EXAMPLE Make sure the service application exists and has a specific configuration @@ -67,3 +46,82 @@ Make sure the service application does not exist and remove when it does PsDscRunAsCredential = $InstallAccount } +.PARAMETER Name + Key - string + THe name of the service application + +.PARAMETER Ensure + Required - string + Allowed values: Present, Absent + Present to ensure the app exists, absent to ensure that it does not + +.PARAMETER ApplicationPool + Write - string + The name of the application pool to run the service app in + +.PARAMETER DatabaseName + Write - string + The name of the database for the service app + +.PARAMETER DatabaseServer + Write - string + The name of the server that will host the database + +.PARAMETER SupportedFileFormats + Write - string + Allowed values: docx, doc, mht, rtf, xml + The list of supported file types + +.PARAMETER DisableEmbeddedFonts + Write - boolean + Should embedded fonts be disabled + +.PARAMETER MaximumMemoryUsage + Write - uint32 + What is the maximum amount of memory the service app should use (in MB) + +.PARAMETER RecycleThreshold + Write - uint32 + What is the recycle threshold for this service app + +.PARAMETER DisableBinaryFileScan + Write - boolean + Should binary file scans be disabled + +.PARAMETER ConversionProcesses + Write - uint32 + How many conversion processes can be run at once + +.PARAMETER JobConversionFrequency + Write - uint32 + How frequently should new jobs be started from the queue (in minutes) + +.PARAMETER NumberOfConversionsPerProcess + Write - uint32 + How many document conversions should be included in a single process + +.PARAMETER TimeBeforeConversionIsMonitored + Write - uint32 + How long can a conversion be run before it becomes monitored + +.PARAMETER MaximumConversionAttempts + Write - uint32 + What is the maximum number of attempts to convert a document + +.PARAMETER MaximumSyncConversionRequests + Write - uint32 + What is the maximum number of sync conversion requests for the service app + +.PARAMETER KeepAliveTimeout + Write - uint32 + How long is the keep alive timeout set to for the service app + +.PARAMETER MaximumConversionTime + Write - uint32 + What is the maximum time in seconds for a document conversion to be allowed to run + +.PARAMETER InstallAccount + Write - string + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/en-us/about_xSPWorkManagementServiceApp.help.txt b/Modules/xSharePoint/en-us/about_xSPWorkManagementServiceApp.help.txt new file mode 100644 index 000000000..ffd4dbe08 --- /dev/null +++ b/Modules/xSharePoint/en-us/about_xSPWorkManagementServiceApp.help.txt @@ -0,0 +1,66 @@ +.NAME + xSPWorkManagementServiceApp + +.SYNOPSIS + +This resource is used to provision and manage an instance of the Work Management Services Service Application. +It will identify an instance of the work management service application through the application display name. +Currently the resource will provision the app if it does not yet exist, and will change the application pool associated to the app if it does not match the configuration. + + +Remarks +- Parameters MinimumTimeBetweenEwsSyncSubscriptionSearches, MinimumTimeBetweenProviderRefreshes, MinimumTimeBetweenSearchQueries are in Minutes + + + +.EXAMPLE + + xSPWorkManagementServiceApp WorkManagementServiceApp + { + Name = "App Management Service Application" + ApplicationPool = "SharePoint web services" + MinimumTimeBetweenEwsSyncSubscriptionSearches = 10 +} + +.PARAMETER Name + Key - string + The name of the work management service application + +.PARAMETER Ensure + write - string + Allowed values: Present, Absent + Present to ensure the app exists, absent to ensure it is removed + +.PARAMETER ApplicationPool + write - String + The name of the application pool this will run in + +.PARAMETER MinimumTimeBetweenEwsSyncSubscriptionSearches + Write - uint32 + The minimum amount of time bween EWS sync subscription searches + +.PARAMETER MinimumTimeBetweenProviderRefreshes + Write - uint32 + The minimum time between provider refreshes + +.PARAMETER MinimumTimeBetweenSearchQueries + Write - uint32 + The minimum time between search queries + +.PARAMETER NumberOfSubscriptionSyncsPerEwsSyncRun + Write - uint32 + The number of subscription syncronisations per EWS sync run + +.PARAMETER NumberOfUsersEwsSyncWillProcessAtOnce + Write - uint32 + How many users will EWS calls include at once + +.PARAMETER NumberOfUsersPerEwsSyncBatch + Write - uint32 + How many users are included in a batch for EWS + +.PARAMETER InstallAccount + Write - String + POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsAccount if using PowerShell 5 + + diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 81741fa53..09cbf1f00 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '0.11.0.0' +ModuleVersion = '0.12.0.0' # ID used to uniquely identify this module GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90' diff --git a/Modules/xSharePoint/xSharePoint.pssproj b/Modules/xSharePoint/xSharePoint.pssproj deleted file mode 100644 index 74d749bea..000000000 --- a/Modules/xSharePoint/xSharePoint.pssproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - Debug - 2.0 - 6CAFC0C6-A428-4d30-A9F9-700E829FEA51 - Exe - MyApplication - MyApplication - xSharePoint - xSharePoint.psd1 - - - - - - - - - - - - - - - - - - - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 6ce37fa10..f8830b67a 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,21 @@ Additional detailed documentation is included on the wiki on GitHub. ## Version History -### Unreleased +### 0.12.0.0 + + * Removed Visual Studio project files, added VSCode PowerShell extensions launch file + * Added xSPDatabaseAAG, xSPFarmSolution and xSPAlternateUrl resources + * Fixed bug with xSPWorkManagementServiceApp schema + * Added support to xSPSearchServiceApp to configure the default content access account + * Added support for SSL web apps to xSPWebApplication + * Added support for xSPDistributedCacheService to allow provisionin across multiple servers in a specific sequence + * Added version as optional parameter for the xSPFeature resource to allow upgrading features to a specific version + * Fixed a bug with xSPUserProfileSyncConnection to ensure it gets the correct context + * Added MOF descriptions to all resources to improve editing experience in PowerShell ISE + * Added a check to warn about issue when installing SharePoint 2013 on a server with .NET 4.6 installed + * Updated examples to include installation resources + * Fixed issues with kerberos and anonymous access in xSPWebApplication + * Add support for SharePoint 2016 on Windows Server 2016 Technical Preview to xSPInstallPrereqs ### 0.11.0.0 @@ -137,7 +151,7 @@ Additional detailed documentation is included on the wiki on GitHub. ### 0.4.0 -* Fixed issue with nested modules� cmdlets not being found +* Fixed issue with nested modules cmdlets not being found ### 0.3.0 diff --git a/RunPesterTests.ps1 b/RunPesterTests.ps1 new file mode 100644 index 000000000..0733645fd --- /dev/null +++ b/RunPesterTests.ps1 @@ -0,0 +1,2 @@ +Import-Module (Join-Path $PSScriptRoot "Tests\xSharePoint.TestHarness.psm1") +Invoke-xSharePointTests \ No newline at end of file diff --git a/Tests/Generate-xSharePointHelpFiles.ps1 b/Tests/Generate-xSharePointHelpFiles.ps1 index a767f237f..d6c2055e9 100644 --- a/Tests/Generate-xSharePointHelpFiles.ps1 +++ b/Tests/Generate-xSharePointHelpFiles.ps1 @@ -14,25 +14,28 @@ Get-ChildItem "$repoDir\modules\xSharePoint\**\*.schema.mof" -Recurse | ` if ($result -ne $null) { Write-Output "Generating help document for $($result.FriendlyName)" - $output = "NAME" + [Environment]::NewLine + $output = ".NAME" + [Environment]::NewLine $output += " $($result.FriendlyName)" + [Environment]::NewLine + [Environment]::NewLine - $output += "PARAMETERS" + [Environment]::NewLine + + $output += $result.Documentation.Replace("**Description**", ".SYNOPSIS").Replace("**Example**",".EXAMPLE") + [Environment]::NewLine foreach($property in $result.Attributes) { - $output += " $($property.Name) ($($property.State), $($property.DataType)" + + $output += ".PARAMETER $($property.Name)" + [Environment]::NewLine + $output += " $($property.State) - $($property.DataType)" + [Environment]::NewLine + if ([string]::IsNullOrEmpty($property.ValueMap) -ne $true) { - $output += ", Allowed values: " + $output += " Allowed values: " $property.ValueMap | ForEach-Object { $output += $_ + ", " } $output = $output.TrimEnd(" ") $output = $output.TrimEnd(",") + $output += [Environment]::NewLine } - $output += ")" + [Environment]::NewLine + $output += " " + $property.Description + [Environment]::NewLine + [Environment]::NewLine } - $output += [Environment]::NewLine + $result.Documentation.Replace("**Description**", "DESCRIPTION").Replace("**Example**","EXAMPLE") - $output | Out-File -FilePath (Join-Path $OutPutPath "about_$($result.FriendlyName).help.txt") -Encoding utf8 -Force } } \ No newline at end of file diff --git a/Tests/Generate-xSharePointWikiPages.ps1 b/Tests/Generate-xSharePointWikiPages.ps1 index 144042cae..7dec70a6a 100644 --- a/Tests/Generate-xSharePointWikiPages.ps1 +++ b/Tests/Generate-xSharePointWikiPages.ps1 @@ -14,21 +14,19 @@ Get-ChildItem "$repoDir\modules\xSharePoint\**\*.schema.mof" -Recurse | ` Write-Output "Generating wiki page for $($result.FriendlyName)" $output = "**Parameters**" + [Environment]::NewLine + [Environment]::NewLine - + $output += "| Parameter | Attribute | DataType | Description | Allowed Values |" + [Environment]::NewLine + $output += "| --- | --- | --- | --- | --- |" + [Environment]::NewLine foreach($property in $result.Attributes) { - $output += " - $($property.Name) ($($property.State), $($property.DataType)" + $output += "| **$($property.Name)** | $($property.State) | $($property.DataType) | $($property.Description) | " if ([string]::IsNullOrEmpty($property.ValueMap) -ne $true) { - $output += ", Allowed values: " $property.ValueMap | ForEach-Object { $output += $_ + ", " } $output = $output.TrimEnd(" ") $output = $output.TrimEnd(",") } - $output += ")" + [Environment]::NewLine + $output += "|" + [Environment]::NewLine } - $output += [Environment]::NewLine + $result.Documentation - $output | Out-File -FilePath (Join-Path $OutPutPath "$($result.FriendlyName).md") -Encoding utf8 -Force } \ No newline at end of file diff --git a/Tests/Tests.pssproj b/Tests/Tests.pssproj deleted file mode 100644 index 66639efd2..000000000 --- a/Tests/Tests.pssproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - 2.0 - {279294c4-e197-48cd-a1fb-263ce47dea4d} - Exe - MyApplication - MyApplication - Tests - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 b/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 index c31a32698..e49922fb2 100644 --- a/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 +++ b/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 @@ -61,6 +61,7 @@ function Get-MofSchemaObject() { ValueMap = $null DataType = $null Name = $null + Description = $null IsArray = $false } @@ -83,6 +84,11 @@ function Get-MofSchemaObject() { $valueMap = $textLine.Substring($start, $end - $start) $attributeValue.ValueMap = $valueMap.Replace("`"", "").Split(",") } + if ($_.Trim().StartsWith("Description")) { + $start = $textLine.IndexOf("Description(`"") + 13 + $end = $textLine.IndexOf("`")", $start) + $attributeValue.Description = $textLine.Substring($start, $end - $start) + } } $nonMetadata = $textLine.Replace(";","").Substring($metadataEnd + 1) diff --git a/Tests/xSharePoint/xSharePoint.xSPAlternateUrl.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPAlternateUrl.Tests.ps1 new file mode 100644 index 000000000..9f8112de4 --- /dev/null +++ b/Tests/xSharePoint/xSharePoint.xSPAlternateUrl.Tests.ps1 @@ -0,0 +1,126 @@ +[CmdletBinding()] +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) + +$ErrorActionPreference = 'stop' +Set-StrictMode -Version latest + +$RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule + +$ModuleName = "MSFT_xSPAlternateUrl" +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") + +Describe "xSPAlternateUrl" { + InModuleScope $ModuleName { + $testParams = @{ + WebAppUrl = "http://test.constoso.local" + Zone = "Default" + Ensure = "Present" + Url = "http://something.contoso.local" + } + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + + Mock New-SPAlternateURL {} + Mock Set-SPAlternateURL {} + Mock Remove-SPAlternateURL {} + + Context "No alternate URL exists for the specified zone and web app, and there should be" { + + Mock Get-SPAlternateUrl { + return @() + } + + it "returns an empty URL in the get method" { + (Get-TargetResource @testParams).Url | Should BeNullOrEmpty + } + + it "return false from the test method" { + Test-targetResource @testParams | Should Be $false + } + + it "calls the new function in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPAlternateURL + } + } + + Context "A URL exists for the specified zone and web app, but the URL is wrong" { + + Mock Get-SPAlternateUrl { + return @( + @{ + IncomingUrl = $testParams.WebAppUrl + Zone = $testParams.Zone + PublicUrl = "http://wrong.url" + } + ) + } + + it "returns the wrong URL in the get method" { + (Get-TargetResource @testParams).Url | Should Not Be $testParams.Url + } + + it "returns false from the test method" { + Test-targetResource @testParams | Should Be $false + } + + it "calls the set cmdlet from the set method" { + Set-TargetResource @testParams + Assert-MockCalled Set-SPAlternateURL + } + } + + Context "A URL exists for the specified zone and web app, and it is correct" { + + Mock Get-SPAlternateUrl { + return @( + @{ + IncomingUrl = $testParams.WebAppUrl + Zone = $testParams.Zone + PublicUrl = $testParams.Url + } + ) + } + + it "returns the correct URL in the get method" { + (Get-TargetResource @testParams).Url | Should Be $testParams.Url + } + + it "returns true from the test method" { + Test-targetResource @testParams | Should Be $true + } + } + + Context "A URL exists for the specified zone and web app, and it is correct" { + + Mock Get-SPAlternateUrl { + return @( + @{ + IncomingUrl = $testParams.WebAppUrl + Zone = $testParams.Zone + PublicUrl = $testParams.Url + } + ) + } + $testParams.Ensure = "Absent" + + it "returns false from the test method" { + Test-targetResource @testParams | Should Be $false + } + + it "calls the remove cmdlet from the set method" { + Set-TargetResource @testParams + Assert-MockCalled Remove-SPAlternateURL + } + } + } +} + diff --git a/Tests/xSharePoint/xSharePoint.xSPDatabaseAAG.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDatabaseAAG.Tests.ps1 new file mode 100644 index 000000000..82decc929 --- /dev/null +++ b/Tests/xSharePoint/xSharePoint.xSPDatabaseAAG.Tests.ps1 @@ -0,0 +1,155 @@ +[CmdletBinding()] +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) + +$ErrorActionPreference = 'stop' +Set-StrictMode -Version latest + +$RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule + +$ModuleName = "MSFT_xSPDatabaseAAG" +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") + +Describe "xSPDatabaseAAG" { + InModuleScope $ModuleName { + $testParams = @{ + DatabaseName = "SampleDatabase" + AGName = "AGName" + Ensure = "Present" + } + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + + Mock Add-DatabaseToAvailabilityGroup { } + Mock Remove-DatabaseFromAvailabilityGroup { } + + Context "The database is not in an availability group, but should be" { + Mock Get-SPDatabase { + return @( + @{ + Name = $testParams.DatabaseName + AvailabilityGroup = $null + } + ) + } + + it "returns the current values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + it "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + it "calls the add cmdlet in the set method" { + Set-TargetResource @testParams + Assert-MockCalled Add-DatabaseToAvailabilityGroup + } + } + + Context "The database is not in the availability group and should not be" { + $testParams.Ensure = "Absent" + Mock Get-SPDatabase { + return @( + @{ + Name = $testParams.DatabaseName + AvailabilityGroup = $null + } + ) + } + + it "returns the current values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + it "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "The database is in the correct availability group and should be" { + $testParams.Ensure = "Present" + Mock Get-SPDatabase { + return @( + @{ + Name = $testParams.DatabaseName + AvailabilityGroup = @{ + Name = $testParams.AGName + } + } + ) + } + + it "returns the current values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + it "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "The database is in an availability group and should not be" { + $testParams.Ensure = "Absent" + Mock Get-SPDatabase { + return @( + @{ + Name = $testParams.DatabaseName + AvailabilityGroup = @{ + Name = $testParams.AGName + } + } + ) + } + + it "returns the current values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + it "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + it "calls the remove cmdlet in the set method" { + Set-TargetResource @testParams + Assert-MockCalled Remove-DatabaseFromAvailabilityGroup + } + } + + Context "The database is in the wrong availability group" { + $testParams.Ensure = "Present" + Mock Get-SPDatabase { + return @( + @{ + Name = $testParams.DatabaseName + AvailabilityGroup = @{ + Name = "WrongAAG" + } + } + ) + } + + it "returns the current values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + it "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + it "calls the remove and add cmdlets in the set method" { + Set-TargetResource @testParams + Assert-MockCalled Remove-DatabaseFromAvailabilityGroup + Assert-MockCalled Add-DatabaseToAvailabilityGroup + } + } + } +} + diff --git a/Tests/xSharePoint/xSharePoint.xSPFarmSolution.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFarmSolution.Tests.ps1 new file mode 100644 index 000000000..16a128440 --- /dev/null +++ b/Tests/xSharePoint/xSharePoint.xSPFarmSolution.Tests.ps1 @@ -0,0 +1,257 @@ +[CmdletBinding()] +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) + +$ErrorActionPreference = 'stop' +Set-StrictMode -Version latest + +$RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule + +$ModuleName = "MSFT_xSPFarmSolution" +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") + +Describe "xSPFarmSolution" { + + InModuleScope $ModuleName { + + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + $testParams = @{ + Name = "SomeSolution" + LiteralPath = "\\server\share\file.wsp" + Deployed = $true + Ensure = "Present" + Version = "1.0.0.0" + WebApplications = @("http://app1", "http://app2") + Verbose = $true + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + + Context "The solution isn't installed, but should be" { + + $global:SolutionAdded = $false + Mock Get-SPSolution { + if ($global:SolutionAdded) { + return [pscustomobject] @{ } + }else{ + return $null + } + } -Verifiable + Mock Add-SPSolution { + $solution = [pscustomobject] @{ Properties = @{ Version = "" }} + $solution | Add-Member -Name Update -MemberType ScriptMethod -Value { } + $global:SolutionAdded = $true + return $solution + } -Verifiable + Mock Install-SPSolution { } -Verifiable + Mock WaitFor-SolutionJob { } -Verifiable + + $getResults = Get-TargetResource @testParams + + It "returns the expected empty values from the get method" { + $getResults.Ensure | Should Be "Absent" + $getResults.Version | Should Be "0.0.0.0" + $getResults.Deployed | Should Be $false + } + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "uploads and installes the solution to the farm" { + Set-TargetResource @testParams + + Assert-MockCalled Add-SPSolution + Assert-MockCalled Install-SPSolution + Assert-MockCalled WaitFor-SolutionJob + } + } + + Context "The solution is installed, but should not be"{ + + $testParams.Ensure = "Absent" + + Mock Get-SPSolution { + return [pscustomobject]@{ + Deployed = $true + Properties = @{ Version = "1.0.0.0" } + DeployedWebApplications = @( [pscustomobject]@{Url="http://app1"}, [pscustomobject]@{Url="http://app2"}) + ContainsGlobalAssembly = $true + } + } -Verifiable + + Mock Uninstall-SPSolution { } -Verifiable + Mock WaitFor-SolutionJob { } -Verifiable + Mock Remove-SPSolution { } -Verifiable + + + $getResults = Get-TargetResource @testParams + + It "returns the expected values from the get method" { + $getResults.Ensure | Should Be "Present" + $getResults.Version | Should Be "1.0.0.0" + $getResults.Deployed | Should Be $true + } + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "uninstalles and removes the solution from the web apps and the farm" { + Set-TargetResource @testParams + + Assert-MockCalled Uninstall-SPSolution + Assert-MockCalled WaitFor-SolutionJob + Assert-MockCalled Remove-SPSolution + } + } + + Context "The solution isn't installed, and should not be"{ + + $testParams = @{ + Name = "SomeSolution" + LiteralPath = "\\server\share\file.wsp" + Deployed = $false + Ensure = "Absent" + Version = "0.0.0.0" + WebApplications = @() + } + + Mock Get-SPSolution { $null } -Verifiable + + $getResults = Get-TargetResource @testParams + + It "returns the expected empty values from the get method" { + $getResults.Ensure | Should Be "Absent" + $getResults.Version | Should Be "0.0.0.0" + $getResults.Deployed | Should Be $false + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "The solution is installed, but needs update"{ + + $testParams.Version = "1.1.0.0" + $testParams.Ensure = "Present" + + Mock Get-SPSolution { + $s = [pscustomobject]@{ + Deployed = $true + 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 + + Mock Update-SPSolution { } -Verifiable + Mock WaitFor-SolutionJob { } -Verifiable + Mock Install-SPFeature { } -Verifiable + + $getResults = Get-TargetResource @testParams + + It "returns the expected values from the get method" { + $getResults.Ensure | Should Be "Present" + $getResults.Version | Should Be "1.0.0.0" + $getResults.Deployed | Should Be $true + } + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "updates the solution in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled Update-SPSolution + Assert-MockCalled Install-SPFeature + Assert-MockCalled WaitFor-SolutionJob + } + } + + Context "The solution is installed, and should be"{ + + $testParams.Version = "1.0.0.0" + $testParams.Ensure = "Present" + + Mock Get-SPSolution { + return [pscustomobject]@{ + Deployed = $true + Properties = @{ Version = "1.0.0.0" } + DeployedWebApplications = @( [pscustomobject]@{Url="http://app1"}, [pscustomobject]@{Url="http://app2"}) + ContainsGlobalAssembly = $true + } + } + + $getResults = Get-TargetResource @testParams + + It "returns the expected values from the get method" { + $getResults.Ensure | Should Be "Present" + $getResults.Version | Should Be "1.0.0.0" + $getResults.Deployed | Should Be $true + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "The solution exists but is not deloyed, and needs update"{ + + $testParams.Version = "1.1.0.0" + $testParams.Ensure = "Present" + + $solution = [pscustomobject]@{ + Deployed = $false + 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 Get-SPSolution { $solution } + + $getResults = Get-TargetResource @testParams + + Mock Remove-SPSolution { } -Verifiable + Mock Add-SPSolution { $solution } -Verifiable + + Mock Install-SPSolution { } -Verifiable + Mock WaitFor-SolutionJob { } -Verifiable + + $getResults = Get-TargetResource @testParams + + It "returns the expected values from the get method" { + $getResults.Ensure | Should Be "Present" + $getResults.Version | Should Be "1.0.0.0" + $getResults.Deployed | Should Be $false + } + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "updates the solution in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled Remove-SPSolution + Assert-MockCalled Add-SPSolution + Assert-MockCalled Install-SPSolution + Assert-MockCalled WaitFor-SolutionJob + } + } + } +} diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index f43987dcf..737f807c5 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -20,11 +20,12 @@ Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName Describe "xSPFeature" { InModuleScope $ModuleName { $testParams = @{ - Name = "DemoFeature" + Name = "DemoFeature" FeatureScope = "Farm" - Url = "http://site.sharepoint.com" - Ensure = "Present" + Url = "http://site.sharepoint.com" + Ensure = "Present" } + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Invoke-xSharePointCommand { @@ -146,5 +147,29 @@ Describe "xSPFeature" { Test-TargetResource @testParams | Should Be $true } } + + Context "A site collection scoped features is enabled but has the wrong version" { + + Mock Get-SPFeature { return @{ Version = "1.0.0.0" } } + Mock Disable-SPFeature { } -Verifiable + + $testParams.FeatureScope = "Site" + $testParams.Version = "1.1.0.0" + + It "returns the version from the get method" { + (Get-TargetResource @testParams).Version | Should Be "1.0.0.0" + } + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "reactivates the feature in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled Disable-SPFeature -Times 1 + Assert-MockCalled Enable-SPFeature -Times 1 + } + } } -} \ No newline at end of file +} diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index 51c791728..c2e6c5ed4 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -20,6 +20,25 @@ Describe "xSPInstall" { } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName + $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) + Mock Get-xSharePointAssemblyVersion { return $majorBuildNumber } + + Mock Get-ChildItem { + return @( + @{ + Version = "4.5.0.0" + Release = "0" + PSChildName = "Full" + }, + @{ + Version = "4.5.0.0" + Release = "0" + PSChildName = "Client" + } + ) + } + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } @@ -80,5 +99,26 @@ Describe "xSPInstall" { { Set-TargetResource @testParams } | Should Throw } } + + Context "SharePoint 2013 is installing on a server with .NET 4.6" { + Mock Get-ChildItem { + return @( + @{ + Version = "4.6.0.0" + Release = "0" + PSChildName = "Full" + }, + @{ + Version = "4.6.0.0" + Release = "0" + PSChildName = "Client" + } + ) + } + + It "throws an error in the set method" { + { Set-TargetResource @testParams } | Should Throw + } + } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index 7aa962476..73d5fc08d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -25,6 +25,21 @@ Describe "xSPInstallPrereqs" { function Get-WindowsFeature() { } } + Mock Get-ChildItem { + return @( + @{ + Version = "4.5.0.0" + Release = "0" + PSChildName = "Full" + }, + @{ + Version = "4.5.0.0" + Release = "0" + PSChildName = "Client" + } + ) + } + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) @@ -221,5 +236,26 @@ Describe "xSPInstallPrereqs" { {Set-TargetResource @testParams} | Should Throw } } + + Context "SharePoint 2013 is installing on a server with .NET 4.6" { + Mock Get-ChildItem { + return @( + @{ + Version = "4.6.0.0" + Release = "0" + PSChildName = "Full" + }, + @{ + Version = "4.6.0.0" + Release = "0" + PSChildName = "Client" + } + ) + } + + It "throws an error in the set method" { + { Set-TargetResource @testParams } | Should Throw + } + } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 index 6137db92f..0897e9e8c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 @@ -24,7 +24,29 @@ Describe "xSPSearchServiceApp" { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + + Add-Type -TypeDefinition @" + namespace Microsoft.Office.Server.Search.Administration { + public static class SearchContext { + public static object GetContext(object site) { + return null; + } + } + } +"@ + + Mock Get-SPWebApplication { return @(@{ + Url = "http://centraladmin.contoso.com" + IsAdministrationWebApplication = $true + }) } + Mock Get-SPSite { @{} } + + Mock New-Object { + return @{ + DefaultGatheringAccount = "DOMAIN\username" + } + } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.Search.Administration.Content" } Context "When no service applications exist in the current farm" { @@ -85,6 +107,13 @@ Describe "xSPSearchServiceApp" { } Context "When a service application exists and is configured correctly" { + Mock Get-SPEnterpriseSearchServiceInstance { return @{} } + Mock New-SPBusinessDataCatalogServiceApplication { } + Mock Start-SPEnterpriseSearchServiceInstance { } + Mock New-SPEnterpriseSearchServiceApplication { return @{} } + Mock New-SPEnterpriseSearchServiceApplicationProxy { } + Mock Set-SPEnterpriseSearchServiceApplication { } + Mock Get-SPServiceApplication { return @(@{ TypeName = "Search Service Application" @@ -108,6 +137,12 @@ Describe "xSPSearchServiceApp" { } Context "When a service application exists and the app pool is not configured correctly" { + Mock Get-SPEnterpriseSearchServiceInstance { return @{} } + Mock New-SPBusinessDataCatalogServiceApplication { } + Mock Start-SPEnterpriseSearchServiceInstance { } + Mock New-SPEnterpriseSearchServiceApplication { return @{} } + Mock New-SPEnterpriseSearchServiceApplicationProxy { } + Mock Get-SPServiceApplication { return @(@{ TypeName = "Search Service Application" @@ -133,5 +168,88 @@ Describe "xSPSearchServiceApp" { Assert-MockCalled Set-SPEnterpriseSearchServiceApplication } } + + $testParams.Add("DefaultContentAccessAccount", (New-Object System.Management.Automation.PSCredential ("DOMAIN\username", (ConvertTo-SecureString "password" -AsPlainText -Force)))) + + Context "When the default content access account does not match" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Search Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + Mock Get-SPServiceApplicationPool { return @{ Name = $testParams.ApplicationPool } } + Mock Get-SPEnterpriseSearchServiceInstance { return @{} } + Mock New-SPBusinessDataCatalogServiceApplication { } + Mock Start-SPEnterpriseSearchServiceInstance { } + Mock New-SPEnterpriseSearchServiceApplication { return @{} } + Mock New-SPEnterpriseSearchServiceApplicationProxy { } + Mock Set-SPEnterpriseSearchServiceApplication { } + + Mock Get-SPWebApplication { return @(@{ + Url = "http://centraladmin.contoso.com" + IsAdministrationWebApplication = $true + }) } + Mock Get-SPSite { @{} } + + Mock New-Object { + return @{ + DefaultGatheringAccount = "DOESNOT\match" + } + } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.Search.Administration.Content" } + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "changes the content access account" { + Set-TargetResource @testParams + + Assert-MockCalled Get-SPServiceApplicationPool + Assert-MockCalled Set-SPEnterpriseSearchServiceApplication + } + } + + Context "When the default content access account does not match" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Search Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + Mock Get-SPServiceApplicationPool { return @{ Name = $testParams.ApplicationPool } } + Mock Get-SPEnterpriseSearchServiceInstance { return @{} } + Mock New-SPBusinessDataCatalogServiceApplication { } + Mock Start-SPEnterpriseSearchServiceInstance { } + Mock New-SPEnterpriseSearchServiceApplication { return @{} } + Mock New-SPEnterpriseSearchServiceApplicationProxy { } + Mock Set-SPEnterpriseSearchServiceApplication { } + + Mock Get-SPWebApplication { return @(@{ + Url = "http://centraladmin.contoso.com" + IsAdministrationWebApplication = $true + }) } + Mock Get-SPSite { @{} } + + Mock New-Object { + return @{ + DefaultGatheringAccount = "DOMAIN\username" + } + } -ParameterFilter { $TypeName -eq "Microsoft.Office.Server.Search.Administration.Content" } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } } -} \ No newline at end of file +} diff --git a/appveyor.yml b/appveyor.yml index 430bcd22d..89f53d86e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.11.{build}.0 +version: 0.12.{build}.0 install: - cinst -y pester @@ -25,9 +25,8 @@ after_test: New-Item "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint\en-US" -ItemType Directory & "$env:APPVEYOR_BUILD_FOLDER\Tests\Generate-xSharePointHelpFiles.ps1" -OutputPath "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint\en-US" - Remove-Item (Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.pssproj") $manifest = Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.psd1" - (Get-Content $manifest -Raw).Replace("0.11.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest + (Get-Content $manifest -Raw).Replace("0.12.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory("$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint", "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip") Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } diff --git a/xSharePoint.sln b/xSharePoint.sln deleted file mode 100644 index e69c394f8..000000000 --- a/xSharePoint.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F5034706-568F-408A-B7B3-4D38C6DB8A32}") = "xSharePoint", "Modules\xSharePoint\xSharePoint.pssproj", "{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Files", "Build Files", "{4B4966E2-1684-491C-907E-032202A98ADC}" - ProjectSection(SolutionItems) = preProject - appveyor.yml = appveyor.yml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{58D60278-4DAE-4237-AB23-DF03D4596206}" - ProjectSection(SolutionItems) = preProject - LICENSE = LICENSE - README.md = README.md - EndProjectSection -EndProject -Project("{F5034706-568F-408A-B7B3-4D38C6DB8A32}") = "Tests", "Tests\Tests.pssproj", "{279294C4-E197-48CD-A1FB-263CE47DEA4D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Release|Any CPU.Build.0 = Release|Any CPU - {279294C4-E197-48CD-A1FB-263CE47DEA4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {279294C4-E197-48CD-A1FB-263CE47DEA4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {279294C4-E197-48CD-A1FB-263CE47DEA4D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {279294C4-E197-48CD-A1FB-263CE47DEA4D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal