PowerShell 操作bcs

 

获取bdc对象模型信息

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

 

效果图:

PowerShell 操作bcs_第1张图片 

导入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

}

 

你可能感兴趣的:(powershell)