-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1028 from PowerShell/release-3.2
Release v3.2
- Loading branch information
Showing
138 changed files
with
4,757 additions
and
1,576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...les/SharePointDsc/DSCResources/MSFT_SPAuthenticationRealm/MSFT_SPAuthenticationRealm.psm1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
function Get-TargetResource() | ||
{ | ||
[CmdletBinding()] | ||
[OutputType([System.Collections.HashTable])] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateSet('Yes')] | ||
[String] | ||
$IsSingleInstance, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[String] | ||
$AuthenticationRealm, | ||
|
||
[Parameter()] | ||
[System.Management.Automation.PSCredential] | ||
$InstallAccount | ||
) | ||
|
||
Write-Verbose -Message "Getting farm authentication realm" | ||
|
||
$result = Invoke-SPDSCCommand -Credential $InstallAccount ` | ||
-ScriptBlock { | ||
$currentRealm = Get-SPAuthenticationRealm | ||
|
||
Write-Verbose -Message "Current farm authentication realm is '$currentRealm'" | ||
|
||
return @{ | ||
IsSingleInstance = "Yes" | ||
AuthenticationRealm = $currentRealm | ||
} | ||
} | ||
|
||
return $result | ||
} | ||
|
||
function Set-TargetResource() | ||
{ | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateSet('Yes')] | ||
[String] | ||
$IsSingleInstance, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[String] | ||
$AuthenticationRealm, | ||
|
||
[Parameter()] | ||
[System.Management.Automation.PSCredential] | ||
$InstallAccount | ||
) | ||
|
||
Write-Verbose -Message "Setting farm authentication realm to $AuthenticationRealm" | ||
|
||
Invoke-SPDSCCommand -Credential $InstallAccount ` | ||
-Arguments $PSBoundParameters ` | ||
-ScriptBlock { | ||
|
||
$params = $args[0] | ||
Set-SPAuthenticationRealm -Realm $params.AuthenticationRealm | ||
} | ||
} | ||
|
||
function Test-TargetResource() | ||
{ | ||
[CmdletBinding()] | ||
[OutputType([System.Boolean])] | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateSet('Yes')] | ||
[String] | ||
$IsSingleInstance, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[String] | ||
$AuthenticationRealm, | ||
|
||
[Parameter()] | ||
[System.Management.Automation.PSCredential] | ||
$InstallAccount | ||
) | ||
|
||
Write-Verbose -Message "Testing farm authentication realm" | ||
|
||
$CurrentValues = Get-TargetResource @PSBoundParameters | ||
|
||
return Test-SPDscParameterState -CurrentValues $CurrentValues ` | ||
-DesiredValues $PSBoundParameters ` | ||
-ValuesToCheck @("AuthenticationRealm") | ||
} | ||
|
||
Export-ModuleMember -Function *-TargetResource |
7 changes: 7 additions & 0 deletions
7
...arePointDsc/DSCResources/MSFT_SPAuthenticationRealm/MSFT_SPAuthenticationRealm.schema.mof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ClassVersion("1.0.0.0"), FriendlyName("SPAuthenticationRealm")] | ||
class MSFT_SPAuthenticationRealm : OMI_BaseResource | ||
{ | ||
[Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; | ||
[Required, Description("The authentication realm to be set")] String AuthenticationRealm; | ||
[Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount; | ||
}; |
14 changes: 14 additions & 0 deletions
14
Modules/SharePointDsc/DSCResources/MSFT_SPAuthenticationRealm/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Description | ||
|
||
**Type:** Distributed | ||
**Requires CredSSP:** No | ||
|
||
This resource is used to set the authentication realm for a farm. | ||
By default the authentication realm for a new farm installation | ||
is the same as the farm id. | ||
|
||
Note: | ||
|
||
SharePoint automatically converts the realm to lower case ASCII printable characters. | ||
The specified authentication realm must therefore conform to this for the test | ||
method to be able to detect a correct configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.