PowerShell
Edit|Remove
#--------------------------------------------------------------------------------------- 
# Name:            Set-WebApplicataionPool.ps1 
# Description:     This script will change SP WebApplication Pools for a Web Application 
#                 
# Usage:        Run the function with the required parameters 
# By:             Ivan Josipovic, Softlanding.ca 
#--------------------------------------------------------------------------------------- 
Function Set-WebApplicataionPool($WebAppURL,$ApplicationPoolName){ 
    $apppool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | where {$_.Name -eq $ApplicationPoolName} 
    if ($apppool -eq $null){ 
        write-host -foreground red "The Application Pool $ApplicationPoolName does not exist!" 
        return 1 
    } 
    $webapp = get-spwebapplication -Identity $WebAppUrl 
    if ($webapp -eq $null){ 
        write-host -foreground red "The Web Application $WebAppUrl does not exist!" 
        return 1 
    } 
    $webapp.Applicationpool = $apppool 
    $webApp.Update() 
    $webApp.ProvisionGlobally() 
    write-host -foreground green "$WebappURL Application Pool has been changed to $ApplicationPoolName" 
    return 0 
} 
 
Set-WebApplicataionPool -WebAppURL "http://sp2010-a:9006" -ApplicationPoolName "SharePoint WebApplications" 
 

 

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.softlanding.ca/Lists/Posts/ViewPost.aspx?ID=24

Use this script to delete unused Application Pools:

http://gallery.technet.microsoft.com/scriptcenter/Delete-a-SP-WebApplication-9a7d82e4