How to keep Azure VM unlocked when close the RDC connection?

99 Views Asked by At

I am running the UiPath Community Version on my Azure VM. I have scheduled some processes on the machine. The problem I am facing is that when I close the RDC connection, the machine gets locked instantly. When machine gets locked the processes that runs foreground fails. Can anyone guide me with any solution that can help? Thanks in advance.

Its windows 11 that is running and enabled all the options to keep machine unlock but still when I close it. The machine gets locked instantly.

1

There are 1 best solutions below

0
Venkat V On

How to keep Azure VM unlocked when close the RDC connection?

To prevent Azure Windows VM from locking the screen when you disconnect from a RDP session, you can modify the Group Policy settings on the Azure VM. Here are steps the to follow.

  1. Open run and type gpedit.msc

  2. In the Group Policy Editor, navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits.

  3. Click on "Set time limit for disconnected sessions" policy setting.

  4. Select the Enabled option.

  5. Set the time limit to Never.

  6. Click OK to save the changes.

enter image description here

When I execute the PowerShell script on an Azure VM and close the RDP, then reopen it to check if the script is still running, I find that the script is still running, as shown below.

enter image description here

This will disable screen locking on Windows when disconnecting from Remote Desktop, but consider security implications for public network access or shared VM usage.

Reference : How to keep an RDP session alive?