Forum Discussion
Thanks for your reply Marsha,
We've tried several options, and can successfully run our Devops pipeline on the remote VM providing a RDP session initiated from a machine that has its Power and Screen saver options turned off.
We will try the method using tscon documented in Disconnecting From Remote Desktop While Running Automated Tests. If we have success running the tscon command manually, we'll then try inserting it into the pipeline.
Thanks
Mark
Hi,
> If we have success running the tscon command manually
Just a note that tscon must be executed with elevated admin credentials.
Hi Everyone,
Alex, you've stolen my thunder 🙂 I was just about to report our success with tscon. We ran the command manually on the RDP machine which 'shut' it down while the Agent was 'listening' for work. Our next step will be to create the batch file to run the tscon command and include it in the nightly pipeline.
So, to run this command (as Alex says, run as an administrator ) within the RDP window, from the Command Line.
>query user (this will return the sessionname eg rdp-tcp#xx)
>tscon.exe rdp-tcp#xx /dest:console
respond "yes" to to close your session
...all done
Hi,
> Alex, you've stolen my thunder
Yes, I am that kind of a guy 😉
I did not verified it from Jenkins but I believe that it should work (and it worked for me in different scenarios) - you may consider to execute this batch file using PowerShell with the '-verb RunAs' to elevate file's privileges (https://ss64.com/ps/syntax-elevate.html)
Thanks everyone that has solved our problem as well and will allow us to start integrating into our pipline.
mbeckham Your question and description of your pipline integration was really good and the exactly where we want to go and the additional PS will be a help in our repeating the same.