Created
June 6, 2016 19:15
-
-
Save cosminonea/d433324d05f6d60c91387b1e6853a166 to your computer and use it in GitHub Desktop.
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
param( | |
$relyingPartyUrl, | |
$ruleFilePath | |
) | |
Import-Module ADFS | |
$party = Get-ADFSRelyingPartyTrust -Name "$relyingPartyUrl" | |
if($party) | |
{ | |
Write-Host "Removing Relying Party $relyingPartyUrl" | |
$party | Remove-ADFSRelyingPartyTrust | |
} | |
Write-Host "Creating relying party $relyingPartyUrl" | |
Add-ADFSRelyingPartyTrust -Name "$relyingPartyUrl" ` | |
-Identifier "$relyingPartyUrl" ` | |
-WSFedEndpoint "$relyingPartyUrl" ` | |
-IssuanceAuthorizationRules "@RuleTemplate=`"AllowAllAuthzRule`" => issue(Type = `"http://schemas.microsoft.com/authorization/claims/permit`", Value=`"true`");" | |
$party = Get-ADFSRelyingPartyTrust -Name "$relyingPartyUrl" | |
Write-Host "Adding Claim Transform Rules" | |
$ruleFilePath = Resolve-Path $ruleFilePath | |
$rulesString = [System.IO.File]::ReadAllText($ruleFilePath) | |
Write-Host $rulesString | |
$party | Set-ADFSRelyingPartyTrust -IssuanceTransformRules $rulesString | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment