Provisioning Central Admin on SharePoint 2016 with Powershell

The only difference between the powershell for 2013 and the powershell for 2016, when it comes to provisioning Central admin’s config database and the web application content database is one little parameter:

 

-localserverrole

 

If you’ve patched the farm to November 2016 or higher you can choose ApplicationWithSearch, Application, or Custom

 

If you’re at a lower CU, then you can use Custom or Application for the local server role.

 

In this example below, I used custom to create a SharePoint 2016 farm’s Central admin content database and the 2016 Farm’s config db

Set-ExecutionPolicy Unrestricted

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue


Write-Host "When prompted for credentials, give SharePoint the farm account, not the install account that you are signed in with, then provide the passphrase, note: you will not be prompted for passPhrase if it is baked into the script" -ForegroundColor green

New-SPConfigurationDatabase -DatabaseName SharePoint_Config -DatabaseServer SharePointSQL -Passphrase (ConvertTo-SecureString "Sh@r3PointOnPrem!sNotK!ng" -AsPlainText -Force) -FarmCredentials (Get-Credential) -AdministrationContentDatabaseName SharePoint_AdminContent -localServerRole Custom

$CAPort = 5000

$CAAuth = "NTLM"

Install-SPHelpCollection -All

Initialize-SPResourceSecurity

Install-SPService

Install-SPFeature -AllExistingFeatures

New-SPCentralAdministration -Port $CAPort -WindowsAuthProvider $CAAuth

Install-SPApplicationContent

New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword

## Note you might not have an SCP in your domain, so you may want to exclude the next two lines ##

$ServiceConnectionPoint = get-SPTopologyServiceApplication | select URI

Set-SPFarmConfig -ServiceConnectionPointBindingInformation $ServiceConnectionPoint -Confirm: $False

Write-Host "Make sure to register the managed accounts for Service Apps and for Web Content before continuing with the 2013Install script" -ForegroundColor Green -BackgroundColor Yellow