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 / Machine Password manag...
Power Automate
Unanswered

Machine Password management

(0) ShareShare
ReportReport
Posted on by 46

Hi Team,

 

I have a situation where machine password is getting changed every 30 days, Power Automate desktop unattended flows are going to run in that machine, how we can manage this password service without entering into the VM so that process will run seamlessly.

 

For now, there ate 2-3 process so that can be managed manually but in future this number will increase up to 500. Then it will be difficult to manage.

 

Requesting all to guide me on this.

 

Regards,

@KaranSomnathe 

  • HaoZhong Profile Picture
    9 on at

    That's a good question. Bumping it up for admin to reply please 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can paste the following PowerShell script into a Run PowerShell script action to change the password of the user on the machine:

     

    import-module activedirectory
    Set-ADAccountPassword -Identity {Username} -OldPassword (ConvertTo-SecureString -AsPlainText "{OldPassword}" -Force) -NewPassword (ConvertTo-SecureString -AsPlainText "{NewPassword}" -Force)

     

    You'll need to provide the following parameters (replace the placeholders in the script with actual values): {Username), {OldPassword} and {NewPassword}.

    You can generate a password via the Create random text action.

     

    You would then need to pass this new password to some password vault or something like that, so you actually have it.

     

    What you will still need to do manually is update the connection in the cloud flow, as it will stop working after the password on the VM has changed. See this article on how to fix a connection when the credential stops working: https://learn.microsoft.com/en-us/power-automate/add-manage-connections

     

    I would highly recommend using service accounts for unattended flows with appropriate password policies (such that do not expire). Password expiration is anyhow a bad idea, as it generally forces the user to store the password somewhere so they don't forget it. Not to mention using it for automation solutions.

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 249 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 202

#3
David_MA Profile Picture

David_MA 180 Super User 2026 Season 2

Last 30 days Overall leaderboard