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?
-
check this one gallery.technet.microsoft.com/scriptcenter/…Waqas Sarwar MVP– Waqas Sarwar MVP ♦2015-04-28 15:00:50 +00:00Commented Apr 28, 2015 at 15:00
-
@Waqas Thanks, but that article describes creating lists for ECTs that already exist. I want to create the ECTs themselves.J T– J T2015-04-28 15:10:16 +00:00Commented Apr 28, 2015 at 15:10
-
right, i think then Amal's answer is the best approach.Waqas Sarwar MVP– Waqas Sarwar MVP ♦2015-04-28 15:14:40 +00:00Commented Apr 28, 2015 at 15:14
Add a comment
|
1 Answer
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
- Create ECT using SharePoint Designer
- Now you can export the ECT to the
bdcmfile - 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
-
How do you modify the database connection?love thakker– love thakker2017-04-06 06:43:59 +00:00Commented Apr 6, 2017 at 6:43
-
You can edit the bdcm file using any text editor and change the connection detailsAmal Hashim– Amal Hashim2017-04-06 09:59:13 +00:00Commented Apr 6, 2017 at 9:59