0

Is it possible to create an external content type in SharePoint 2013 using PowerShell? For example, I have a view in a SQL database, and normally I would use SharePoint Designer to create an external content type with read and list operations on that view. Is anyone aware of resources that explain how this can be done in PowerShell?

3

1 Answer 1

0

External Content Type usually get exported and imported as bdcm files. If you observe it is an XML file which basically has following information

  • External System (Information about which system it is connected)
  • Methods (Operation like Finder, Specific Finder etc)

Now I am not sure is there any API which is available to do this. I believe it will be more time consuming. So instead I would suggest

  1. Create ECT using SharePoint Designer
  2. Now you can export the ECT to the bdcm file
  3. Now you can use PowerShell to import it into other environments

PowerShell Script to Import BDCM Model File

$bdc = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Catalog" -ServiceContext http://siteurl
Import-SPBusinessDataCatalogModel -Path "C:\path\model.bdcm" -Identity $bdc
2
  • How do you modify the database connection? Apr 6, 2017 at 6:43
  • You can edit the bdcm file using any text editor and change the connection details Apr 6, 2017 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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