Skip to content

Instantly share code, notes, and snippets.

Last active September 6, 2016 12:14
What would you like to do?
Creates the App Service For SharePoint 2016
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"
$AppDomain = ""
$SubSettingsName = “Subscription Settings Service”
$SubSettingsDB = “SP_SubscriptionSettingsDB”
$AppManagementName = “App Management Service”
$AppManagementNameProxy = "App Management Service Proxy"
$AppManagementDB = “SP_AppManagementDB”
$SubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $AppPoolName –Name $SubSettingsName –DatabaseName $SubSettingsDB
$SubSvcProxy = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $SubSvc
Get-SPServiceInstance | where-object {$_.TypeName -eq $SubSettingsName} | Start-SPServiceInstance > $null
$AppManagement = New-SPAppManagementServiceApplication -Name $AppManagementName -DatabaseServer $DatabaseServerName -DatabaseName $AppManagementDB –ApplicationPool $AppPoolName
$AppManagementProxy = New-SPAppManagementServiceApplicationProxy -ServiceApplication $AppManagement -Name $AppManagementNameProxy
Get-SPServiceInstance | where-object {$_.TypeName -eq $AppManagementName} | Start-SPServiceInstance > $null
Set-SPAppDomain $AppDomain
Set-SPAppSiteSubscriptionName -Name “apps” -Confirm:$false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment