Issues with scripts that take files as input and run as gMSA
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)
Hello @tholabrk
Thank you for the detailed report and the sanitized reproduction example.
The `Could not find file 'C:\Windows\TEMP\psufile.<number>.bin'` error is useful because it appears before your script logic executes. I would like to isolate whether this is related specifically to the combination of file parameters and the gMSA execution context.
Could you please try these two control tests on PSU 2026.2.5?
1. Run the same script with the `[File]$File` parameter, but temporarily remove `-Credential 'MyGmsaAccount'`. Please let me know whether the file upload completes successfully under the default service context.
2. Run a minimal script using the same gMSA credential, but without a `[File]` parameter, and confirm that it executes successfully under the expected account.
These results should help determine whether the failure is in file handling generally or specifically when file uploads are combined with the gMSA Run As context.
Because this is a public forum, please sanitize all evidence before posting. Remove credentials, tokens, license keys, cookies, private keys, full connection strings, email addresses, usernames, customer data, tenant or account identifiers, internal domains, hostnames, IP addresses, and private URLs. Please do not upload unredacted HAR files, memory dumps, database backups, or complete configuration files to this public thread.
Best regards,
Ruben Tapia