Get-PSUScript: Status(StatusCode="Unimplemented", Detail="Bad gRPC response. HTTP status code: 404")

Product: PowerShell Universal
Version: 5.0.7

Error encountered when I run the following:
Get-PSUScript -ComputerName “https://fqdn:4443” -AppToken $AppToken -TrustCertificate
Get-PSUScript: Status(StatusCode=“Unimplemented”, Detail=“Bad gRPC response. HTTP status code: 404”)

This command works:
Connect-PSUServer -ComputerName “https://fqdn:4443” -AppToken $AppToken

I have tried this from both PowerShell on another computer and from within an app running on the PSU server.
The certificate is valid and signed by an external authority.

Any ideas welcome.

App settings:

"Kestrel": {
    "Endpoints": {
      "HTTPS": {
        "Url": "https://*:4443",
        "Certificate": {
          "Subject": "fqdn",
          "Store": "My",
          "Location": "LocalMachine",
          "AllowInvalid": true
        }
      }
    },
    "RedirectToHttps": "true",
    "UseHttpSys": "false",
    "BasePath": "",
    "Hsts": {
      "MaxAgeDays": 365
    },
    "CookiePolicy": ""
  },

Also for API section in AppSettings:

"Api": {
    "OpenAPI": {
      "Name": "Endpoints",
      "Description": "Endpoints defined within the PowerShell Universal admin console.",
      "Url": "v2",
      "Version": "v2"
    },
    "Url": "https://fqdn:4443",
    "GrpcPort": 0,
    "TrustCertificate": true
  },

As I said earlier, I have tried running this interactively from Powershell and from an app. The app is running under a new environment. So not running under the integrated environment.

This is a new installation of PowerShell Universal. running version 5.7.

I have looked at the following forum posts but they haven’t provided a solution:

Can you try, for testing purposes, enabling the permissive security model [1] and bypassing the Connect-PSUServer command?

No difference unfortunately.

Error from logs doesn’t show much more:

Ignore the -integrated flag message. Not relevant.

[16:24:38 WRN][App][DTS Operations] Integrated is no longer used.
[16:24:39 ERR][App][DTS Operations] Cannot retrieve the dynamic parameters for the cmdlet. Status(StatusCode=“Unimplemented”, Detail=“Bad gRPC response. HTTP status code: 404”)
[16:24:39 ERR][App][DTS Operations] An error occurred: Cannot retrieve the dynamic parameters for the cmdlet. Status(StatusCode=“Unimplemented”, Detail=“Bad gRPC response. HTTP status code: 404”)
Endpoint: fd065fff-a3dc-46e0-b9f7-e462a0641522
Session: ac9a2b8a-e90b-429f-95e7-a1bf1d5cb5fc, User: admdoh@dcu.ie

at fd065fff-a3dc-46e0-b9f7-e462a0641522: line 10
at fd065fff-a3dc-46e0-b9f7-e462a0641522: line 1
at User account.ps1 : line 42

at fd065fff-a3dc-46e0-b9f7-e462a0641522: line 10
at fd065fff-a3dc-46e0-b9f7-e462a0641522: line 1
at User account.ps1 : line 42

I’ve had the same issue - what is your infrastructure/installation method? MSI/Module/IIS (nested?)/etc? You can check through this thread and see if any of the steps I took that are mentioned are helpful:

I installed via MSI.
I’m not hosting through IIS.
Running on Windows 2022.
No proxy.

Still looking for a solution to this.
Get-psuscript -computer “https://fqdn” -AppToken $AppToken also does not work. Provides the same error.

No longs under c:\programdata\PowerShellUniversal that indicate what the error relates to.

I for the life of me cannot remember how I fixed this, I’m sorry. I believe the permissive security model and TrustCertificate fixed it for my particular case, but I may be wrong. Things move too fast!

When you were trying with Connect-PSUServer, did you process in the same structure as the following?

Connect-PSUServer -ComputerName $SiteRoot -AppToken $AppToken
$PSUScripts = Get-PSUScript

I believe this should return all PSU scripts in your environment. If you are still getting the gRPC when running these exact commands, I may not be able to help unfortunately.

Oh - I just noticed. In your Kestrel config, can you try adding a protocol here:
Kestrel.Endpoints.HTTPS.Protocol = "Http1andHttp2"
Then, restart Universal.Server and give it another try.

This may not have any effect but it may be worth a shot.

Having the same issue…Http1andHttp2 didn’t help.