Powershell+API for connections report and sharing

Can somebody help me with powershell script and Teamviewer API?

We have a powershell script to terminate AD user account and I need to integrate the teamviewer part. The goal is:

-check if a specified user exists in the Teamviewer management console and, if it's enabled, export his full connections report

- then "unshare" all the groups for that users

- then disable the user

Thank you for your support