Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Last active September 6, 2016 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmatthews05/e3b54fa9c4fdc46fd72510b6c480e5b7 to your computer and use it in GitHub Desktop.
Save pmatthews05/e3b54fa9c4fdc46fd72510b6c480e5b7 to your computer and use it in GitHub Desktop.
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 = "cfapps.com"
$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