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"

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s