Home > SharePoint 2010, SharePoint Administration > Removing Unused Service Application App Pools in SharePoint 2010 using PowerShell

Removing Unused Service Application App Pools in SharePoint 2010 using PowerShell

Working with Service Applications within SharePoint 2010 can sometimes result in having to completely remove  and reconfigure it due to some type of corruption, possibly in the backend databases that has prevented it from working correctly.  I’ve had to do this a few times with Service Apps such as PerformancePoint, UserProfile, Search, and Secure Store applications, mutltiple times.

When I recreate and configure new Service Applications that i’ve previously removed I often like to keep the same Service Application App Pool names when I configure them initially.

Unfortunately when you delete or remove a Service Application in SharePoint 2010, it deletes the Service Application and its database fine, however it does not delete the Service Application App Pools.  These are lingering in SharePoint 2010 purgatory.  Since I don’t like to resue application pools after removing corrupted Service Applications I tend not to select the existing Service Application App Pools that were created, you will have the option to do this when creating new Service Application by selecting an existing app pool instead of creating a new one.

If you try to create a new app pool with the same name that was used previously you will recieve an error that SharePoint already has an IIS Application Pool (SPIisWebServiceApplicationPool) that exists with that same name.

If you check IIS you will not find this Application Pool. 

Here is where our good friend PowerShell comes into handy.

You can view and remove the Service Application Application Pool by using PowerShell.

1.  Log into your Central Administration server
2.  Bring up SharePoint 2010 Management Shell (PowerShell) using Admin rights
3.  To list all SharePoint 2010 Service Application App Pools run this PowerShell cmdlt

Get-SPServiceApplicationPool

4.  To remove the Service Application App Pools simply run this PowerShell cmdlt

Remove-SPServiceApplicationPool “[Name of Service Application App Pool]”

5.  You will be promoted to confirm:

Are you sure you want to perform this action?
Performing operation “Remove-SPServiceApplicationPool” on Target “Name of Service Application Pool”
[Y] Yes [A]Yes to All [N] No [L] No to All [S] Suspend [?] Help
<default is “Y”>:

6.  After selecting Y for Yes, you can now double check to make sure the Service Application App Pool was indeed removed by re-running the Get-SPServiceApplicationPool cmdlt
7.  You should no longer see the Service Application App Pool.
8.  Now you can go back to Central Administration and attempt to create the Service Application App Pool using the same name used previously.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: