1. Display All Safe Data Providers
Scenario/Problem: You need to display all safe data providers configured for a Visio Graphics Service.
Solution: Use the Get-SPVisioSafeDataProvider
cmdlet with the VisioServiceApplication
parameter.
Using the Get-SPVisioSafeDataProvider
cmdlet with the VisioServiceApplication parameter, as shown in Listing 3, displays all configured safe data providers.
Listing 3. Display All Safe Data Providers
Get-SPVisioSafeDataProvider -VisioServiceApplication "Visio Graphics
Service"
2. Get a Specific Safe Data Provider
Scenario/Problem: You need to obtain a specific safe data provider reference.
Solution: Use the Get-SPVisioSafeDataProvider
cmdlet.
The Get-SPVisioSafeDataProvider
cmdlet can be used to retrieve a specific safe data provider using the VisioServiceApplication
and data provider parameters, as shown in Listing 4.
Listing 4. Assigning a Variable to a Specific Data Provider
$dataProvider =
Get-SPVisioSafeDataProvider -VisioServiceApplication "Visio Graphics
Service" -DataProviderID "Custom DB" -DataProviderType 6
This cmdlet uses both the DataProviderID
and the DataProviderType
to identify the safe data provider. If one is excluded, no results are returned.
3. Remove a Safe Data Provider
Scenario/Problem: You need to remove a safe data provider from Visio Graphics Services.
Solution: Use the Remove-SPVisioSafeDataProvider
cmdlet.
The Remove-SPVisioSafeDataProvider
cmdlet enables you to remove a specific safe data provider from Visio Graphics Services. This cmdlet uses both the DataProviderID
and the DataProviderType
to identify the safe data provider, as shown in Listing 5.
Listing 5. Example Script for Removing a Safe Data Provider
Remove-SPVisioSafeDataProvider -VisioServiceApplication "Visio
Graphics Service" -DataProviderID "Custom DB" -DataProviderType 6
4. Setting the Description of a Data Provider
Scenario/Problem: You need to enter a description for a safe provider entry.
Solution: Use the Set-SPVisioSafeDataProvider
cmdlet.
The only purpose of the Set-SPVisioSafeDataProvider
cmdlet is to add or change the description of a specific safe data
provider for a Visio Graphics Service Application. This cmdlet uses
both the DataProviderID
and the DataProviderType
to identify the safe data provider, as shown in Listing 6.
Listing 6. Setting the Description of a Safe Data Provider
Set-SPVisioSafeDataProvider -VisioServiceApplication "Visio Graphics
Service" -DataProviderID "Custom DB" -DataProviderType 6 -Description
"Custom DB Provider"
5. Configuring Visio Performance Settings
Scenario/Problem: You need to modify performance properties of Visio Graphics Services.
Solution: Use the Set-SPVisioPerformance
cmdlet to configure the performance settings.
One of the unique characteristics of the Set-SPVisioPerformance
cmdlet is that it requires all the parameters for configuring the Visio
Graphics Service. Therefore, you must provide a value for each setting,
as shown in Listing 7.
Listing 7. Configuring the Visio Performance Settings
Set-SPVisioPerformance -VisioServiceApplication "Visio Graphics
Service" -MaxDiagramCacheAge 30 -MaxDiagramSize 5 -MaxRecalcDuration
60 -MinDiagramCacheAge 10
The -MaxDiagramCacheAge
parameter determines the maximum number of minutes a diagram should be
cached. A longer cache age reduces memory and CPU utilization because
the diagrams are not refreshed as often. The default value is 60
minutes, but the valid range of values for this parameter is 0 to
34,560 minutes (equating to 24 days).
The -MaxDiagramSize
parameter
determines the largest number of megabytes a Visio diagram can be to
still be processed by the Visio Graphics Service. The default value is
5MB, but the valid range of values for this parameter is 1 to 50MB.
The -MaxRecalcDuration
parameter
determines the maximum number of seconds that the Visio Graphics
Service should spend recalculating a diagram. The default is 60
seconds; the parameter range is 1 to 120 seconds. Any recalculations
that take longer than this setting time out.
The -MinDiagramCacheAge
parameter determines the minimum number of minutes a diagram should be
cached. A longer cache age reduces memory and CPU utilization because
the diagrams are not refreshed as often. The default value is 5
minutes, but the valid range of values for this parameter is 0 to
34,560 minutes (equating to 24 days).
Tip
To force a fixed cache duration, set the MaxDiagramCacheAge
and MinDiagramCacheAge
to the same values.
Tip
Use the Get-SPVisioSafeDataProvider
to verify the description entry or modification.