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 / Pass variables from Po...
Power Automate
Unanswered

Pass variables from Power Automate Desktop to PowerShell Script

(0) ShareShare
ReportReport
Posted on by 7

Hi,

 

I'm playing around with Power Automate Desktop in hopes that I can use it for new user accounts.  After playing around with it for a bit, I can't seem to find a way to modify on-premise active directory user attributes (proxyaddress, mailnickname, etc).  I figured the workaround for this would probably be to create a powershell script to handle some of those attribute changes and call the powershell script from Power Automate Desktop.  Is this the right way to go about it?  Do you suggest a different way?  If I call the powershell script, is there a way to pass some variables from the Power Automate Desktop workflow?  I appreciate any suggestions or comments.

 

Much appreciated,
John

  • miketran13 Profile Picture
    720 on at

    Hi John,

     

    There is a group of actions in Power Automate Desktop called Active Directory which includes: Create group, get group, create object, create user, get user, modify user? Have you tried these yet?

    From my opinion, this is the best way for managing users in Active Directory.

     

    And Have you tried to use UI Automation for performing the actions on the Active Directory window? for examples: Open Active Directory -> Open user account -> Edit field -> Enter values, etc.

     

    If you don't see the above options that works for you, then I think Power Shell scripts or Command lines still can work for you but then you have to maintain your flows and also maintain your scripts. 

     

    This is my thoughts!

     

    Thanks and hope it can help you. 

    Mike

    ---------------------------------

    Did I answer your question? Please consider to Mark my post as a solution! to guide others

     

     

  • JKarlo Profile Picture
    7 on at

    Thanks, Mike.  I would love to be able to do this with the native functionality built into Power Automate Desktop.  I need to modify some user attributes (proxyAddress, for example) and I do not see where I can do this with the modify or create user options.  I have not tried the UI automation, but I will try that and see if it works for me.

     

    Thanks,
    John

  • Rhysy Profile Picture
    12 on at

    John did you find any solution for this? I've just tried generating users and there doesnt seem to be a way to generate a valid UPN and SAM as the UPN would require an "@domain.org" which is invalid for the pre2000. PA Desktop only has 1 username field which populates both the UPN and the SAM with the same thing, so not sure how its possible to actually generate a valid user account from this.

  • burque505 Profile Picture
    398 on at

    @JKarlo, I would be inclined to use PowerShell as you first suggested. You asked how to pass variables to a script - here is a dead-simple flow that takes advantage of practically zero of PS's capabilities, but does show how to pass variables to the script.

     

    For your specific use case, see e.g. this page on setting AD users. 

     

    flow.PNG

    passvar.PNG

     

    For variables and using '%', see the variable manipulation page. 

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 259 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 134 Super User 2026 Season 2

Last 30 days Overall leaderboard