Users

All Posts (44)

avatar

tholabrk

Dashboard calling Grant-PSUAppToken failing

avatar
avatar
avatar

Just an update, not so much on the bug itself, just wanted to add that I ended up moving some dashboards over to -AutoGrantToken (and $PSUAppToken) so that it worked for non-admins as well.

Dashboard calling Grant-PSUAppToken failing

avatar
avatar
avatar

Sorry, you're right, I doublechecked my logs and I was running 2026.3.2 (Though I could've sworn that I had updated to 2026.3.4 during our Service window last week)


Your suggested workaround did the trick, so I'll use that until the fix. Thanks for the quick help :)

User language settings, a way to persist?

avatar
avatar
avatar
avatar

The language thing seems to be working fine, so thanks for that :)


I got a different issue, which I've opened a support ticket for.

Dashboard calling Grant-PSUAppToken failing

avatar
avatar
avatar

So I just updated to 2026.3.5, and some of our dashboards are failing, with this toast-message:

image.png


Looking into the logs, it pinpoints the issue at a line of code where I use Grant-PSUAppToken for further API-calls. I note that the release notes have the following improvement listed, maybe this is related to my issue?

Improved app token revocation across servers, protection of token values, and permissions for creating tokens


Can you advise me if this is a bug, or if I need to use Grant-PSUAppToken in a different manner, I will also note that SecurityModel is "Permissive" as has been the case for quite a while, as authenticating with gRPC was very difficult/buggy at the time it was introduced (as far as I recall)


Below are all my findings, plus a quick repro-dashboard that fails on my system.


The following error is logged in <PSU Root>\User\Logs:

[10:00:49 ERR][App][TestDash] Status(StatusCode="Unknown", Detail="Exception was thrown by handler. InvalidOperationException: HttpContext is not available.", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1794906049.462000000","description":"Error received from peer ipv4:127.0.0.1:49749","file":"..\..\..\src\core\lib\surface\call.cc","file_line":953,"grpc_message":"Exception was thrown by handler. InvalidOperationException: HttpContext is not available.","grpc_status":2}")
[File]: TestPage.ps1
[Endpoint]: 71af327e-d83e-4b23-bcf4-4c1092df1cd5
[Page]: 
    [1] 
~~> [2]     $Token = (Grant-PSUAppToken).Token
    [3]     'Hello, token {0}' -f $Token
    [4] 

AppSettings.json:

{
  "Api": {
    "SecurityModel": "Permissive",
    "TrustCertificate": true,
    "Url": "https://<removed for privacy>:443"
  },
  "Kestrel": {
    "Endpoints": {
      "HTTPS": {
        "Url": "https://*:443",
        "Certificate": {
          "Subject": "<removed for privacy>",
          "Store": "My",
          "Location": "LocalMachine",
          "AllowInvalid": "true"
        }
      }
    }
  },
  "Plugins": ["SQL"],
  "Data": {
    "RepositoryPath": "<repo path>\\Repository",
    "ConnectionString": "Server=<removed for privacy>;Database=<removed for privacy>;Integrated Security=true;Encrypt=True;TrustServerCertificate=True"
  },
  "Mode": "Server",
  "PSUTelemetry": false
}


Repro dashboard:

.universal\dashboards.ps1:

New-PSUApp -Name 'TestDash' -FilePath 'dashboards\TestDash\TestDash.ps1' -BaseUrl '/TestDash' -Authenticated -AutoDeploy 

dashboards\TestDash\TestDash.ps1:

New-UDApp

dashboards\TestDash\pages\TestPage.ps1:

New-UDPage -Url '/TestPage' -Name 'TestPage' -Content {
    $Token = (Grant-PSUAppToken).Token
    'Hello, token {0}' -f $Token
} -AutoInclude


Environment:

Powershell Universal: 2026.3.5
Windows Server 2022

User language settings, a way to persist?

avatar
avatar
avatar
avatar

Quick update, also happens on 2026.3.2, had to update so I could create scripts again :)

User language settings, a way to persist?

avatar
avatar
avatar
avatar

Hi @rubentapia


It only reverts when I close and reopen the browser fully or if I clear the cookies.


It sticks on page refreshes, closing the tab, but not the browser, and returning later, and even signout. (It doesn't "remove" the cookie that sets the language on signout)


PSU version is currently 2026.3.1.

User language settings, a way to persist?

avatar
avatar
avatar
avatar

Hi,


I think it's great that PSU supports localization, especially for some of our users, but it becomes very disorienting for me as an administrator.


When I change it from my language back to English, it is automatically set back to Danish the next time i open PSU. From reading some documentation i can understand it's using the browser locale, but this is currently being enforced by my organization, is there any other way to change it as a user, without affecting localization in PSU as a whole?

gMSA broken in 2026.3?

avatar
avatar
avatar
avatar
avatar

Can confirm this gas been fixed in 2026.3.1 :)

gMSA broken in 2026.3?

avatar
avatar
avatar
avatar
avatar

So I upgraded to 2026.3 yesterday, and I'm having issues with gMSA credentials.


I have jobs that fail with the following error message:

Error executing job: Failed to login user (1326). System.ComponentModel.Win32Exception (1326): The user name or password is incorrect.

It uses the non-builtin Powershell 7 Environment


I have a dedicated API environment which runs as a gMSA using it now results in 404 Client Error (No log text in the log-tab, and no other discernable information I can find)


I've double checked the service account using Test-ADServiceAccount which returns true for the gMSA, the service runs as LocalSystem. I tried creating a new variable (with the same gMSA) and this also fails.


I do have an odd error in PowerShellHost logs which I do not think happened prior to the upgrade:

2026-09-15 23:37:28.829 +02:00 [ERR] Error checking module path 
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at UniversalHost.AgentService.Initialize(IHostLogger logger) in D:\a\powershell-universal\powershell-universal\src\Host\AgentService.cs:line 48


Environment:

Windows Server 2022 (The CU for this month has not been installed)
PSU Version 2026.3

Issues with scripts that take files as input and run as gMSA

avatar
avatar
avatar

Great, let me know if/when there's something I can do.


For now, I did manually work around this issue by having my script call an API that runs in an environment that runs as the gMSA account, a bit round-about but it works :D

Uploading files to scripts from Portal hangs at waiting for feedback

avatar
avatar
avatar

Excellent, and yeah I will be creating that workaround in the meantime, thanks again :)

Uploading files to scripts from Portal hangs at waiting for feedback

avatar
avatar
avatar

Actually, scratch that, it was staring right at me, I failed to notice that I had used Mandatory parameters which I hadn't added to my test repro script.


The actual code that triggers the issue is:

Param(
    [Parameter(Mandatory=$True)]
    [ComponentModel.DisplayName("Upload File")]
    [File]$File
)
'Filename is {0}' -f $File.Filename

Set-Content -Path ($Env:Temp + "\test.xslx") -AsByteStream -Value $File.Content


This happens regardless of environment (Powershell 7 vs Integrated(can't run gMSA)) and whether or not it runs as gMSA or not, whether the execution role is present or not.


This is my final "definition" in scripts.ps1 after testing (sanitized):

New-PSUScript -Name 'Test.ps1' -Description 'Test' -Path 'Subfolder1\Subfolder2\Test.ps1' -Environment 'PowerShell 7' -Role @('MyRole') -PortalOutputType 'Text' -Icon 'alert' -DisplayOutputOnExecute 

Uploading files to scripts from Portal hangs at waiting for feedback

avatar
avatar
avatar

My apologies I did not do my due dilligence here, the issue does not present itself in these simple repro-scripts, and I will have to investigate further what part of my script is causing this issue to present itself.

Uploading files to scripts from Portal hangs at waiting for feedback

avatar
avatar
avatar

Hi @rubentapia, I'll get back to you on this one, as I didn't have time to look into this today, so I hopefully will have an update tomorrow.

Issues with scripts that take files as input and run as gMSA

avatar
avatar
avatar

Hi @rubentapia,


Just to basically confirm, it is the gMSA-credential causing havoc, just to be complete, I have modified the original test example to:

'Filename is {0}' -f "test"

Set-Content -Path ($Env:Temp + "\test.xslx")  -Value "test"

(I changed the script to not save directly to C: as that causes a failure (permissions) but is largely irrelevant, so I use temp)

This script runs with or without gMSA credential


The old script, slightly modified to save in %temp% instead fails with gMSA, but runs fine without gMSA, that script now looks like this:

Param(
    [ComponentModel.DisplayName("Upload File")]
    [File]$File
)
'Filename is {0}' -f $File.Filename
Set-Content -Path ($Env:Temp + "\test.xslx") -AsByteStream -Value $File.Content

Uploading files to scripts from Portal hangs at waiting for feedback

avatar
avatar
avatar

Related to the issue in Issues with scripts that take files as input and run as gMSA - Devolutions Forum I have a role required to run the script, if my coworker who only has "MyRole", they can start the script and upload it, but in the admin console the job sits at "Awaiting user feedback". Opening the job reveals that it is expecting File (as a string).


Considering it works for me as an Administrator, but not for the user who only has MyRole, I assume it's some kind of permissions related issue, but I don't think it should be? Correct me if I'm wrong.


Details are the same as before, my running environment is:

OS: Windows Server 2022
PowerShell Universal: Version 2026.2.5
PSU runs as a Windows Service as LocalSystem


Script is:

#.universal\scripts.ps1 (Sanitized):

New-PSUScript -Name 'Test.ps1' -Description 'Test' -Path 'Test.ps1' -Environment 'PowerShell 7' -Credential 'MyGmsaAccount' -Role @('MyRole') -PortalOutputType 'Text' -Icon 'alert' -DisplayOutputOnExecute -ExecutionRole @('MyRole') 

# Script contents
Param(
    [ComponentModel.DisplayName("Upload File")]
    [File]$File
)
'Filename is {0}' -f $File.FileName

Set-Content -Path 'C:\test.xlsx' -AsByteStream -Value $File.Content


The role they're using is this specific one:

New-PSURole -Name "MyRole" -ClaimType "http://schemas.microsoft.com/ws/2008/06/identity/claims/groups" -ClaimValue "MyRole" 

Issues with scripts that take files as input and run as gMSA

avatar
avatar
avatar

This may be another one of those instances where it's just unsupported when running gMSA's but I'll note it here just in case it is a bug :)


My running environment is:

OS: Windows Server 2022
PowerShell Universal: Version 2026.2.5
PSU runs as a Windows Service as LocalSystem


Repro script:

#.universal\scripts.ps1 (Sanitized):

New-PSUScript -Name 'Test.ps1' -Description 'Test' -Path 'Test.ps1' -Environment 'PowerShell 7' -Credential 'MyGmsaAccount' -Role @('MyRole') -PortalOutputType 'Text' -Icon 'alert' -DisplayOutputOnExecute -ExecutionRole @('MyRole') 

# Script contents
Param(
    [ComponentModel.DisplayName("Upload File")]
    [File]$File
)
'Filename is {0}' -f $File.FileName

Set-Content -Path 'C:\test.xlsx' -AsByteStream -Value $File.Content


When choosing to run the script by uploading a file, the following error is logged in the console (before any of my script logic is executed):


Could not find file 'C:\Windows\TEMP\psufile.128.bin'.

(Number is variable through executions)

PSU Setup for IT and Employee Facing Apps

avatar
avatar
avatar
avatar
avatar

In addition to what's been said you can also integrate PSU with claims-based OIDC, SAML or WS-Federation providers. I prefer this to Active Directory-groups as it abstracts the security-model away from Active Directory to more modern systems with better control and logging (in my opinion).


Personally I run our PSU instance with OIDC, and you don't need to specifically use Entra ID, you could also use Keycloak or other providers, we use a custom one ourself. You could also use ADFS, and it does support OIDC, but you're probably gonna have an easier time going with the WS-Federation setup in terms of ease. The underlying technology is different, but the idea of claims-based access is not.


Once that is all said and done, You would create your roles, personally I like to prefix them to separate them from built-in PSU-roles and denote what they're for, so as per your example I might go with a role like DistributionGroup.Write to denote write-access to distribution groups and restrict access based on this. To grant access to these types of resources I'm currently looking into using the Portal-feature for this purpose, and it seems to integrate very well with roles.

OIDC Secret in authentication.ps1 - Best Practice

avatar
avatar
avatar
avatar
avatar

Do you mean in the GUI? Because I’ve been hiding the OIDC shared secret in a PSU secret for a while now by just using it in the .ps1-file instead

Are Triggers supposed to show up in jobs when ran?

avatar
avatar
avatar

Hi, triggers should show up in jobs, could you post a screenshot of the trigger configuration?

Upgrade form 4.4 to 5.6.1 questions

avatar
avatar
avatar
avatar
avatar

Of course not, I was just reading off Wikipedia


(Or I guess watching a TikTok about it )

Upgrade form 4.4 to 5.6.1 questions

avatar
avatar
avatar
avatar
avatar

Yep, that was actually why I didn’t upgrade past 4.x back then, and I didn’t have the time to address it then, but in hindsight I guess it was a bit silly since at the end of the day, not running 5.x because you have to “lower security” is kind of the equivalent of not upgrading to Windows 7 because Windows XP doesn’t have UAC Slider


But figured it was at least a good opportunity to answer OP’s question so he knew what to expect

Upgrade form 4.4 to 5.6.1 questions

avatar
avatar
avatar
avatar
avatar

I just did the update from 4.4.1 to 5.6.1, the environment PSU runs on is:


Windows Server 2022
MS SQL Server 2019
WS-Fed authentication (Configured in AppSettings.json)
Git Sync


I haven’t run into any issues you wanted specifically answered, but I did have the following issues:


  • Installer detected a major upgrade (Caused by at least one duplicate Installer entry, had both PSU 4.2.8 and PSU 2.8.2 registered)Fixed by removing those entries, unfortunately I had already performed an uninstall on 4.4.1, but it basically found my old uninstall (Excluding the Service Account)

  • PSU wouldn’t start, SQL foreign key constraint in the JobPipelineOutput-table, this was caused by old jobs that had an identity Id, but no JobId.Fixed by deleteing the jobs with a null-valued JobId on the database

  • WS-Fed/Saml Authentication didn’t work properly, I did get past authentication but had the wrong permissions (Might’ve been a license issue, as ours had lapsed as well)Could’ve been due to license, in the end I removed it from appsettings.json and set it up using the UI, and it worked again (a license upgrade and restart later)

  • Git sync not working.Investigating, but seems to be the same issue as in this thread.

  • Scripts with gRPC errorsStill investigating, but it’s why I didn’t upgrade to 5.x in the first place, as it changed some things around which caused basically all internal PSU commands to fail, which I use in many of my scripts.

But as to your point the apps/dashboards work fine, nothing seems to have been lost, and the few issues I have above is mostly due to it being a system with a history of helper scripts and other quirks from not having had the features when I developed it

Automatically granting app tokens for API

avatar
avatar
avatar

Sadly, it’s been a while so I have no idea, sorry.


From looking at our git history I see no relevant changes, so my only guess is that an update fixed it. Maybe 4.0.10?


Fixed an issue where app tokens set to never expire would not authenticate properly (#2598)

Upgrading to 5.0.12/13 on MSSQL fails

avatar
avatar
avatar

That did the trick, looks like there was 99 of those jobs and they were all back from early 2023

1 - 25 of 44 items