Firewall rule

Hello, i have a HP ( z640) with windows server 2022 and is connected with ethernet from my mikrotik.I want to config the mikrotik so i can block with firewall rule everything on server but to have remote access Teamviewer.
How can i do it i try with some layer 7 protocol but still i cant do it, is it possible to do it please help me(let me now if i can do it)
Thank you for reading this!

You don’t need anything at all since Teamviewer can already provide this function.
Just set it up so it starts automatically and define ID/passwd which you can use to get in.
Done.

To clarify, TW don’t need incoming ports open to initialize connection, only outgoing
https://www.teamviewer.com/en/global/support/knowledge-base/teamviewer-classic/troubleshooting/ports-used-by-teamviewer/