Get a Specific Safe Data Provider


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.

Listing 21.11. Assigning a Variable to a Specific Data Provider


$dataProvider = Get-SPExcelServiceApplication
-Identity "Excel Services Application" | Get-SPExcelDataProvider
 | where {$_.ProviderID -eq "Custom DB"}


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.190.102