New-Adfs Claim Rule Set

Creates a set of claim rules.

Syntax

New-AdfsClaimRuleSet
   -ClaimRule <String[]>
   [<CommonParameters>]
New-AdfsClaimRuleSet
   -ClaimRuleFile <String>
   [<CommonParameters>]

Description

The New-AdfsClaimRuleSet cmdlet creates a set of claim rules in Active Directory Federation Services (AD FS) 2.0.

Examples

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 "Fabrikam" -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 "Fabrikam" -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.

Required Parameters

-ClaimRule

Specifies an array of individual rules in this rule set.

Type: String[]
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ClaimRuleFile

Specifies the serialized policy text that is created by the collection of rules in the rule set.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Inputs

None

Outputs

Microsoft.IdentityServer.PowerShell.Resources.ClaimRuleSet

This cmdlet generates a class structure that represents a set of AD FS 2.0 claim rules.

Notes

  • You can assign these claim rules to a claims provider trust or relying party trust by using the corresponding cmdlets.