首页 | 新闻 | 交流 | 问吧 | 文档 | 手册 | 下载 | 博客

PowerShell 操作bcs

作者:  时间: 2011-05-06

 

获取bdc对象模型信息

Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Model" -Name "sumhModel" -ServiceContext http://win08r2/

 

效果图:

 

导入BDC模型

$PSSnapinSharePoin = Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction silentlycontinue

if( $PSSnapinSharePoin -eq $Null)

{

Add-PSSnapin Microsoft.SharePoint.PowerShell;

}        

$bcs=Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Catalog" -ServiceContext http://win08r2/

Import-SPBusinessDataCatalogModel -Path "c:http://www.cnblogs.com/sumh/admin/file://testmodel.xml/" -Identity $bcs

 

删除BDC模型

$PSSnapinSharePoin = Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction silentlycontinue

if( $PSSnapinSharePoin -eq $Null)

{

Add-PSSnapin Microsoft.SharePoint.PowerShell;

}        

$bcs=Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Model" -Name "testModel" -ServiceContext http://win08r2/

if($bcs)

{

Remove-SPBusinessDataCatalogModel -Identity $bcs

}