I am looking for a way to remove linked mail accounts from a local Windows user via a script from the command line, or another way I can reliably schedule.
I'm not talking about a Microsoft account, I'm taking about the other mail/work accounts you can link to a Local Windows User
I can remove them with ease from the graphical interface, however I'm looking for a way to schedule the operation as I have a number of laptops that are used for classroom courses by new users on a daily basis, and it's not always feasible/doable to reset them to a specific recovery point. I'm trying to protect users who may accidentally save their personal accounts on the machine.
My plan was to schedule a cleanup with an agent installed on the machines, I don't know however how to remove these accounts (Best option for me would be to indiscriminately delete them all). If there are other options feel free to share them, tho they might not be applicable to my use case.
I'm on windows 10
Thanks in advance
HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\UserExtendedProperties
. Unless there's a better way I guess I'll just make a small program that emails me if one is found so I can manually remove it without working directly with the registry