Scenario/Problem: You need to obtain a specific safe data provider reference.
Solution: Use the Get-SPExcelDataProvider
cmdlet with a piped where
clause.
The Get-SPExcelDataProvider
cmdlet does not have an Identity
or ProviderID
parameter; therefore, it returns only the entire list of safe data providers. Therefore, you need to pipe the output to a where
clause that finds the particular data provider based on the provider ID. To accomplish this filtering while providing the required Excel Service Application object, you first need to pipe the Excel Service Application object into the Get-SPExcelDataProvider
cmdlet.
This sounds more complicated than it actually is implemented. Listing 21.11 shows an example.
$dataProvider = Get-SPExcelServiceApplication
-Identity "Excel Services Application" | Get-SPExcelDataProvider
| where {$_.ProviderID -eq "Custom DB"}
3.128.190.102