Ho to run a CMD command as the local user via bigfix

Hello,

I am trying to uninstall this MS team classic via CMD "winget uninstall “Microsoft Teams classic”

I would like to create an action script that will run this command as local user account.

Here is the action script i have try with no luck

// Example Action Script to uninstall “Microsoft Teams classic” as the current user

// Specify the command to uninstall Microsoft Teams classic
parameter “UninstallCommand”=“winget uninstall -n Microsoft.Teams”

// Run the uninstall command as the current user
runas=currentuser hidden=“{parameter “UninstallCommand”}”

any well with this will be greatly appreciated.

Try this:

override wait
runas=currentuser
wait {pathname of system folder & "\cmd.exe"} /C winget uninstall -n Microsoft.Teams
1 Like

Hello,

it is giving me the following error

Try it running using BigFix console action not fixlet debugger but for testing purpose, did you validate it directly if its working for you.

wait {pathname of system folder & "\cmd.exe"} /C winget uninstall -n Microsoft.Teams

i have modified the script a little bit

wait {pathname of system folder & “\cmd.exe”} /C winget uninstall “Microsoft Teams classic”

from fixlet debugger it is uninstalling MS team but not for the current user.

tomorrow i will try to run it using the BigFix console, and i will see how it behave.

Hello

override wait
RunAs=currentuser
wait {pathname of system folder & “\cmd.exe”} /C echo %username% > C:\Temp\Bigfix\output21.txt
wait {pathname of system folder & “\cmd.exe”} /C “C:\users%USERNAME%\appdata\Local\Microsoft\Teams\Update.exe” --uninstall

image
I have try those command on the bigfix console but it does not uninstalled MS team.
i was able to view this output21.txt into the temp folder with the right username but i do not understand why the other line {wait {pathname of system folder & “\cmd.exe”} /C “C:\users%USERNAME%\appdata\Local\Microsoft\Teams\Update.exe” --uninstall} does not uninstall team.

when i run this C:\users%USERNAME%\appdata\Local\Microsoft\Teams\Update.exe on a regular CMD i am able to uninstall team.

Any idea of what could be the issue?

Thats incorrect relevance statement, BigFix cant read %USERNAME%, instead try this:

override wait
RunAs=currentuser
wait {pathname of system folder & “\cmd.exe”} /C "C:\users\" & name of logged on user & "\appdata\Local\Microsoft\Teams\Update.exe" --uninstall

that one did not work. here is what i am getting

that action script failed
image

any other suggestions ?

The command has the wrong quotes in it, it has the “smart quotes” that come from copy/paste on an HTML formatted page like the Forum, replace them by deleting & re-typing the doublequotes.