Executing a .exe using Powershell on a remote server with Azure agent

Copper Contributor

Hi,

I have a Windows 2012 server with a Azure DevOps agent running on it. The agent was registered with a regular Windows NT authority login. I am required to execute a powershell task using the Azure DevOps pipeline. The powershell will execute a .exe hosted on the server but it needs to pass some user credentials to the .exe.  

In the pipeline task, we have tried using the Start-Process cmdlet and passed the path to the .exe, and argument objects, but the pipeline doesn't execute the powershell script. It looks like in order for the agent to launch the Powershell remotely, it needs to have Administrator privileges.  Can someone verify this is true? If yes, how can we elevate the agent privileges to allow it to launch the PS session?

 

Any help appreciated.

7 Replies
What errors are you receiving in the pipeline?
Actually that's the funny part - there is no error displayed in the pipeline, but it executes successfully. However, the outcome of the .exe is not realized (it's supposed to produce a log file on the server). After much trying, we were able to tweak some things and finally found that the PS session was not launching to execute the exe. However, when we login manually to the server,open a PS session and execute the .exe, it runs successfully.
Can you share how are you calling the .exe?
Hi - we were able to finally resolve this. No further help required.

@vaibhavkolheI have the same problem. Can you please tell more details?

@RomanPavliv - The team member who resolved it is currently on leave. I should be able to provide a response next week.