{"id":1248,"date":"2014-07-11T13:15:45","date_gmt":"2014-07-11T12:15:45","guid":{"rendered":"http:\/\/blog.repsaj.nl\/?p=1248"},"modified":"2014-07-11T13:15:45","modified_gmt":"2014-07-11T12:15:45","slug":"sp201x-adding-a-adfs-trusted-identity-token-issuer-to-a-webapp-using-powershell","status":"publish","type":"post","link":"http:\/\/blog.repsaj.nl\/index.php\/2014\/07\/sp201x-adding-a-adfs-trusted-identity-token-issuer-to-a-webapp-using-powershell\/","title":{"rendered":"[SP201x] Adding a ADFS trusted identity token issuer to a webapp using Powershell"},"content":{"rendered":"<p>There is a lot of information on how to link SharePoint 2010 or 2013 to\u00a0an AD FS instance. But for some reason, most of those blogs include a manual step to enable the newly created authentication provider in Central Admin. I don&#8217;t like manual steps, so here is a little script which does the same, but in Powershell instead:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"prettyprint\">$issuerName = \"ADFS\"\r\n$webApp_Url = \"https:\/\/portal.contoso.com\/\"\r\n$webApp_zone = \"Default\"\r\n\r\n# Get the list of currently configured authentication providers in the specified webapp\/zone\r\n$authProviders = Get-SPAuthenticationProvider -WebApplication $webApp_Url -Zone $webApp_zone\r\n\r\n# Check if the provider is already present, otherwise skip adding it\r\nif (($providers | ? { $_.DisplayName -eq $issuerName }) -eq $null)\r\n{\r\n\t# create an array which will hold the new list of authentication providers\r\n\t$newProviders = @()\r\n\r\n        # add all the previously configured providers to the list\r\n\tforeach ($provider in $authProviders)\r\n\t{\r\n\t\t$newProviders += $provider\r\n\t}\r\n\r\n\t# add our new provider \r\n\t$newProviders += New-SPAuthenticationProvider -TrustedIdentityTokenIssuer $issuerName\r\n\t\r\n        # configure the web application (zone) to use this new list of providers\r\n\tSet-SPWebApplication -Identity $webApp_Url -Zone $webApp_zone -AuthenticationProvider $newProviders\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There is a lot of information on how to link SharePoint 2010 or 2013 to\u00a0an AD FS instance. But for some reason, most of those blogs include a manual step to enable the newly created authentication provider in Central Admin. I don&#8217;t like manual steps, so here is a little script which does the same,<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[34],"tags":[87,45,7,39],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3KFR1-k8","_links":{"self":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/1248"}],"collection":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/comments?post=1248"}],"version-history":[{"count":0,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/1248\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/media?parent=1248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/categories?post=1248"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/tags?post=1248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}