{"id":1498,"date":"2013-11-25T06:05:03","date_gmt":"2013-11-25T06:05:03","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1498"},"modified":"2024-04-12T05:02:29","modified_gmt":"2024-04-12T05:02:29","slug":"assigning-an-application-pool-to-a-sharepoint-web-app","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/assigning-an-application-pool-to-a-sharepoint-web-app\/","title":{"rendered":"Assigning an Application Pool to a SharePoint Web App"},"content":{"rendered":"<p>the easy\/obvious way is the wrong way. The trick is to reassign the app pool to the web app so SharePoint know about it. That way on a reconfig, things don\u2019t get configured incorrectly.<br \/>\nTo do it correctly, we\u2019ll leverage this PowerShell snippet:<\/p>\n<pre lang=\"php\">\r\n$sourceWebAppPool = (Get-SPWebApplication < URL of an existing webapp  application pool you want to use >).ApplicationPool\r\n$webApp = Get-SPWebApplication < URL of the web application you want to update >;\r\n$webApp.ApplicationPool = $sourceWebAppPool\r\n$webApp.ProvisionGlobally()\r\n$webApp.Update()\r\niisreset\r\n<\/pre>\n<p>if you do not have a web application already using the desired web application pool, you have the option to create a new application pool to use:<\/p>\n<pre lang=\"php\">\r\nImport-Module WebAdministration\r\n$appPool = New-WebAppPool \"My new App Pool\"\r\n<\/pre>\n<p>However, while I initially could not find a CmdLet for doing a \u201cget-webAppPool\u201d, my friend Brett Parker suggested:<\/p>\n<pre lang=\"php\">\r\n$appPool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | Where {$_.Name -eq \"NameOfAppPool\" }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>the easy\/obvious way is the wrong way. The trick is to reassign the app pool to the web app so SharePoint know about it. That way on a reconfig, things don\u2019t get configured incorrectly. To do it correctly, we\u2019ll leverage this PowerShell snippet: $sourceWebAppPool = (Get-SPWebApplication < URL of an existing webapp application pool you [&hellip;]\n<\/p>\n","protected":false},"author":2,"featured_media":1502,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1498","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":4,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1498\/revisions"}],"predecessor-version":[{"id":1506,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1498\/revisions\/1506"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1502"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}