{"id":1070,"date":"2022-06-27T17:42:26","date_gmt":"2022-06-27T15:42:26","guid":{"rendered":"https:\/\/www.gerjon.com\/?p=1070"},"modified":"2022-06-27T17:42:26","modified_gmt":"2022-06-27T15:42:26","slug":"export-and-import-adfs-claim-rules","status":"publish","type":"post","link":"https:\/\/www.gerjon.com\/?p=1070","title":{"rendered":"Export and Import ADFS Claim rules"},"content":{"rendered":"\n<p>Recently we were playing around with an ADFS environment where there was a question of a supplier on the configured ADFS settings. Now my first reaction was why do you connect to ADFS and not to Azure AD because that is far more robust and future ready, but hey sometimes it&#8217;s just a fact that things are configured in a certain way :-).<\/p>\n\n\n\n<p>So quick tip on how to export the settings to a text file<\/p>\n\n\n\n<p>log on to the ADFS server and run Powershell as an admin. next up run this command:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Get-ADFSRelyingPartyTrust -name \u201cNAME OF CLAIMRULE\u201d | Select-Object -ExpandProperty IssuanceTransformRules | out-file c:\\claimrule.txt<\/strong><\/p><\/blockquote>\n\n\n\n<p>Where name of claimrule is the display name of the rule you see in the ADFS console on the server.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2022\/06\/image.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"664\" src=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2022\/06\/image.png?resize=932%2C664&#038;ssl=1\" alt=\"\" class=\"wp-image-1071\" srcset=\"https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2022\/06\/image.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2022\/06\/image.png?resize=300%2C214&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2022\/06\/image.png?resize=768%2C548&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.gerjon.com\/wp-content\/uploads\/2022\/06\/image.png?resize=421%2C300&amp;ssl=1 421w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/a><\/figure>\n\n\n\n<p>After export you can see in the textfile all information regarding the claim rule. Best part is you can import this again in your ADFS (or another environment) if needed. To do this do the following.<\/p>\n\n\n\n<p>After logging on on the ADFS server and running PowerShell as an administrator run this command:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Set-ADFSRelyingPartyTrust -TargetName \u201cNAME OF CLAIMRULE&#8221; -IssuanceTransformRulesFile c:\\claimrule.txt<\/strong><\/p><\/blockquote>\n\n\n\n<p>After this your claim rule will appear in the ADFS environment. Easy does it \ud83d\ude42<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently we were playing around with an ADFS environment where there was a question of a supplier on the configured ADFS settings. Now my first reaction was why do you connect to ADFS and not &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11,28],"tags":[],"class_list":["post-1070","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-office-365"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p59CpB-hg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/1070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1070"}],"version-history":[{"count":1,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/1070\/revisions"}],"predecessor-version":[{"id":1072,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=\/wp\/v2\/posts\/1070\/revisions\/1072"}],"wp:attachment":[{"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gerjon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}