Quantcast
Channel: Bram Nuyts » Web Application
Viewing all articles
Browse latest Browse all 2

Modify your SharePoint application pools using PowerShell

$
0
0

Sometimes your application pools need some maintenance. For instance changing their identity or if you wish to bundle some IIS sites to run under the same application pool so you won’t lose memory to overhead.

Changing the identity of the application pool is rather easy. You can use central admin or the Set-SPServiceApplicationPool cmdlet. Modifying an already running web application’s pool is a little bit different. There’s no cmdlet out of the box, so you’ll have to use the object model. There are 2 great scripts already available on technet. There’s one for changing the application pool, and another one for deleting the unused application pool.

If you wish to just copy paste directly into PowerShell, you can use the scripts below:

Note: the target applicationpool has to be created using SharePoint or else it won’t be recognized!

# Changing an application pool
$apppool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | where {$_.Name -eq "Applicationpoolname found in IIS"}
$webapp = get-spwebapplication -Identity http://sharepoint
$webapp.Applicationpool = $apppool
$webApp.Update()
$webApp.ProvisionGlobally()
# Deleting an application pool
$apppool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | where {$_.Name -eq "Applicationpoolname found in IIS"}
$apppool.UnProvisionGlobally()


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images