New-SPWOPIBinding
创建新的绑定以将文件扩展名或应用程序与运行此 cmdlet 的当前 SharePoint 场中的操作关联。
语法
Default (默认值)
New-SPWOPIBinding
-ServerName <String>
[-Action <String>]
[-AllowHTTP]
[-Application <String>]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-Extension <String>]
[-FileName <String>]
[-ProgId <String>]
[-WhatIf]
[<CommonParameters>]
说明
cmdlet 将 New-SPWOPIBinding 文件扩展名或应用程序关联到运行此 cmdlet 的当前 SharePoint 场上的作。
每个绑定均允许您使用 WOPI 应用程序来查看或编辑 SharePoint 库中的文件。
例如,当用户在 SharePoint 文档列表中看到Word文档时,SharePoint 列表将显示根据绑定到该 SharePoint 场Word的作查看或编辑文档的可用选项。
若要将 WOPI 应用程序(例如运行 Office Web 应用 Server 的服务器)用于 Office Web 应用,必须先在 SharePoint 场上运行此 cmdlet,然后才能使用 Office Web 应用。
如果针对绑定 (或关联) 已经存在的应用程序或文件扩展名运行 New-SPWOPIBinding ,则 cmdlet 将失败。
有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet。
示例
示例 1
New-SPWOPIBinding -ServerName "Server.corp.Contoso.com"
该示例为在运行此 cmdlet 的当前 SharePoint 场上的 WOPI 应用程序支持的所有应用程序和文件扩展名创建绑定。
示例 2
New-SPWOPIBinding -ServerName "Server.corp.Contoso.com" -Application "Excel"
该示例将 Excel 与运行此 cmdlet 的当前 SharePoint 场上的 WOPI 应用程序可对 Excel 执行的所有操作关联。
参数
-Action
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要绑定的操作。
例如,“view”、“edit”和“embedview”。有关 WOPI 应用程序支持的作列表,请运行 Get-SPWOPIBinding。
通常,您将不使用此参数。
如果您指定某些操作而非其他操作,则一些 SharePoint 功能将不起作用。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-AllowHTTP
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定 cmdlet 可使用 HTTP 来发现 WOPI 应用程序支持的内容。
如果将此参数的值指定为 True,则将通过非安全连接发送 WOPI 应用程序中的发现信息。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Application
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要绑定的应用程序。
可能的应用程序如下:“Word”、“Excel”、“PowerPoint”或“OneNote”。运行 Get-SPWOPIBinding 以获取 WOPI 应用程序支持的应用程序的完整列表。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-AssignmentCollection
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
在使用 Global 参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。
参数属性
| 类型: | SPAssignmentCollection |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Confirm
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
执行命令前,看到确认提示。
有关详细信息,请键入以下命令:get-help about_commonparameters
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | cf |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Extension
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要绑定的文件扩展名。
运行 Get-SPWOPIBinding 以获取 WOPI 应用程序支持的文件扩展名列表。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-FileName
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定包含 WOPI 应用程序的发现信息的 xml 文件的路径。
您可以从 xml 文件加载发现信息,而不是直接从 WOPI 应用程序请求该信息。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ProgId
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要绑定的应用程序的编程标识符 (ProgID)。
运行 Get-SPWOPIBinding 以获取 WOPI 应用程序支持的 ProgID 列表。
您可能只希望使用此参数来将操作与 OneNote 文件夹关联。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ServerName
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定 WOPI 应用程序(如运行 Office Web Apps Server的服务器)的名称或完全限定的域名 (FQDN)。
这也可以是多个 Office Web 应用 服务器的负载均衡终结点的 FQDN。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-WhatIf
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
显示一条描述命令作用的消息,而不执行命令。
有关详细信息,请键入以下命令:get-help about_commonparameters
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | 无线 |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。