Executing script with admin rights

Product: PowerShell Universal
Version: 1.4.6

Hi, to be honest i am compleetly amateur realted to Universal Dashboard. I just find it on Internet and think that it is good piece of software so i use it free version to test.

I installed it on my local computer and create normal static website with static data and it works.
But now i want to do something better.
Now i create website where I have grid, and every element of grid is a stylized card. In thet card i have list of items, so this is a snipped of code of that list:

$body = New-UDCardBody -Content {
                    New-UDList -Children {
                        New-UDListItem -Label 'sdfsfdfds' -Icon (New-UDIcon -Icon user -Size 1x) -SubTitle $(quser /server:Computer
                        New-UDListItem -Label 'IP' -Icon (New-UDIcon -Icon laptop -Size 1x) -SubTitle $(Invoke-Command Computer {ipconfig}
                    }
                }

The problem is when i execute it, asking about that data on my local computer that works, but if i ask remote computer about data(which require admin rights) then i have access denied. I have almost 200 remote computer, on every computer i have admin rights, and everytime i have access denied.
Thet code executed on terminal Windows 11 works fine but in dashboard i have an error: “Access denied”. So to the question:

How to configure such an issue to make it works right ? I ask also about configuring it on admin panel and configure in code. (But if it can be configured only in code i prefer this way).
Or maybe it is neccesary to configure in windows , if yes please provide step by step images how to do this.

works for me:

OK.Can you show me solution for that thing.
I checked event logs and no results. Check firewall and no results.

Commands executed inside PSU is executed as the service account the service is running under (Default is System).
does the computer/Service account have remote rights on the remote computers?

1 Like

If you have installed PSU as service, it most likely runs as local system, and therefore the commands do not have access to any remote system.

You can try to stop the service and run PSU manually as the intended user.
If that works, you know your issue.

One possible mitigation is storing needed credentials in files using Export-CliXml. Those files are encrypted and can only be read by the user/machine combination who created them.

I wrote a PSU app to “manage” those credential files.
My apps and scripts read them, and then use the -credential parameter to execute remote commands. (e.g. running some pssession on remote systems)