Change SharePoint Web Application Pool

 SharePoint does not provide a way to change the WebApplication Application Pools throught the GUI. The only way to do it is through the object model and IIS (which is not supported)This script will change a Web Applications Application Pool.Blog entry with guide: http://blog.s

3.5 Star
2,531 times
Add to favorites
E-mail Twitter Digg Facebook
  • Listing Out the App Pools
    1 Posts | Last post June 14, 2013
    • Just to clarify to others, you may list out the available SharePoint App Pools by using this command:
      [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | ft Name
      For Central Admin, you may use this command:
      [Microsoft.SharePoint.Administration.SPWebService]::AdministrationService.ApplicationPools | ft Name
      Use the names presented when calling Ivan's function. 
      I created a new function for the Central Admin just using the AdministrationService instead of the ContentService.
  • A few notes
    1 Posts | Last post August 17, 2012
    • There are some spelling errors in your script.
      It wasn't clear to me that I needed to use SharePoint Central Admin to create the web application and new application pool. I had tried to do it with IIS. Your script didn't like that much as SharePoint wasn't returning the new app pool.
      Once I figured that out, I was able to get your script to run but the site did not come up. It kept returning an unexpected error. I had to use this routine to nudge it:
      $WebApplication = Get-SPWebApplication http://URL
      $ManagedAccount = Get-SPManagedAccount -Identity "domain\user"
      $WebApplication.ApplicationPool.ManagedAccount = $ManagedAccount
      This was because I used a different app pool identity on the new application pool. This nudged it and made it work.
  • Required Parameters?
    2 Posts | Last post August 01, 2012
    • The description of this cmdlet states that there are required parameters that need to be specified in order for this to work ... what are the required paraments?  What order are they expected to be in?
    • Hey, 
      There are two required parameters, there is an example on the bottom of the script.
      -WebAppURL "http://sp2010-a:9006" 
      -ApplicationPoolName "SharePoint WebApplications"