Scenario/Problem: You need to remove a safe data provider from Excel Services.
Solution: Use the Remove-SPExcelDataProvider
cmdlet with a safe data provider variable.
The Remove-SPExcelDataProvider
cmdlet enables you to remove a specific safe data provider from Excel Services. Use this in conjunction with the Get-SPExcelDataProvider
cmdlet (explained in a previous section), as shown in Listing 21.12.
$dataProvider = Get-SPExcelServiceApplication
-Identity "Excel Services Application" | Get-SPExcelDataProvider
| where {$_.ProviderID -eq "Custom DB"}
Remove-SPExcelDataProvider $dataProvider
The Remove-SPExcelDataProvider
cmdlet doesn’t require an Excel Service Application parameter, which makes up for the trouble of having to generate the proper data provider object.
3.21.100.34