Saturday, February 13, 2016

Create Subscription Settings Service Application in SharePoint using PowerShell

What is subscription settings service application in SharePoint? Well, SharePoint Apps platform relies on Microsoft SharePoint Foundation Subscription Settings service application. So, If you want to use Apps in SharePoint, its a prerequisite to create Subscription Settings service application.

How to create subscription settings service application?
Subscription Settings service application can be created only via PowerShell, There is no GUI to create this Service Application! Lets configure the subscription settings service application by using windows PowerShell.

Don't forget to Change configuration parameters such as the service account, database name,etc on the below script as per your environment. Once done,  run this PowerShell script from either PowerShell ISE or through SharePoint Server 2013 Management Shell.

PowerShell to Create Subscription Settings Service Application in SharePoint

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Parameters
$ServiceAppName = "Subscription Settings Service Application"
$AppPoolAccount = "Crescent\SP16-AppPool"
$AppPoolName = "Service Application App Pool"
$DatabaseServer = "SP16-SQL001"
$DatabaseName = "SP16_SubsSett_ServiceApp"

Try {
    #Set the Error Action
    $ErrorActionPreference = "Stop"

    #Check if Managed account is registered already
    Write-Host -ForegroundColor Yellow "Checking if Application Pool Accounts already exists"
    $AppPoolAccount = Get-SPManagedAccount -Identity $AppPoolAccount -ErrorAction SilentlyContinue
    if($AppPoolAccount -eq $null)
    {
        Write-Host "Please Enter the password for the Service Account..."
        $AppPoolCredentials = Get-Credential $AppPoolAccount
        $AppPoolAccount = New-SPManagedAccount -Credential $AppPoolCredentials
    }
 
    #Check if the application pool exists already
    Write-Host -ForegroundColor Yellow "Checking if the Application Pool already exists"
    $AppPool = Get-SPServiceApplicationPool -Identity $AppPoolName -ErrorAction SilentlyContinue
    if ($AppPool -eq $null)
    {
        Write-Host -ForegroundColor Green "Creating Application Pool"
        $AppPool = New-SPServiceApplicationPool -Name $AppPoolName -Account $AppPoolAccount
    }
 
    #Check if the Service application exists already
    Write-Host -ForegroundColor Yellow "Checking if Subscription Settings Service Application exists already"
    $ServiceApplication = Get-SPServiceApplication -Name $ServiceAppName -ErrorAction SilentlyContinue
    if ($ServiceApplication -eq $null)
    {
        Write-Host -ForegroundColor Green "Creating Subscription Settings Service Application..."
        $ServiceApplication = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $AppPoolName –Name $ServiceAppName –DatabaseName $DatabaseName –DatabaseServer $DatabaseServer 
        $Proxy = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $ServiceApplication
        Write-Host -ForegroundColor Green "Subscription Settings Service Application created successfully!"
    }

    #Start service instance 
    $ServiceInstance = Get-SPServiceInstance | Where-Object { $_.TypeName -eq "Microsoft SharePoint Foundation Subscription Settings Service"}
 
    #Check the Service status
    if ($ServiceInstance.Status -ne "Online")
    {
        Write-Host -ForegroundColor Yellow "Starting the Subscription Settings Service Instance..."
        Start-SPServiceInstance $ServiceInstance
    }

}
catch {
    Write-Host $_.Exception.Message -ForegroundColor Red
 }
 finally {
    #Reset the Error Action to Default
    $ErrorActionPreference = "Continue"
 } 
This creates subscription settings service application in SharePoint 2013 and SharePoint 2016.
how to create subscription settings service application using PowerShell
Tags: add subscription settings service application, configure subscription settings service application, configure the subscription settings service application by using windows powershell, create subscription settings service application, create subscription settings service application sharepoint 2013, how to create subscription settings service application, powershell script to create subscription settings service application, provision a subscription settings service application, setting up the subscription settings service application in sharepoint 2013,use powershell to create the subscription settings service application



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...