Thanks for posting your question in the Microsoft Q&A forum.
You can manage MS teams using PowerShell as described in this article:
https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-managing-teams
Also, this guide can be a good step to start:
https://www.spguides.com/connect-to-microsoft-teams-powershell/
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **