Force close new Teams work or School App

chriso16
New Contributor II

Hello.

I'm trying to ensure teams is closed prior to updating app and getting errors when trying to force close it.

 

killall "Microsoft Teams (work or school).app"

 

Works fine with Classic teams i'm sure it's something about work or school part getting lost in code just don't know how to fix it.

 

Thank you for your time.

1 ACCEPTED SOLUTION

chriso16
New Contributor II

Sorry I replied to wrong post 

 

Thanks for pointing me in the right direction here is final script that worked

Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'

Remove the Teams work or School app
rm -rf //Applications/Microsoft\ Teams\ \(work\ or\ school\).app

View solution in original post

5 REPLIES 5

jamf-42
Valued Contributor II

try AppleScript.. better than a kill:  (you may need to change the name here, don't have teams) 

 

 #!/bin/sh

 osascript <<EOF
 try
 tell application "Microsoft Teams"
 quit
 end tell
 end try
 EOF

 

chriso16
New Contributor II

Sorry I replied to wrong post 

 

Thanks for pointing me in the right direction here is final script that worked

Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'

Remove the Teams work or School app
rm -rf //Applications/Microsoft\ Teams\ \(work\ or\ school\).app

AJPinto
Honored Contributor III

If you are using Microsoft's Teams package, the preinstall script in the package will quit teams for you without you needing to do anything else.

chriso16
New Contributor II

Thanks for replying. I do run the pkg but I've noticed since switch to the new teams version app crashes after install but if I fully remove the app then install seems to work better. I was able to script to remove the app just haven't figured out script to force close it as well.

chriso16
New Contributor II

Thanks for pointing me in the right direction here is final script that worked

Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'

Remove the Teams work or School app
rm -rf //Applications/Microsoft\ Teams\ \(work\ or\ school\).app