This is my third post on this topic and no answer to this day.
I have built a flow out at least 7 different ways and it will not work.
I am a domain user on a domain PC.
I have local administrator rights.
Powershell ISE is set to open as an admin.
UAC is disabled.
Power Automate Desktop app is set to open as admin.
All I need is to have the ability to run a script that will add a domain user to a remote computer's local admin group.
I have 4 lines of PowerShell that get that done but there is no way to do it as Flow runs Powershell as a mortal user.
I have tried the following workarounds:
1. Launch Powershell ISE and copy paste the code using the Flow Desktop App. Fails since now ISE is running as admin.
2. Luanch a cmd session that calls on my PS1 script as admin. Can't do it.
3. Launch a bat file that calls my PS1 script as admin. Can't interact with the UI now because again, it's running as an admin.
4. Manually map the mouse to launch the PS1 script shortcut as admin. Same thing.
I need 4 lines of code executed. I can execute the code perfectly fine but Flow won't do it for me?
PS: I have to run this code a couple hundred times and the rest of my Flow itself automates the receiving the requests, parsing out asset tags and usernames and storing all that into variables so even though it simple I've literally automated it all.