When trying to remote connect via TeamViewer, you get this error:
The screen cannoot be captured at the moment. This is probably due to fast user switching or a disconnected/minimized Remote Desktop session.
This is because the TeamViewer service cannot gain control of the desktop because Windows is not displaying the screen to the console session (as it’s being outputted to the RDP or fast user switching session) or TeamViewer isn’t running as a service and therefore cannot connect to the afore mentioned sessions anyway. To fix this, ensure that TeamViewer is installed as a service, then go to Windows Services, check the properties of the TeamViewer service (right click -> Properties) and check the tickbox to Allow service to interact with desktop on the Log On tab.
❗ Note: There’s also talk on the internet that you’ll also get the Screen cannot be captured at the moment error if you install TeamViewer over an RDP session. I’ve not verified that myself.