TFS:使用"2"参数调用"SetRight"的异常:"无法获取用户信息."

Vla*_*kov 5 powershell tfs

我在TFS中有一个包含2个任务的发布定义.其中一个完美传递,而另一个抛出异常,但两个都有非常模糊的配置.

成功的任务配置:

CopyFile Task
Source: $(System.DefaultWorkingDirectory)/XXX Build Definition/drop
Machines $(WebServers)
Admin Login: server\user
Password: Password
Protocol: HTTP
Destination Folder: C:\DestFolder

Variables: WebServers: MyServer
Run Code Online (Sandbox Code Playgroud)

失败的任务配置:

RunPowerShellOnRemoteComputer Task
Machines $(WebServers)
Admin Login: server\user
Password: Password
Protocol: HTTP

PowerShell Script: C:\...\script.ps1

Variables: WebServers: MyServer
Run Code Online (Sandbox Code Playgroud)

运行第二个任务时,我收到此异常:

使用"2"参数调用"SetRight"的异常:"无法获取用户信息." CategoryInfo:NotSpecified:(:) [],MethodInvocationException FullyQualifiedErrorId:Exception ---> System.Management.Automation.RemoteException:使用"2"参数调用"SetRight"的异常:"无法获取用户信息." ---内部异常堆栈跟踪的结束---在Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment的Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(String errorContextMessage,Boolean writeResultToLog,Boolean isCancellable)中Microsoft.VisualStudio.Services.DevTestLabs.Deployment上的Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallService(String serviceSourcePath,String serviceName,String destinationFileName)中的.RemoteDeploymentHelper.InstallServiceInternal(String serviceSourcePath,String serviceName,String destinationFileName). .Deployment.DeploymentClient.d__24.MoveNext()--->(内部异常#0)System.Management.Automation.RemoteException:使用"2"参数调用"SetRight"的异常:"无法获取用户信息. "<---机器的部署状态'bgsovswops.eu.hpecorp.net:5985':'失败'## [错误],MethodInvocationException\r \n \n FullyQualifiedErrorId:Except ion\r \n"}};] ## [error] System.Management.Automation.RuntimeException:无法从服务可执行文件路径VisualStudioRemoteDeployer.exe安装"VisualStudioRemoteDeployer3e199746-ae71-4ba0-a2ef-f5ce8f25a631".请参考下面的日志:使用"2"参数调用"SetRight"的异常:"无法获取用户信息." CategoryInfo:NotSpecified:(:) [],MethodInvocationException FullyQualifiedErrorId:Exception
---> System.Management.Automation.RuntimeException:无法从服务可执行文件路径VisualStudioRemoteDeployer.exe安装'VisualStudioRemoteDeployer3e199746-ae71-4ba0-a2ef-f5ce8f25a631'.请参考下面的日志:使用"2"参数调用"SetRight"的异常:"无法获取用户信息." CategoryInfo:NotSpecified:(:) [],MethodInvocationException FullyQualifiedErrorId:Exception

--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable
Run Code Online (Sandbox Code Playgroud)

输入)在System.Management.Automation.Aowermation.PowerInvokeHelper的System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse,Boolean isSync)上的System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs,Boolean performSyncInvoke) [TInput,TOutput](PSDataCollection 1 input, PSDataCollection1输出,PSInvocationSettings设置)在System.Management.Automation.PowerShell.CoreInvoke [TInput,TOutput](PSDataCollection 1 input, PSDataCollection1输出,PSInvocationSettings设置)在Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main (String [] args)

当我去远程机器时,我成功地在C:...\script.ps1上执行'Invoke-Expression'.

此外,我成功地从本地计算机的powerscript控制台连接到远程计算机.

任何建议赞赏.

And*_*SFT 12

请在username变量中包含.如果它不是域环境,则应该是计算机名称.

因此,只需尝试将UPN用户名格式更新为DOMAIN\UsernameMACHINENAME\Username格式.