Cannot create session to execute desktop flow run user needs to have Remote Desktop permissions

Power Automate Desktop error: User session on target machine

Wouter August 31, 2021 Power Automate

Power Automate desktop flows are triggered from Power Automate in the cloud and can return multiple types of indications that something is not right. First of all, a little bit of vocabulary:

A cloud flow runs only in the Power Automate cloud. No installation of software is required.

A desktop flow only runs on a machine of a user [attended RPA] or on virtual machines [unattended RPA] using the Power Automate Desktop software. The newest way to connect Power Automate in the cloud to the software on a machine [virtual machine or desktop/laptop of a user] is using machines & direct connectivity.

In the case of unattended mode, it can happen that you get the error “There’s an issue starting your desktop flow. There is a user session on the target machine. Cannot execute unattended desktop flow. Check for errors and try running again”.

To avoid this type of error, make sure that you always “Sign out” of the VM, not “Lock” or “Disconnect” which are also options.

If you make it a habit to sign out after you’ve worked on your desktop flow in Power Automate Desktop, you should not get this error anymore.

Share

  • Twitter

Run attended or unattended desktop flows

After you've created and tested a Windows recorder [V1] flow, you can run it from an event, schedule, or button. To make this possible, add your Windows recorder [V1] flow to an Automated flow, a Button flow, a Scheduled flow, or a business process flow.

Prerequisites

  • You need the on-premises data gateway for your device to have the desktop flow triggered by Power Automate.

    The gateway is an enterprise-grade secure connection between Power Automate and your device [where your desktop flow runs]. Power Automate uses the gateway to access your on-premises device so that it can trigger your desktop flows from an event, schedule, or button.

  • A work or school account.

    [!IMPORTANT] You must use the same work or school account to set up the gateway and to sign into Power Automate.

Run your desktop flow from an event, button, schedule, or business process flow

In this example we will use an automated flow to trigger a desktop flow when a new email arrives.

  1. Sign in to Power Automate.

  2. Select My flows in the left navigation pane.

  3. Select New, and then select Automated-from blank.

    [!TIP] You can choose any other type of flow to suit your needs.

  4. Give your flow a name in the Flow name box.

  5. Search for "new email", and then select When a new email arrives [V3] from the list of triggers.

  6. Select Create, and then select New step.

  7. Search for desktop flows, and then select Run a desktop flow for desktop from the list of Actions.

  8. Provide the gateway information and device credentials.

    You'll have to do this once per device:

    • Gateway: Select the gateway that you created earlier or use New gateway to create a new gateway.

    • Domain and Username: Displays the work or school account from the device.

      [!Important] Make sure you can login to the device using these credentials.

    • Password: Provide your work or school account’s password.

      [!TIP] If you don't see your gateway, you might be in an environment whose region is different from the gateway region. Select Troubleshoot a missing gateway in the gateway name list to learn more. You can also confirm your gateway and Power Automate regions are mapped correctly.

      [!TIP] If you don't see your gateway, you might need to select a different connection. To do this, select ... from the top right side of the Run a UI flow for desktop or Run a desktop flow for Web card, and then select the connection from My connections.

  9. Select the desktop flow that you previously created.

  10. Select Save to save your automated flow.

    [!TIP] Before testing, confirm that your gateway is online. Go to Data > Gateways on the navigation pane, select the gateway name, click on ... go to Details and verify if the gateway status is online.If the gateway status is offline, confirm that the device is turned on and connected to the Internet.

  11. Test your flow by sending an email to trigger it. You will see your desktop flow playing back the steps you recorded.

    [!TIP] Do not interact with your device while the flow runs.

Video liên quan

Chủ Đề