Importing bDCM file to BDC


Althought BDCM files can be copied to BDC store using UI or solution packages but you can also use PowerShell.

$filename = “e:\BDC.BDCM”

$metadataStore = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Catalog" -ServiceContext "http://site.contoso.com" Import-SPBusinessDataCatalogModel -Path $filename -Identity $metadataStore -Force Remove-Item $filename $entity = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Entity" -ServiceContext "http://site.contoso.com" -Name "Entity1" -Namespace "Namespace.Domain" $claimAdmin = New-SPClaimsPrincipal -Identity "contoso\spadmin" -IdentityType WindowsSamAccountName Grant-SPBusinessDataCatalogMetadataObject -Identity $entity -Principal $claimAdmin -Right "Execute,SetPermissions,Edit,SelectableInClients" $claimUsers = New-SPClaimsPrincipal -Identity "Domain Users" -IdentityType WindowsSamAccountName Grant-SPBusinessDataCatalogMetadataObject -Identity $entity -Principal $claimUsers -Right "Execute,Edit,SelectableInClients"