Office 365 Connector and Terminal Server

I have a running environment with UCS 5, O365 Connector, Azure and a bunch of Office licenses. On the deskop the activation of Office works but as soon as a client logs into the terminal server it fails. He has to activate Office on the terminal server with the same username as on the desktop, but it fails with some script errors.
Bildschirmfoto 2022-09-21 um 14.37.50
Bildschirmfoto 2022-09-21 um 14.37.58
Bildschirmfoto 2022-09-21 um 14.37.41
What’s wrong here? Do I have to change some settings on the terminal server itself? Any help or hint will be appreciated. Thanks