Twitter Feed
Tweets by SundownSolLtd

SharePoint 2013 Core Service Application Provisioning

7th August


When creating a new farm I often find the creation of the core service applications a very repetitive task. The use of the configuration wizard is never really an option as a sea of DB GUIDs littering SQL is not desirable. So for some time now (ever since R12 really) I've been using pre-packed scripts to provision all the core service apps into their own DB's. Once I've finished deploying the bits to all the servers I update the $DB with the alias info and App pool info and just run the script. It's designed to create them all in order of dependency and in larger farms the service apps can take a few seconds to register so to make sure things go smoothly I pause the script for 5 seconds after each service app is provisioned. Feel free to reduce as necessary. All the service apps will use the same SharePoint Web Services application pool.

It must be noted that these core service apps are being provisioned into the default proxy group for later use in a services farm. In later posts I'll be providing the multi-tenancy variant.

Here's the script:

########## CORE SERVICE APPLICATIONS ########

########## Initial Details

########## Set the Instance name/alias for SQL

########## Gets the SharePoint Web Services app pool - does match as this app pool can end in either root or system

 

Asnp * #adds the PowerShell snap in - just in case you're not running this from management shell

$DB = "CONPRI"

$saAppPool = Get-SPServiceApplicationPool | ?{$_.Name -Match "SharePoint Web Services"}

   

######### SESSION STATE SERVICE #########

$stateDB = New-SPStateServiceDatabase -Name Session_State_Service

$state = New-SPStateServiceApplication -Name "Session State Service" -Database $stateDB

New-SPStateServiceApplicationProxy -Name "Session State Service Proxy" -ServiceApplication $state -DefaultProxyGroup

Start-Sleep -s 5

   

######## MMS ##########

New-SPMetadataServiceApplication -ApplicationPool $saAppPool -Name "Managed Metadata Service" -databasename MMS -DatabaseServer $DB

$mmsent = Get-SPServiceApplication -Name "Managed Metadata Service"

New-SPMetadataServiceApplicationProxy -Name "Managed Metadata Service Proxy" -ServiceApplication $mmsent

Start-Sleep -s 5

   

########## SECURE STORE ##########

New-SPSecureStoreServiceApplication -ApplicationPool $saAppPool -Name "Secure Store Service" -AuditingEnabled -DatabaseName "Secure_Store_Service" -DatabaseServer $DB

$secstore = Get-SPServiceApplication -Name "Secure Store Service"

New-SPSecureStoreServiceApplicationProxy -Name "Secure Store Service Proxy" -ServiceApplication $secstore

Start-Sleep -s 5

   

   

########## WORK MANAGEMENT #########

New-SPWorkManagementServiceApplication -ApplicationPool $saAppPool -Name "Work Management"

$workman = Get-SPServiceApplication -name "Work Management"

New-SPWorkManagementServiceApplicationProxy -name "Work Management Proxy" -ServiceApplication $workman

Start-Sleep -s 5

   

   

##########WORD AUTOMATION ##########

New-SPWordConversionServiceApplication -Name "Word Automation" -DatabaseName "Word_Automation" -DatabaseServer $DB -ApplicationPool $saAppPool

$wordapp = Get-SPServiceApplication -Name "Word Automation"

# No PROXY setup needed

Start-Sleep -s 5

   

   

########## BDC ##########

New-SPBusinessDataCatalogServiceApplication -ApplicationPool $saAppPool -Name "Business Data Catalog" -DatabaseServer $DB -DatabaseName "Business_Data_Catalog"

$bdc = Get-SPServiceApplication -Name "Business Data Catalog"

###New-SPBusinessDataCatalogServiceApplicationProxy -Name "Business Data Catalog Proxy" -ServiceApplication $bdc ## proxy not needed, but check on creation

Start-Sleep -s 5

   

   

########## MACHINE TRANS ##########

New-SPTranslationServiceApplication -ApplicationPool $saAppPool -Name "Machine Translation Service" -DatabaseServer $DB -DatabaseName "Machine_Translation_Service"

$machtrans = Get-SPServiceApplication -name "Machine Translation Service"

##New-SPTranslationServiceApplicationProxy -name "Machine Translation Service Proxy" -ServiceApplication $machtrans ## proxy not needed, but check on creation

Start-Sleep -s 5

   

   

##########SUBSCRIPTION SETTINGS ##########

New-SPSubscriptionSettingsServiceApplication -ApplicationPool $saAppPool -DatabaseName Subscription_Settings -DatabaseServer $DB -Name "Subscription Settings"

$subset = Get-SPServiceApplication -name "Subscription Settings"

New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $subset

Start-Sleep -s 5

   

   

##########APP MANAGEMENT ##########

New-SPAppManagementServiceApplication -ApplicationPool $saAppPool -DatabaseName APP_Management -DatabaseServer $DB -Name "App Management"

$appman = Get-SPServiceApplication -name "App Management"

New-SPAppManagementServiceApplicationProxy -Name "App Management Proxy" -ServiceApplication $appman

Start-Sleep -s 5

   

##########Lists out all the Service apps that were provisioned

Get-SpServiceApplication

Follow Us