PowerShell script – Create Managed Accounts and Service Application Pools

PowerShell script – Create Managed Accounts and Service Application Pools
7 votes, 5.00 avg. rating (98% score)

Introduction

When you’re configuring your farm, one of the first things you need to do is create the managed accounts and service app application pools your farm will use. The following PowerShell lines will do that:

Create Managed Accounts and Service Application Pool



NOTE: Change with your respective account id and password in the below script

# Create Managed Accounts
$password = ConvertTo-SecureString 'pass@word1' -AsPlainText -Force
 
# create sp_webapps
$account = New-Object system.management.automation.pscredential 
'contoso\sp_webapps', $password 
New-SPManagedAccount $account
 
# create sp_serviceapps
$account = New-Object system.management.automation.pscredential 
'contoso\sp_serviceapps', $password
New-SPManagedAccount $account
 
# Create the Service App Pool
New-SPServiceApplicationPool -Name "Default SharePoint Service App Pool" 
-Account contoso\sp_serviceapps
$apppool = Get-SPServiceApplicationPool "Default SharePoint Service App Pool"

Conclusion

Above Powershell Script for Creating Managed Accounts and Service Application Pools can be used in SharePoint 2013 and also in SharePoint 2010

May 13, 2014 В· Adi В· No Comments
Tags: , ,  В· Posted in: Powershell, Sharepoint 2010, SharePoint 2013

Leave a Reply

What is 5 + 9 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)