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

Get-Command New-AdfsClaimRuleSet powershell script command cmdlet adfs

You can also read about

  • Get-AdfsClaimsProviderTrust
  • Set-AdfsClaimsProviderTrust
  • Update-AdfsClaimsProviderTrust
  • Set-AdfsRelyingPartyTrust

To know more PowerShell cmdlets(Commands) on Active Directory Federation Services(ADFS) click here

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Leave a Reply

Your email address will not be published. Required fields are marked *