web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate Desktop...
Power Automate
Answered

Power Automate Desktop flow stops when the Remote Desktop is diconnected

(0) ShareShare
ReportReport
Posted on by 1

I login into Remote virtual Machine and work on it.

 

I have created a Power Automate Desktop Flow, PAD Flow is running successfully when I am logged into the Remote virtual Machine and the Remote virtual Machine is on the screen.

 

PAD flow fails when the Remote virtual Machine is closed or disconnected
,

Can you guide me on how to make it run in the background when the Remote virtual Machine screen is disconnected or the Remote Desktop is closed.

Getting below Error:-

NoUnlockedActiveSessionForAttended

No unlocked user sessions found on the target machine. Cannot execute attended desktop flow.

I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Running a desktop flow in Attended mode only works when there is an active user session on the machine. You must be logged in to it for it to work. When you close your Remote Desktop session, you get signed out, so attended flows cannot be run.

     

    You will either need to stay signed in, or use the unattended mode (which will require that you purchase the unattended RPA add-on).

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Agnius solution aligns with my thoughts. While setting up your desktop flow within the cloud flow, a dedicated connection is established for your machine. Hence, the bot will operate in attended run mode only if you are signed in to that machine/VDI/VM, otherwise, it will encounter an error.

    Deenuji_0-1689687943264.png

    Please refer the above image what hint they have mentioned in attended run mode. So your cloud flow run your desktop flow when you're into that machine only.

  • tar_taryn Profile Picture
    6 on at

    Hi Agnius,
    I set desktop flow to connect via Unattended mode. However it showed error unable to find a machine(i work weel if I connected to VM but error once disconnect).
    Thank you for your suggestiontest.png2023-08-28_150044.png

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Unattended flows can only run when there is no active user session on the machine. So, you must be logged out of the machine to run a flow in unattended mode. If you are logged in, it will fail. 

  • tar_taryn Profile Picture
    6 on at

    Thank you 🙂

  • JRussellmo Profile Picture
    6 on at

    That does not fit with what I see.  I have other programs (backups) that are also running on this machine.  They keep working whether or not I am using remote access.  If the user is actually signed out, then the other software keeps working.  When closing Remote Desktop, you have the option of just closing the session and the machine keeps on working.  At least for other software that is true.   The machine is also a licensed version of the add on that allows the user full access.  But none of this works, at least for me.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Most of the other software runs as service accounts and that is perfectly fine. But Power Automate uses the Remote Desktop Protocol to connect to the machine. As such, if there is an existing session for the same user, it would terminate that when connecting, so it is built not to do that (that's why it will fail if you try running an unattended flow when there already is an active user session). And if you do connect via RDP to the machine using the same user account while a flow is running, doing so will terminate the existing session created by Power Automate, and your flow will stop.

     

    That's the way it is. I know it can be different with other software that runs as a service installed directly on the machine. But it's not like that for Power Automate that needs to connect to the machine from the cloud that is external.

  • CaioAlmeida91 Profile Picture
    10 on at

    I'm also having this problem. I'm using a VM hosted on Power Automate, but in my case, after the RPA runs, it does not log off. When I access the VM, the same user is logged in twice.

     

    I have already added a step in the flow to log off, but it still did not solve the issue.

     

    Every time I need to run the flow again, it is necessary to log in manually to the machine and log off.

     

    Exemple:

    CaioAlmeida91_2-1716572300685.png

     

     

    I have already followed Microsoft's recommended guidelines, but it also did not resolve the issue.

    CaioAlmeida91_1-1716571832107.png

    https://learn.microsoft.com/en-us/troubleshoot/power-platform/power-automate/desktop-flows/troubleshoot-desktop-flow-run-queue-errors

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 266 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 134 Super User 2026 Season 2

Last 30 days Overall leaderboard