New-SPExcelDataProvider

向 Excel Services 应用程序中添加新的安全数据提供程序。

语法

New-SPExcelDataProvider
   -ExcelServiceApplication <SPExcelServiceApplicationPipeBind>
   -ProviderId <String>
   -ProviderType <DataProviderType>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-Description <String>]
   [-WhatIf]
   [<CommonParameters>]

说明

New-SPExcelDataProvider cmdlet 将数据提供程序添加到Excel Services应用程序 Web 服务应用程序中的安全数据提供程序列表。 Excel Services仅当连接的数据提供程序位于安全数据提供程序列表中时,应用程序才会刷新外部数据连接。 Excel Services应用程序包含此列表中的一组常见数据提供程序。 因此,通常仅在自定义数据连接方案中才使用 cmdlet 修改安全数据提供程序。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

------------------示例 1------------------

Get-SPExcelServiceApplication -identity "MyExcelService" | New-SPExcelDataProvider -providerID "CustomOLEDB" -ProviderType OleDb -description "This is a custom OLEDB provider"

本示例将新的自定义 OLEDB 数据提供程序添加到名为 MyExcelService 的Excel Services应用程序 Web 服务应用程序的安全数据提供程序列表中。

------------------示例 2------------------

Get-SPExcelServiceApplication | New-SPExcelDataProvider -providerID "CustomOLEDB" -ProviderType OleDb -description "This is a custom OLEDB provider"

本示例将新的自定义 OLEDB 数据提供程序添加到场中所有Excel Services应用程序 Web 服务应用程序的安全数据提供程序列表。

参数

-Confirm

执行命令前,看到确认提示。 有关详细信息,请键入以下命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ExcelServiceApplication

指定包含 SPExcelDataProvider 列表对象的 Excel Services Application Web 服务应用程序。

该类型必须是有效的 GUID,格式为 12345678-90ab-cdef-1234-567890bcdefgh;场中Excel Services应用程序 Web 服务应用程序的有效名称 (例如 MyExcelService1) ;或有效的 SPExcelServiceApplication 对象的实例。

Type:SPExcelServiceApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ProviderId

Specifies the name of the provider. This ID should be present in the connection strings generated by this provider and the ID must be unique for the provider type.

键入的值必须是提供程序的有效名称,例如,CustomOLEDB。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ProviderType

指定要添加到安全提供程序列表中的受支持的数据提供程序类型。

键入的值必须为以下项之一:OleDb、Odbc 或 OdbcDsn。

Type:DataProviderType
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-描述

指定新数据提供程序的友好说明。

键入的值必须是有效的字符串;例如,“这是自定义 OLEDB 提供程序”。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013