Edit

Share via


New-AdfsClaimRuleSet

Creates a set of claim rules.

Syntax

FromParams

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

FromFile

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.

Parameters

-ClaimRule

Specifies an array of individual rules in this rule set.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromParams
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClaimRuleFile

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromFile
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

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.