Friday, May 6, 2016

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



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...