PowerShell 操作bcs

2019-04-14 19:43发布

获取bdc对象模型信息 Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Model" -Name "sumhModel" -ServiceContexthttp://win08r2/ 效果图: 导入BDC模型 $PSSnapinSharePoin = Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction silentlycontinue if( $PSSnapinSharePoin -eq $Null) { Add-PSSnapin Microsoft.SharePoint.PowerShell; }        $bcs=Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Catalog" -ServiceContexthttp://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" -ServiceContexthttp://win08r2/ if($bcs) { Remove-SPBusinessDataCatalogModel -Identity $bcs }