New-AdfsClaimRuleSet
New-AdfsClaimRuleSet is accessible with the help of adfs module. To install adfs on your system please refer to this adfs.
Synopsis
Creates a set of claim rules.
Description
The New-AdfsClaimRuleSet cmdlet creates a set of claim rules in Active Directory Federation Services (AD FS) 2.0.
Parameters
-ClaimRule
Specifies an array of individual rules in this rule set.
Required? true
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-ClaimRuleFile <String>
Specifies the serialized policy text that is created by the collection of rules in the rule set.
Required? true
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
Syntax
New-AdfsClaimRuleSet -ClaimRule <String[]> [<CommonParameters>]
New-AdfsClaimRuleSet -ClaimRuleFile <String> [<CommonParameters>]
Notes
You can assign these claim rules to a claims provider trust or relying party trust by using the corresponding cmdlets.
——————Example 1——————
Create a claim rule set by using a text file
PS C:> $RuleSet = New-AdfsClaimRuleSet -ClaimRuleFile ‘C:\ruleset.txt’
PS C:> Set-AdfsRelyingPartyTrust -TargetName “TOSSolution” -IssuanceTransformRules $RuleSet.ClaimRulesString
The first command creates a claim rule set by using a text file, and then stores it in the $RuleSet variable.
The second command uses the Set-AdfsRelyingPartyTrust cmdlet to assign the rule set stored in $RuleSet to a relying party trust. The command refers to the ClaimsRuleString property of the object stored in $RuleSet.
——————Example 2——————
Create a claim rule set by using an inline rule
PS C:> $RuleSet = New-AdfsClaimRuleSet -ClaimRule ‘c:[] => issue(claim = c);’
PS C:> Set-AdfsRelyingPartyTrust -TargetName “TOSSolution” -IssuanceTransformRules $RuleSet.ClaimRulesString
The first command creates a claim rule set by using an inline AD FS 2.0 claims language rule, and then stores it in the $RuleSet variable.
The second command uses Set-AdfsRelyingPartyTrust to assign the rule set stored in $RuleSet to a relying party trust. The command refers to the ClaimsRuleString property of the object stored in $RuleSet.
You can check the Version, CommandType and Source of this cmdlet by giving below command.
Get-Command New-AdfsClaimRuleSet
You can also read about
- Get-AdfsClaimsProviderTrust
- Set-AdfsClaimsProviderTrust
- Update-AdfsClaimsProviderTrust
- Set-AdfsRelyingPartyTrust