DavidH38 it looks like you've tried running the script in all-in-one configuration mode on Windows Server Core. Can you confirm that? If so, running the script in this mode on Server Core doesn't work. Instead, you need to run in in split-execution mode (https://learn.microsoft.com/en-us/Exchange/hybrid-deployment/deploy-dedicated-hybrid-app#split-execution-configuration-mode).
The steps are as follows (the documentation explains them with more context and examples):
- Export the public key of the auth certificate
- Run the script on a Windows Client or Server with GUI to create the application and upload the certificate
- Run the script on Windows Server Core to enable the feature