top of page

How to Run Power Automate Desktop Unattended on a Hosted Machine

Updated: Mar 26, 2024

My assumption is that this will be resolved in the future, but for the time being, when using a Hosted Machine for Power Automate Desktop, you must create a local account if you want to run flows unattended. However, hosted machines don't (currently) allow you to log into a local account, as they are linked with your Office365 account.

Assuming you have already created a hosted machine, step one is to create the local account you'd like to use when running desktop flows. To do this, connect to your hosted machine in your browser.

ree

Then, in the taskbar search box, type 'Other users' and select the System settings link.

ree

Next, click Add account


ree

When prompted for an email to sign in, click I don't have this person's sign-in information.


ree

Then select Add a user without a Microsoft account.


ree

Then you can fill out the new local account information. Make sure to store this username and password in a secure password vault, as you'll need it in Power Automate.


ree

You now have a local account, but we're still not done yet! Let's also make a note of the machine's name. Click on the System navigation button on the left pane.


ree

The system name I will use for this example is SMPL-eric-ABC123. This means that the domain-qualified username of my local account (which I named flowbot) is SMPL-eric-ABC123\flowbot. This is the username you will use to pass credentials into your Power Automate Desktop connection when you create it in Power Automate.

ree

Next, add the new local user account to the Remote Desktop Users group to permit it to remote into the machine unattended.

Click Start and search for Computer Management

ree

Then add the local user account to the Remote Desktop Users group.

ree

Click Add... then enter the local user account name, click Check Names then click OK.

ree


Almost there! Now comes the tricky part. We now have to create a Power Automate Desktop flow that will navigate the local user account through the EULA and setup prompts the first time it logs in. To do this, we will open the preinstalled Power Automate Desktop executable on the Hosted Machine desktop.


ree

Create a new flow.


ree

Give it a name.


ree

And now we will simulate keystrokes to navigate the initial login setup. Under Mouse and keyboard select Send keys.


ree

Then send {Tab}{Tab}{Tab}{Tab}{Return}.


ree
ree

If you're confused about what we're doing, we are essentially skipping through user setup and EULA screens that will appear for your local user the first time they log in (like the one below). It's hard to visualize this as we cannot see the process, but if it helps you can add screenshot steps during the flow and save them to the Public Images folder.

ree

Next, under Flow control, we will add a 3-second Wait.


ree

ree

Lastly, we will add a single Return keystroke, similar to the first flow step. You should be left with a flow like this:


ree

Now, Save the desktop flow and navigate to Power Automate. Make sure you are in the same environment in which you created the Hosted Machine. Create a manually-triggered cloud flow.


ree

Select an action to Run a flow built with Power Automate for desktop.


ree

Select Connect with a username and password.


ree

Select your Hosted Machine.


ree

Then enter your local account's domain-qualified username and the password.


ree

If you run into issues here, double-check your username and password, make sure you used the correct slash ( \ ) in the username, and double-check the system name of the Hosted Machine.


Next, select the flow we just created.


ree

And select Unattended.


ree

Name, save, and run this cloud flow. After the cloud flow runs successfully you should have a fully-operational local account to run unattended desktop flows!


If you run into issues not covered in this post, comment below for help!


Contact

Thanks for reaching out!

PowerUp!

My goal is to educate people in the advanced topics of the Power Platform in a way that helps users go from citizen developer to solution architect.

Connect

  • LinkedIn

© 2021 PowerUp - Power Platform Tutorials. All Rights Reserved

bottom of page