何时替代代理设置
-
代理需要身份验证:用于桌面或计算机运行时应用程序的 Power Automate 失败并出现 System.Net.WebException:远程服务器返回错误: (407) 需要代理身份验证
-
检查下面的“经过身份验证的代理设置”步骤
-
-
目标最终用户 (支持人员、SCCM...) 未安装用于桌面安装程序的 Power Automate:PAD 或计算机注册应用程序失败并出现 System.Net.WebException。
-
根据代理要求,检查下面的“经过身份验证”或“未经身份验证的代理”设置步骤。
-
先决条件
确保代理/防火墙允许连接到 Power Automate 云服务
此处提到了云服务终结点列表: IP 地址配置 - Power Automate |Microsoft Learn
在你开始之前
重要说明: 如果使用的是适用于桌面版 2.45或更高版本的 Power Automate,请离开此页面, 并改为按照这些说明进行操作。 强烈建议使用内部版本 2.45 或更高版本来配置代理设置,因为它允许代理配置在升级后持久存在。 如果需要使用旧版本,请继续阅读。
2.44 或更低版本的代理安装 ()
-
创建或替代 PAD 注册表代理设置 UseDefaultCredentials with 1 和 ProxyServer with 目标代理地址。
-
重写 Power Automate 服务代理设置
-
以管理员身份打开文本编辑器并加载以下文件:
-
“C:\Program Files (x86) \Power Automate Desktop\UIFlowService.exe.config”
-
“C:\Program Files (x86) \Power Automate Desktop\PAD.Robot.exe.config”
-
-
在开始 <system.net>标记的正下方,粘贴以下内容
-
In case the proxy is configured by address: <defaultProxy useDefaultCredentials="True"> <proxy bypassonlocal="True" proxyaddress="replace_with_your_proxy_address" /> </defaultProxy>
-
In case the proxy is configured by script location: <defaultProxy useDefaultCredentials="True"> <proxy scriptLocation="replace_with_your_proxy_script_location" /> </defaultProxy>
-
-
将 “replace_with_your_proxy_address”或“replace_with_your_proxy_script_location” 替换为这两个文件中的目标配置
-
保存 文件
-
-
使用允许的域服务帐户更改“Power Automate 服务” 帐户
-
使用 故障排除工具 UI “更改服务帐户”功能
-
或使用 故障排除工具控制台
-
使用帐户密码创建临时文件“temporary.txt”
-
将此文件放在“C:\Program Files (x86) \Power Automate Desktop\”文件夹中
-
将 <帐户名替换为目标帐户> 后,运行以下命令 2 个命令
cd " C:\Program Files (x86)\Power Automate Desktop\” “TroubleshootingTool.Console.exe ChangeUIFlowServiceAccount <accountname> < temporary.txt”
-
删除临时文件
-
-
2.44 或更低版本的未经身份验证的代理设置 ()
通常不需要执行此步骤,除非目标最终用户 (支持人员、SCCM、...)
-
重写 “Power Automate 服务”代理设置
-
以管理员身份打开文本编辑器并加载以下文件:
-
“C:\Program Files (x86) \Power Automate Desktop\UIFlowService.exe.config”
-
“C:\Program Files (x86) \Power Automate Desktop\PAD.Robot.exe.config”
-
-
在开始 <system.net>标记的正下方,粘贴以下内容
-
In case the proxy is configured by address: <defaultProxy> <proxy bypassonlocal="True" proxyaddress="replace_with_your_proxy_address" /> </defaultProxy>
-
In case the proxy is configured by script location: <defaultProxy> <proxy scriptLocation="replace_with_your_proxy_script_location" /> </defaultProxy>
-
-
将 “replace_with_your_proxy_address”或“replace_with_your_proxy_script_location”替换为 这两个文件中的目标配置
-
保存 文件
-
-
重启“Power Automate 服务”
-
打开 services.msc
-
查找“Power Automate 服务”
-
右键单击并重启
-
注意
-
每次版本升级时都会覆盖上述设置。 强烈建议迁移到 支持静态代理配置文件 的 Power Automate 桌面版,以避免此行为。
-
如果在文件中找不到 <system.net> 标记,则应创建相关的开始标记和结束标记,并且可以粘贴右上方的结束 </configuration> 标记,以避免任何错误配置,如下所示:
<system.net>
<!-- put the proxy settings here -->
</system.net>
-
如果在服务重启后代理设置生效时遇到问题,请尝试从系统的控制面板中清除 Internet 缓存。 为此,请转到“控制面板”,搜索并打开“Internet 选项”。 在“常规”选项卡中,单击“删除”。 确保至少选择了“临时 Internet 文件”和“Cookie”,并点击“删除”。