This Powershell script exports Business Data Connectivity (BDC) service models from SharePoint.
# Get list of of all bdc models
$bdcs = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType “Model” -Name * -ServiceContext http://sharepoint
foreach($bdc in $bdcs)
{
# create a unique file name using the bdc name
$path = “.\$($bdc.DefaultDisplayName).bdcm”
# fetch the BDC object
$Model = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType “Model” -Name $bdc.DefaultDisplayName -ServiceContext http://sharepoint
Export-SPBusinessDataCatalogModel -Force -Identity $Model -Path $path
}
This script was developed by Dhejo Prothasis, Lead Architect at Acquiresoft Solutions.
0 Responses to “Powershell script to export BDC models from SharePoint”