AntoineGS / TeamsStatusV2

Monitoring your Microsoft Teams status with PowerShell
MIT License
40 stars 5 forks source link

TeamsStatus

Notice

The New Teams does not have the same kind of verbose logging (at least as of writing this) as the Legacy Teams. It does however support the WebSockets API which supports statuses for in meeting and video is on. I have written a new application here: https://github.com/AntoineGS/teams-status-rs

Introduction

This PowerShell script/service uses the local Teams' log file to track the status and activity of the logged in Teams user. Microsoft provides the status of your account via the Graph API, however to access the Graph API, your organization needs to grant consent for the organization so everybody can read their Teams status. This solution is great for anyone who's organization does not allow this.

This script makes use of three sensors that are created in Home Assistant up front:

Important

This solution is created to work with Home Assistant. It could be adapted to work with any home automation platform that provides an API, but you would probably need to change the PowerShell code.

Installation

Uninstallation

You can uninstall the service by executing the Uninstall.ps1 script. Using the previous path as an example, in PowerShell you would run:

  C:\Scripts\Uninstall.ps1

Note: This will not stop the script if it is currently executing, if you would like to do so just kill it (powershell.exe). If you get an error that the file "is not is not digitally signed", simply run the following before executing the uninstaller again:

  Unblock-File C:\Scripts\Uninstall.ps1

Contribution

Pull Requests are welcomed!

Credit

Original work by EBOOZ, which can be found here: https://github.com/EBOOZ/TeamsStatus. As the project seemed abandoned with multiple PRs not being addressed it has been cloned into this repo.