SharePoint Infopath表单服务-PowerShell

1. 激活可浏览的表单模板

Set-SPInfoPathFormsService -AllowUserFormBrowserEnabling $true
-AllowUserFormBrowserRendering $true

2. 设置数据连接超时

Set-SPInfoPathFormsService –DefaultDataConnectionTimeout 15
–MaxDataConnectionTimeout 25

3. 设置数据连接响应大小

Set-SPInfoPathFormsService –MaxDataConnectionResponseSize 3

4. 修改认证设置

Set-SPInfoPathFormsService –RequireSslForDataConnections $true –
AllowEmbeddedSqlForDataConnection $true –
AllowUdcAuthenticationForDataConnections $true –
AllowUserFormCrossDomainDataConnections $true

RequireSslForDataConnections:True为表单使用HTTP认证时需要SSL加密。

AllowEmbeddedSqlForDataConnection:当有包含用户名和密码的数据库连接信息的数据连接文件时,设置为True。

AllowUdcAuthenticationForDataConnections:是否允许自定义表单通过数据连接文件访问数据源。

AllowUserFormCrossDomainDataConnections:当表单需要访问与SharePoint不同的数据源时,设置为True。

5. 设置会话状态

Set-SPInfoPathFormsService –MaxPostbacksPerSession 110 –
ActiveSessionTimeout 720

6. 启用视图状态

Set-SPInfoPathFormsService –AllowViewState $true –ViewStateThreshold
40961

7. 验证并上传表单模板

Test-SPInfoPathFormTemplate
-Path "<<full path to InfoPath form template>>" 
Install-SPInfoPathFormTemplate-Path "<<full path to InfoPath form template>>"

8. 一次上传多个表单模板

"<<path of form 1>>" , "<<path of form 2>" , "<<path of form 3>>" |
Install-SPInfoPathFormTemplate

9. 激活/反激活网站集的表单模板

Enable-SPInfoPathFormTemplate
-Identity "<<name of form template>>"
-Site "<<URL of Site Collection>>" 
Disable-SPInfoPathFormTemplate
-Identity "<<name of form template>>"
-Site "<<URL of Site Collection>>"

10. 从InfoPath表单服务移除一个表单

Uninstall-SPInfoPathFormTemplate -Identity "<<name of form template>>"

11. 禁用InfoPath表单服务中的某一表单

Stop-SPInfoPathFormTemplate -Identity "<<name of form template>>"

12. 启用Web服务代理

Set-SPInfoPathWebServiceProxy -Identity "<<URL of web application>>"
-AllowWebServiceProxy $true
Set-SPInfoPathWebServiceProxy -Identity "<<URL of web application>>"
-AllowForUserForms $true
原文地址:https://www.cnblogs.com/justinliu/p/5961720.html