Remove accounts from device using script (idealy)

Solved
TM

Hello,

I have a multiuser devices where for example:
Morning shift at a factory pickup a device and logs-into MS apps.
Later on he hands over device to afternoon shift, but forgot to log-off his MS account.
MS apps can not get missused thanks to Intune's MAM policy that required PIN code while opening the apps.

BUT!

I need to log-out the other user, so I created a script in lockdown that users can click and it runs this:
clearappcache com.microsoft.office.outlook
clearappcache com.microsoft.teams

So it clears cache, but since the account is still stored in the phone itself the afternoon shift can still log-onto his account.

I couldnt find any script that would get rid of the account from device. So how do I do this?
"I need users to be able to remove account within Kiosk mode"

2 years ago
Android Scripting
ANSWERS