Skip to content

Expiscornovus

Discover the new

Follow @Expiscornovus


My name is Dennis. I am Dutch and I live and work in the UK as an IT consultant. Currently I work a lot with SharePoint online, Microsoft Teams and all the other products of the Office 365 platform. I also like my share of Dynamics 365 and Azure. I try to blog about everything I come across in my daily job. All the content in my blogs are my personal views and experiences.

Tag: IIS

SharePoint 2010: How to Create new Service Application Pools via PowerShell

Title

Create New Service Application Pools in SharePoint 2010 via PowerShell

Business Goal

You can associate Application Pools of IIS with Service Applications and Web Applications within SharePoint 2010 interface (via Application Management > Manage Service Applications > Configure Managed Accounts).

Creating a Service Application Pool can have different advantages:
– You can create the Application Pools following your own naming conventions (in SharePoint)
– You can create the Application Pools in bulk before you create the Service Applications
– You can asociate existing managed accounts

Technical Overview

The solution is a PowerShell script that uses new-SPServiceApplicationPool cmdlet of SharePoint 2010 Management Shell. It uses the Import-CSV cmdlet to import a csv file in bulk. It also has an dependency with my previous Managed Accounts Powershell script.

Note: You don’t see the Application Pool in IIS after you asociate it with a new Service Application. And you still get an ID as name in IIS.

Prerequisites

To complete this how-to, you must have the following prerequisites must be met:
– A domain account that can log on to one of the SharePoint 2010 servers
– A domain account that has privileges to manage SharePoint 2010 via PowerShell (SPShellAdmin role)

Steps

1. Create a csv file with two columns, Name and ProcessAccountName
2. Run the Powershell script in SharePoint 2010 Management Shell via the following command .\new_serviceapplicationpools.ps1

new_serviceapplicationpools.ps1
PowerShell
1
2
3
4
5
Import-CSV .\serviceapplicationpools.csv | ForEach-Object {
$serviceapplicationpool = $_.Name
$processaccountname = $_.ProcessAccountName
New-SPServiceApplicationPool -Name $serviceapplicationpool -Account $processaccountname
}

Additional resources

Gallery Technet – New Service Application Pools
IIS – Application PoolsTechnet – Get-SPShellAdmin
Technet – New-SPServiceApplicationPool
Technet – Import-CSV

Applies to

SharePoint 2010

Change History

23-06-2014 – 1.0

Posted on July 21, 2014March 28, 2015Categories PowerShell, SharePoint 2010Tags Application Pool, Codesnippet, Csv, IIS, Managed Account, PowerShell, Service Application, SharePoint 2010Leave a comment on SharePoint 2010: How to Create new Service Application Pools via PowerShell
Proudly powered by WordPress