'Stop screen sharing from Microsoft Teams (or any video sharing service) using the terminal or code?

I'm on the quest to build a tool for a college project to automatically send triggers reminding me that I'm screen sharing at intervals of 10 minutes. Finally, at 60 minutes of screen sharing time, I'd like the program/bot to stop screen sharing from Microsoft teams on its own volition.

While this problem statement is currently way above my capabilities. I was trying to figure out the subproblem of how to disable ms teams screen sharing from terminal or through code? Is that possible by any means?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source