I’ve been on a mission to update my Teams status through a script for a long time and stumbled upon the stack overflow post where Monty had “looked” at the Teams code to get the parameters that it *currently* supports.
By using the multiaction switch block I was able to have a button that toggles between Available and Away with my StreamDeck.
This is a hack right now and needs polishing but @PatchandSwitch wanted documentation.
Create a powershell script file that runs teams with the appropriate parameter, one file for each status.
Note that the file path can and will change. I found that attempting a dir -recurse of c:\program files\windowsapps fails so unfortunately it’s a hard coded filename for now.
set-teamsaway.ps1
&”C:\Program Files\WindowsApps\MSTeams_24074.2321.2810.3500_x64__8wekyb3d8bbwe\ms-teams.exe” –set-presence-to-away
Create a set-teamsaway.bat that calls this powershell script.
powershell -noprofile <path to script files>\set-teamsaway.ps1
Repeat this process but use set-teamsavailable.ps1 and set-teamsavailable.bat
Use any of the following options.
–set-presence-to-available
–set-presence-to-dnd
–set-presence-to-be-right-back
–set-presence-to-away
–set-presence-to-offline
–reset-presence
In the Stream Deck Editor, Create a Multi Action Switch and drag to an empty (if you have one) spot.
Select the content action
Drag a System/Open button to the first tab and set the Title and App. I had to use the bat file because powershell would not work for me.
Select the second tab at the top and repeat but use the set-teamsavailable.bat
Now if you press the button, it will set you to away, press it again and it will set you back to available again.