Create BDC (BCS) Service Application in SharePoint 2013/2016 using PowerShell

Business Data Connectivity Services service application provides centralized infrastructure to connect and manipulate with external line of business data sources through external list concept. Here is the PowerShell script to create Business Data Connectivity Service Application in SharePoint 2016.

PowerShell script to create BDC Service Application in SharePoint 2013 / 2016:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Parameters
$ServiceAppName = "Crescent BDC Service Application"
$ServiceAppProxyName = "Crescent BDC Service Application Proxy"
$AppPoolAccount = "Crescent\SP16-AppPool"
$AppPoolName = "Service Application App Pool"
$DatabaseServer = "SP16-SQL001"
$DatabaseName = "SP16_BDC_ServiceApp"

#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 BDC Service Application exists already..."
$ServiceApplication = Get-SPServiceApplication -Name $ServiceAppName -ErrorAction SilentlyContinue
if ($ServiceApplication -eq $null)
{
    Write-Host -ForegroundColor Green "Creating BDC Service Application..."
    $ServiceApplication = New-SPBusinessDataCatalogServiceApplication -ApplicationPool $AppPoolName -DatabaseName $DatabaseName -DatabaseServer $DatabaseServer -Name $ServiceAppName
}

#Start service instance 
Write-Host -ForegroundColor Yellow "Starting the BDC Service Instance..."
$ServiceInstance = Get-SPServiceInstance | Where-Object { $_.TypeName -like "*Business*" }
Start-SPServiceInstance $ServiceInstance

Write-Host -ForegroundColor Green "BDC Service Application created successfully!"

This PowerShell script creates new BDC service application in SharePoint 2016.

create business data connectivity service application in sharepoint 2016 using powershell

If you want to create BDC service application using SharePoint central Admin, use: How to Create BDC Service application in SharePoint 2016

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *