I have a release definition in TFS with 2 tasks. One of them passes perfectly, while the other throws an exception, though both have very smimlar configuration.
The successful task configuration:
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
The failing task configuration:
RunPowerShellOnRemoteComputer Task
Machines $(WebServers)
Admin Login: server\user
Password: Password
Protocol: HTTP
PowerShell Script: C:\...\script.ps1
Variables: WebServers: MyServer
When running the second task I receive this exception:
Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." CategoryInfo :NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId :Exception ---> System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." --- End of inner exception stack trace --- at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable) at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallServiceInternal(String serviceSourcePath, String serviceName, String destinationFileName) at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallService(String serviceSourcePath, String serviceName, String destinationFileName) at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.d__24.MoveNext() ---> (Inner Exception #0) System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information."<--- Deployment status for machine 'bgsovswops.eu.hpecorp.net:5985' : 'Failed' ##[error], MethodInvocationException\r\n FullyQualifiedErrorId :Exception\r\n"}};] ##[error]System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployer3e199746-ae71-4ba0-a2ef-f5ce8f25a631' from service executable path VisualStudioRemoteDeployer.exe . Consult the logs below: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." CategoryInfo :NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId :Exception
---> System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployer3e199746-ae71-4ba0-a2ef-f5ce8f25a631' from service executable path VisualStudioRemoteDeployer.exe . Consult the logs below: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." CategoryInfo :NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId :Exception--- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable
input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection
1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection
1 output, PSInvocationSettings settings) at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
When I go to the remote machine, I succesfully execute the 'Invoke-Expression' on the C:...\script.ps1.
Also, I successfully connect from the local machines' powerscript console to the remote machine.
Any suggestions appreciated.
Please include the domain in the username variable. If it’s not domain environment, it should be the machine name.
So, just try to update the UPN user name format to DOMAIN\Username or MACHINENAME\Username format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With