Building SharePoint 2016 development environment – Part 11 – Configuring Services

A few years ago I wrote “Build your SharePoint 2013 development machine on Windows Server 2012” series, I mainly work in the cloud now, but as the blogs was so popular, I thought I would create a new series for the newer version of SharePoint.

You can access other parts of this post below.

In this blog I will talk about setting up your environment, by setting up the services. I will be doing majority of this using PowerShell scripts. The scripts will be within this post, but at the end there is a link to my one drive that will contain the PowerShell scripts.

Setting up Services

At the end of the last blog post we Installed SharePoint 2016, however we told the wizard that we would configure the services ourselves. These steps will configure the following services:

  • Managed Metadata Service
  • Word Automation Service
  • BDC
  • Secure Store
  • Usage and Health Data Collection Service
  • Create Machine Translation Service

We are doing this as a script so that Application and Database names are friendly names instead of GUIDs. Before you run the script, on your SharePoint machine, please make sure there is a folder at D:\SPLogs\ULS. This is the folder required for Usage and Health Data Collection Service.

When you run the script there will be a prompt for the SP_Services password. Pa55w0rd. Lastly ensure that your PowerShell window is running in Administrator mode. (CreateSPServices.ps1)

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
#Add SharePoint PowerShell Commands
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$DatabaseServerName = "SQL2016"
$AppPoolName = "Default SharePoint Service App Pool"
$AppPoolUserName = "CFCODE2016\SP_Services"
$MetaDataName = "Manage Metadata Service"
$MetaDataDBName = "SP_MetadataDB"
$WordASName = "Word Automation Service Application"
$WordAutomationDatabaseName = "SP_WordAutoDB"
$BDCServiceName = Business Data Connection Service Application
$BDCDB = SP_BusinessDataConnectionDB
$SecureStoreName = Secure Store Service Application
$SecureStoreProxyName =Secure Store Service Application Proxy
$SecureStoreDB = SP_SecureStoreDB
$usageName = Usage and Health Data Collection Service
$usageServiceDB = SP_Usage_HealthDB
$usageLogLocationOnDisk = D:\SPLogs\ULS\
$stateName = State Service
$stateServiceDB = SP_StateServiceDB
$MTSInst = Machine Translation Service
$MTSName = Translation Service
$MTSDB = SP_MachineTranslationDB
#Check if Service account exist and Create.
Write-Host "Getting Service Account / Creating Service Account"
$SAAppPool = Get-SPServiceApplicationPool -Identity $AppPoolName -EA 0
if($SAAppPool -eq $null)
#Get App Pool account
$AppPoolAccount = Get-SPManagedAccount -Identity $AppPoolUserName -ErrorAction Continue
if($AppPoolAccount -eq $null)
$AppPoolCred = Get-Credential $AppPoolUserName
$AppPoolAccount = New-SPManagedAccount -Credential $AppPoolCred -ErrorAction Continue
$AppPoolAccount = Get-SPManagedAccount -Identity $AppPoolUserName -EA 0
if($AppPoolAccount -eq $null)
Write-Host Cannot create or find the managed account $appPoolUserName, please ensure the account exists.
Exit -1
New-SPServiceApplicationPool -Name $AppPoolName -Account $AppPoolAccount -ErrorAction Continue > $null
#Create Manage Metadata Service
Write-host "Creating Manage Metadata Service"
$mmsApp = New-SPMetadataServiceApplication -Name $MetaDataName –ApplicationPool $AppPoolName -DatabaseServer $DatabaseServerName -DatabaseName $MetaDataDBName > $null
New-SPMetadataServiceApplicationProxy -Name $MetaDataName Proxy -DefaultProxyGroup -ServiceApplication $MetaDataName > $null
#Start MMS
Get-SPServiceInstance | where-object {$_.TypeName -eq Managed Metadata Web Service} | Start-SPServiceInstance > $null
#Word Automation Service
Write-Host "Create Word Automation Service"
Get-SPServiceApplicationPool –Identity $AppPoolName | New-SPWordConversionServiceApplication -Name $WordASName -DatabaseName $WordAutomationDatabaseName
write-Host "Create BDC"
New-SPBusinessDataCatalogServiceApplication –ApplicationPool $AppPoolName –DatabaseName $BDCDB –DatabaseServer $DatabaseServerName –Name $BDCServiceName
#Secure Store and Proxy
write-Host "Create Store and Proxy"
$SecureStoreServiceApp = New-SPSecureStoreServiceApplication –ApplicationPool $AppPoolName –AuditingEnabled:$false –DatabaseServer $DatabaseServerName –DatabaseName $SecureStoreDB –Name $SecureStoreName
New-SPSecureStoreServiceApplicationProxy –Name $SecureStoreProxyName –ServiceApplication $SecureStoreServiceApp -DefaultProxyGroup
#Usage and HEalth Data Collection service
## Begin Variables for usage and health data collection and state service, make sure the C:\Logs\ULS location exists first ##
write-host "Create Usage and Health"
#Change location
Set-SPUsageService -LoggingEnabled 1 -UsageLogLocation $usageLogLocationOnDisk -UsageLogMaxSpaceGB 2
$serviceInstance = Get-SPUsageService
New-SPUsageApplication -Name $usageName -DatabaseServer $DatabaseServerName -DatabaseName $usageServiceDB -UsageService $serviceInstance > $null
$stateServiceDatabase = New-SPStateServiceDatabase -Name $stateServiceDB
$stateSA = New-SPStateServiceApplication -Name $stateName -Database $stateServiceDatabase
New-SPStateServiceApplicationProxy -ServiceApplication $stateSA -Name $stateName Proxy -DefaultProxyGroup
$sap = Get-SPServiceApplicationProxy | where-object {$_.TypeName -eq Usage and Health Data Collection Proxy}
#ChangeLocation and create new files.
Set-SPDiagnosticConfig -LogLocation $usageLogLocationOnDisk
#Machine Translation Service + Proxy
write-host "Create Machine Translation Service and Proxy"
$AppPool = Get-SPServiceApplicationPool $AppPoolName
Get-SPServiceInstance | ? {$_.GetType().Name -eq $MTSInst} | Start-SPServiceInstance
$MTS = New-SPTranslationServiceApplication -Name $MTSName -ApplicationPool $AppPool -DatabaseName $MTSDB
$MTSProxy = New-SPTranslationServiceApplicationProxy –Name $MTSName Proxy –ServiceApplication $MTS –DefaultProxyGroup
write-host "DONE"

Once this code is done, if you head to Central Administration > Application Management then under Service Applications click Manage Service Applications you will see all your new services created.

Also now note, if you open explorer and navigate to D\:SPLogs\ULS you will see your SharePoint logs being displayed there instead of the default location of c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\Logs

Configuring Created Services – Secure Store Service Application

Now we have created the services, they all should be working apart from the Secure Store. It requires a little configuration before it can be used.

  1. Open SharePoint 2016 Central Administration (run
    as administrator) and navigate to Application Management > Manage service applications (Under Service Applications)
  2. Click on Secure Store Service Application. You will see an error message saying you must generate a new key for this Secure Store Service Application. Click on Generate New Key in the ribbon.
  3. On the dialog that appears, put in a Pass Phrase and Confirm Pass Phase. I’m using Pa55w0rd. Click OK.

Creating a Search Service Application

This could also be configured using a PowerShell script, but at times I prefer to do point and click.

  • Open the Manage Service Applications screen again.
  • From the ribbon, click on New and select Search Service Application.
  • This will show you a dialog called Create New Search Service Application. Enter the following information:
    • Service Application Name: Search Service Application
    • Search Service Application Type: Leave unticked. (Out of scope of this blog post for hybrid)
    • Search Service Account: Click on Register new managed account.
      • Service Account UserName : CFCODE2016\SP_Search
      • Service Account Password: Pa55w0rd
      • Click OK.
    • Search Service Account: CFCODE2016\SP_Search
    • Application Pool for Search Admin Web Service: Use existing application pool – Default SharePoint Service App Pool
    • Application Pool for Search Query: Use existing application pool – Default SharePoint Service App Pool
  • Click OK
  • You get messages displayed to you as the service is created.
  • You will get a success message when completed.

We will configure it further in a later blog post where we create the Enterprise Search center. You might want to shut down your machines and take a checkpoint before continuing.

Onedrive link to PowerShell scripts

2 thoughts on “Building SharePoint 2016 development environment – Part 11 – Configuring Services

  1. Hi!
    Thanks for this very good guidance. It helped me very well.
    Unfortunately part 10 is offline 😦
    Can you push the instructions for 2013 and 2016 in word or pdf on your onedrive?

    • Hi Phillip. Sorry about that, the post was available, just the link was incorrect. I have updated it on this post. I never used SSL in my 2013 dev environment, so there is only 2016 version.

Comments are closed.