Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I can export external content type from SharePoint Designer or Central Administration. However, I want to export ect as bdcm file with powershell in order to export ect automatically.

There is an exapmle in techNet Export-SPBusinessDataCatalogModel;

  $Model = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Model" - Name "ContosoModel"  -ServiceContext http://contoso  
  Export-SPBusinessDataCatalogModel -Identity $Model -Path "C:\folder\model.bdcm"  

File was created with this command but the file content is not similar with SP Designer export file.

How can I do that.

share|improve this question
add comment

2 Answers

I've used this in the past with success for a full catalog

$mybcsMeta = Get-SPBusinessDataCatalogMetadataObject –ServiceContext http://sp.local –BDCObjectType Catalog –Name MyModel
Export-SPBusinessDataCatalogModel –Identity $mybcsMeta –Path C:\BCS_Model.bdcm

The differences could come from the use of the parameters which have different defaults via UI(SPD or SPCA vs Powershell).

  • ModelsIncluded —Models are included in the exported XML file
  • PermissionsIncluded —The permissions to the model are included in
    the export
  • PropertiesIncluded —Specifies that BCS properties are included in the export
share|improve this answer
    
If I am wrong, please correct me! Your suggestion is not a different solution from my script. I don't understand that why we set the parameters instead of using values directly. I think no difference!! –  mkacar Aug 7 '12 at 11:43
    
You are right, thank you, while executing the command I've made a copy/paste, see updated answer please! –  C. Marius - MVP Aug 7 '12 at 14:12
    
I am looking on exporting bdcm file with powershell or c#, I couldn't find specific example or information about that. How can I use ModelsIncluded or PropertiesIncluded? Thanks.. –  mkacar Aug 8 '12 at 14:33
add comment

Try change -BdcObjectType Model to LobSystem

share|improve this answer
    
While this post may answer the question, we prefer more details such as "why". Please edit your post with additional details. See answer for general guidelines. –  SPDoctor Aug 7 '12 at 12:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.