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 / PA Desktop Flow Powers...
Power Automate
Unanswered

PA Desktop Flow Powershell script works on 1 PC but no where else

(0) ShareShare
ReportReport
Posted on by

I have a cloud flow that calls a PA Desktop flow that executes a PowerShell script which extracts records from AD, writes them to a csv file, clears an SQL database table, and then writes the csv to the db.  When I run this on my work laptop, it runs successfully in about 40-45 minutes.  However, if I run it on my development PC or on our production PA server, it always times out.  For both of the latter 2 servers, it seems to write out the csv file within minutes but then never touches the database (keep querying the db/never clears-stays at full record count).  Since there are no error messages other than the time-out, I am "assuming" that it is failing on one of the SQL commands. The first SQL command clears the table - I've tried both DELETE and TRUNCATE options.  Again, both work fine on the laptop - same time-out results on the other 2 platforms.  I have compared SQL components on laptop vs PC and they are the same except for a 2008 SQL management objects and 2019 local db install on the PC.  I've tried to have it time-out and go to the next step, but it wasn't successful.  Any ideas on what is wrong or even how to produce an error message to point me in the right direction?  Appreciate any feedback!

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

    Have you tried running the same PowerShell script via the PowerShell app on Windows on the two target machines to see if it runs? Also, can you try simply running the SQL commands separately from those machines to verify that the machine has access to the related server and the user has the required permissions to run those commands?

     

    Would it be possible to split the script into separate smaller scripts? Technically, most of what you do can be done with native PAD actions instead of using PowerShell. You could do that and only use PowerShell for things that PAD cannot do with native actions. This would simplify your script and make it easier to figure out what's up with it. 

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 780

#2
Valantis Profile Picture

Valantis 668

#3
Haque Profile Picture

Haque 601

Last 30 days Overall leaderboard