Powershell WinRM访问被拒绝(Visual Studio团队服务的生成定义中的Azure文件复制任务)

Powershell WinRM访问被拒绝(Visual Studio团队服务的生成定义中的Azure文件复制任务),powershell,azure,azure-devops,azure-pipelines-build-task,Powershell,Azure,Azure Devops,Azure Pipelines Build Task,我在团队服务的生成定义中有一个“Azure文件副本”任务(是Visual Studio Online)。每当我运行此命令时,都会出现“拒绝访问”错误。我已经试着解决这个问题好几个小时了,但运气不好 Copy started for machine: 'MACHINE NAME' Copy status for machine 'MACHINE NAME' : 'Failed' Connecting to remote server [IP ADDRESS] failed with the fol

我在团队服务的生成定义中有一个“Azure文件副本”任务(是Visual Studio Online)。每当我运行此命令时,都会出现“拒绝访问”错误。我已经试着解决这个问题好几个小时了,但运气不好

Copy started for machine: 'MACHINE NAME'
Copy status for machine 'MACHINE NAME' : 'Failed'
Connecting to remote server [IP ADDRESS] failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.To fix WinRM connection related issues, select the 'Enable Copy Prerequisites' option in the task. If set already, and the target Virtual Machines are backed by a Load balancer, ensure Inbound NAT rules are configured for target port (5986). Applicable only for ARM VMs. For more info please refer to http://aka.ms/azurefilecopyreadme
******************************************************************************
Finishing task: AzureFileCopy
******************************************************************************
Task AzureFileCopy failed. This caused the job to fail. Look at the logs for the task for more details.
******************************************************************************
Finishing Build
******************************************************************************
我尝试了以下方法:

  • 生成任务上的“启用复制先决条件”复选框
  • 使用PSSession-ShowSecurityDescriptionRui将用户帐户直接分配给具有“完全控制”权限的Microsoft.Powershell
  • 已将计算机添加到TrustedHosts列表
  • 确保必要的端口已解锁(入站和出站)
考虑到这是一个Microsoft SaaS产品,只使用Microsoft Azure体系结构连接到标准的Azure VM,我很惊讶这会如此困难。我一定错过了一些简单的东西


提前感谢您的建议。

我犯了一个错误,使用builtin\administrator作为用户名,但经过几个小时的调试,我发现这是一个UPN,是不允许的。我把它改成了.\administrator,效果很好


另外,请查看此网站进行疑难解答,它确实详细介绍了一些内容:

您在“Azure文件副本”中输入的用户名和密码是什么?错误消息也可能由不正确的用户名/密码引起。只需使用VM的主管理员帐户即可。我尝试过使用和不使用PC名称作为前缀。我已以纯文本形式输入密码(不使用变量)。不过,这一点很好-因为我故意使用了错误的凭据,但收到了完全相同的消息。如果您有任何关于我如何排除这一可能原因的提示,将不胜感激!非常感谢。