Teams whoami
Report which Microsoft Teams account this browser is signed in as — work or personal: email, name, whether it is a personal (consumer) or work account, and which Teams host it lives on (personal accounts are redirected to teams.live.com). Being signed out is reported as a normal answer (loggedIn false), not an error, so it can be used to check a session — and pick the right Teams host — before running other Teams scripts.
Input
None
Output
loggedIn requiredhost optionalThe Teams host the account landed on
name optionalemail optionalaccountType optionalpersonal = consumer Microsoft account (Teams on teams.live.com); work = organization account
FAQ
Send Chat Message
Send a message in a 1:1 Teams chat by contact name — finds the person, opens their chat, sends the message, then reads the sent message back to confirm it posted.
Get Chat Messages
Read messages from a 1:1 Teams chat by contact name. Finds the person, opens their chat, and returns every currently-loaded message with sender, ISO timestamp and text. Needs no admin or export permission.
Edit Chat Message
Edit one of your own previously-sent messages in a 1:1 Teams chat, identified by its message id (mid), replacing its text.
