{"id":712,"date":"2014-12-26T10:45:47","date_gmt":"2014-12-26T08:45:47","guid":{"rendered":"https:\/\/www.vioreliftode.com\/?p=712"},"modified":"2016-04-14T14:38:06","modified_gmt":"2016-04-14T12:38:06","slug":"new-spwebapplicationappdomain-the-given-key-was-not-present-in-the-dictionary","status":"publish","type":"post","link":"https:\/\/www.vioreliftode.com\/index.php\/new-spwebapplicationappdomain-the-given-key-was-not-present-in-the-dictionary\/","title":{"rendered":"New-SPWebApplicationAppDomain: The given key was not present in the dictionary."},"content":{"rendered":"<input class=\"fooboxshare_post_id\" type=\"hidden\" value=\"712\"\/><p>Most likely you are visiting this page because you install and configure Apps for SharePoint 2013 and you want to support AAM, or Host-Header configured farms. <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dn144963(v=office.15).aspx\" target=\"_blank\">http:\/\/technet.microsoft.com\/en-us\/library\/dn144963(v=office.15).aspx<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Your farm has\u00a0<a href=\"http:\/\/support.microsoft.com\/kb\/2767999\" target=\"_blank\">March 2013 Public Update<\/a>, <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dn144963(v=office.15).aspx#enable\" target=\"_blank\">you enabled app functionality<\/a> for such setup:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService\r\n$contentService.SupportMultipleAppDomains = $true\r\n$contentService.Update()\r\n<\/pre>\n<p>but when you try to <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dn144963(v=office.15).aspx#config\" target=\"_blank\">configure multiple app domains<\/a> for each of your Web Applications \/ Zones (especially if it&#8217;s not the Default zone), the <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dn167722%28v=office.15%29.aspx\" target=\"_blank\">New-SPWebApplicationAppDomain<\/a> Cmdlet is throwing the <span style=\"text-decoration: underline;\"><strong>&#8220;The given key was not present in the dictionary&#8221;<\/strong><\/span> exception.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_01.png\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-713\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_01.png\" alt=\"The given key was not present in the dictionary 01\" width=\"875\" height=\"221\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_01.png 875w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_01-300x75.png 300w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><br \/>\n<\/a><br \/>\n<em>New-SPWebApplicationAppDomain : <span style=\"text-decoration: underline;\">The given key was not present in the dictionary<\/span>.<\/em><br \/>\n<em><span style=\"line-height: 1.5;\">At line:1 char:1<br \/>\n<\/span><span style=\"line-height: 1.5;\">+ New-SPWebApplicationAppDomain -AppDomain XXXXXXX.XXXXX.XXXXXXXXXXXXXXXXXXXXXXXXX &#8230;<br \/>\n<\/span><span style=\"line-height: 1.5;\">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\n<\/span><span style=\"line-height: 1.5;\">+ CategoryInfo : InvalidData: (Microsoft.Share&#8230;cationAppDomain:SPCmdletNewWebApplicationAppDomain) [New<br \/>\n<\/span><span style=\"line-height: 1.5;\">-SPWebApplicationAppDomain], KeyNotFoundException<br \/>\n<\/span>+ FullyQualifiedErrorId : Microsoft.SharePoint.Administration.SPAppCmdlets.SPCmdletNewWebApplicationAppDomain<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>This is happening because you have a SharePoint Web Application with multiple AAM (alternate access mappings) and you configured the AAMs without extending the Web Application. Most likely you needed additional AAMs and you configured the farm adding the URLs directly in the &#8220;Edit Public URLs&#8221; page (Central Administration -&gt; Application Management -&gt; Configure alternate access mappings -&gt; Edit Public URLs).<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc288609(v=office.12).aspx\" target=\"_blank\">Microsoft recommends to extend the Web Applications<\/a> instead of editing directly the Zones.\u000b&#8221;We recommend extending a Web application to a new IIS Web site for each zone you want to use. This provides a backing IIS Web site. We do not recommend reusing the same IIS Web site for multiple zones, unless you are specifically told to do so by Microsoft.&#8221; Even if the article refers for Microsoft Office SharePoint Server 2007, the rule is valid also for SharePoint 2010 and 2013. More details about <a href=\"http:\/\/blogs.msdn.com\/b\/sharepoint_strategery\/archive\/2013\/05\/27\/alternate-access-mappings-explained.aspx\" target=\"_blank\">Alternate Access Mappings and how they work here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>So, the Microsoft developers behind this Cmdlet followed this recommendation. To make New-SPWebApplicationAppDomain to work for your Alternate Access Mapping, you need:<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">1. To delete the problematic AAM zone (Central Administration -&gt; Application Management -&gt; Configure alternate access mappings)<\/span><br \/>\n<a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_02.png\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-714\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_02.png\" alt=\"The given key was not present in the dictionary 02\" width=\"747\" height=\"259\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_02.png 747w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_02-300x104.png 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">2. Extend you Web Application accordingly with your zone.<\/span><br \/>\n<a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_03.png\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-715\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_03.png\" alt=\"The given key was not present in the dictionary 03\" width=\"979\" height=\"337\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_03.png 979w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_03-300x103.png 300w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/a><br \/>\n<a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_04.png\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-716\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_04.png\" alt=\"The given key was not present in the dictionary 04\" width=\"651\" height=\"517\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_04.png 651w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_04-300x238.png 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><br \/>\n<a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_05.png\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-717\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_05.png\" alt=\"The given key was not present in the dictionary 05\" width=\"648\" height=\"513\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_05.png 648w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_05-300x237.png 300w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_06.png\"><img loading=\"lazy\" class=\"alignleft size-full wp-image-718\" src=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_06.png\" alt=\"The given key was not present in the dictionary 06\" width=\"873\" height=\"642\" srcset=\"https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_06.png 873w, https:\/\/www.vioreliftode.com\/wp-content\/uploads\/2014\/12\/The_given_key_was_not_present_in_the_dictionary_06-300x220.png 300w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><em>Please <a title=\"New-SPWebApplicationAppDomain: The IIS Web Site you have selected is in use by SharePoint. You must select another port or hostname.\" href=\"\/index.php\/new-spwebapplicationappdomain-the-iis-web-site-you-have-selected-is-in-use-by-sharepoint-you-must-select-another-port-or-hostname\/\">read my next article<\/a> in case after extending the Web Application, New-SPWebApplicationAppDomain throws you <span style=\"text-decoration: underline;\"><strong>&#8220;The IIS Web Site you have selected is in use by SharePoint. You must select another port or hostname.&#8221;<\/strong><\/span> exception.<\/em><br \/>\n<em> New-SPWebApplicationAppDomain : The IIS Web Site you have selected is in use by SharePoint. You must select another<\/em><br \/>\n<em> port or hostname.<\/em><br \/>\n<em> At line:1 char:1<\/em><br \/>\n<em> + New-SPWebApplicationAppDomain -AppDomain XXXXXXX.XXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXX &#8230;<\/em><br \/>\n<em> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/em><br \/>\n<em> + CategoryInfo : InvalidData: (Microsoft.Share&#8230;cationAppDomain:SPCmdletNewWebApplicationAppDomain) [New<\/em><br \/>\n<em> -SPWebApplicationAppDomain], ArgumentException<\/em><br \/>\n<em>+ FullyQualifiedErrorId : Microsoft.SharePoint.Administration.SPAppCmdlets.SPCmdletNewWebApplicationAppDomain<\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most likely you are visiting this page because you install and configure Apps for SharePoint 2013 and you want to support AAM, or Host-Header configured farms. http:\/\/technet.microsoft.com\/en-us\/library\/dn144963(v=office.15).aspx &nbsp; Your farm has\u00a0March 2013 Public Update, you enabled app functionality for such setup: but when you try to configure multiple app domains for each of your Web &hellip; <a href=\"https:\/\/www.vioreliftode.com\/index.php\/new-spwebapplicationappdomain-the-given-key-was-not-present-in-the-dictionary\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">New-SPWebApplicationAppDomain: The given key was not present in the dictionary.<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"New-SPWebApplicationAppDomain: The given key was not present in the dictionary. http:\/\/wp.me\/p4NfDd-bu","jetpack_is_tweetstorm":false},"categories":[32,29],"tags":[72,9],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4NfDd-bu","_links":{"self":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/712"}],"collection":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/comments?post=712"}],"version-history":[{"count":0,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/posts\/712\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/media?parent=712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/categories?post=712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vioreliftode.com\/index.php\/wp-json\/wp\/v2\/tags?post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}