Sharepoint 2010 Create External List using Powershell
SharePoint 2010 has introduced a new type of List called External List. The External List is used for displaying content that comes from Business Connectivity Services (BCS) Enterprise content types. Business Connectivity Services is the replacement in SharePoint 2010 for The Business Data Catalog (BDC) in SharePoint 2007.
External List needs External Content type for creating itself. External Content Type is created using either SharePoint Designer 2010 or Visual Studio 2010. Once the External Content Type is created, you can create the external list either from the Create page in SharePoint or via SharePoint Designer or Powershell.
Here is an example to create External List Using Powershell.
External List needs External Content type for creating itself. External Content Type is created using either SharePoint Designer 2010 or Visual Studio 2010. Once the External Content Type is created, you can create the external list either from the Create page in SharePoint or via SharePoint Designer or Powershell.
Here is an example to create External List Using Powershell.
clear
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell $SiteUrl = "Site Url" $BusinessListName = "BusinessList"$ConfigListName = "Config"
$spweb = Get-SPWeb $SiteUrl
$ListGUID = ""
$ListUrl = "Lists/{0}"
Write-Host "Creating and Configuring SPListDataSource"
$ds = New-Object -TypeName Microsoft.SharePoint.SPListDataSource
$ListCollection = $spweb.Lists
$ds.SetProperty("LobSystemInstance", "Lob System Instance Name") #Info related to external content type $ds.SetProperty("EntityNamespace", "Entity Namespace") #Info related to external content type $ds.SetProperty("Entity", "Entity Name") #Info related to external content type $ds.SetProperty("SpecificFinder", "Specific Finder")
Write-Host "Checking for list instance existence"
$list = $spweb.Lists[$BusinessListName];
if($list)
{
Write-Host "List exists - " + $BusinessListName + " - deleting the list"
$list.Delete();
}
Write-Host "Creating " + $BusinessListName + " list with Data Source.."
$ListGUID = $spweb.Lists.Add($BusinessListName, "Description", "Title", $ds) Write-Host $ListGUID
$ListCollection[$ListGUID].Update();
$spweb.Update(); Write-Host "List created successfully.." +
$list = $spweb.Lists[$ConfigListName];
if($list)
{
Write-Host "List exists - Config - deleting the list"
$list.Delete();
}
Wow I like this article a lot and it easy to understand
ReplyDeletesharepoint administrator certification
Classic titanium trim used in a modern sports betting
ReplyDeleteThe 'Torta Style' was originally titanium guitar chords designed with the intent of allowing bettors to place a titanium nipple jewelry bet on several individual titanium banger teams, such titanium tv alternative as the titanium hoop earrings Golden State
sr886 hey dude japan,pitviperoculos,supra footwear norge,danner uk,hey dude schuhe damen,zapatillas supra,timberland outlet,aldo mexico,danner norge mb812
ReplyDelete