0

Hi,

I am curious if you know a proper way in SP2010 to create a new application pool and then configure an existing web application to use it.

I used the following script and the result was that the application pool was created on only one web server but on the second one it was not created. Also the IIS website on the first web server is using it but on th esecond web server it is still using the old application pool. As a result nothing works any more.

Is it possible for you to help me understand where I am doing a mistake in this script?

$account = “domain\user”
$apppoolname = “applicationpoolname”

$svc = [Microsoft.SharePoint.Administration.SpWebService]::ContentService
$pool = New-Object Microsoft.SharePoint.Administration.SPApplicationPool $apppoolname, $svc
$pool.CurrentIdentityType = “SpecificUser”
$acct = Get-SPmanagedAccount $account
$processAcct = [Microsoft.SharePoint.Administration.SPProcessAccount]::LookupManagedAccount($acct.Sid)
$pool.ProcessAccount = $processAcct
$pool.Provision()

$web = “http://url”

$webApp = Get-SPWebApplication $web
$webApp.ApplicationPool = $pool
$webApp.ProvisionGlobally()
$webApp.Update()

(Visited 19 times, 1 visits today)
Add a Comment