This Script is used to Uninstall Microsoft Teams Silently at Endpoint.
Note : Run as Logged in User.
import os
import subprocess
from subprocess import PIPE, Popen
user=os.environ['USERNAME']
obj = subprocess.Popen('"C:\Users\%s\AppData\Local\Microsoft\Teams\Update.exe" --uninstall -s' % (user), shell = True, stdout = PIPE, stderr = PIPE)
out, err = obj.communicate()
if not err:
print "Microsoft Teams has been successfully uninstalled"
elif err:
print "Error removing Microsoft Teams"
Comments