Export /Import ADFS Claim Rules for your relying party trusts to a text file

Sometimes you might be bored creating similar/same claim rules accross your enviornments . Below method will quickly help you export your claim rules and apply to different relying party trust

Step1 : Export to a text fileĀ 

 

(Get-AdfsRelyingPartyTrust -Name "Source Relying Part Trust Name").IssuanceTransformRules | Out-File "C:\path.txt"

Step 2 : Apply /Set your claim rules from text file you exported in last stepĀ 

Set-AdfsRelyingPartyTrust -TargetName "Destination Relying Party Trust" -IssuanceTransformRulesFile "C:\path.txt"