TeamsStatus icon indicating copy to clipboard operation
TeamsStatus copied to clipboard

New Teams Compatability Hack - Testing Required

Open latetedemelon opened this issue 1 year ago • 2 comments

Reviewed the new log location and format and hacked the previous PS script together to work with the new log version. IMO, @EBOOZ 's script is a superior soltion to other solutions out there as:

  1. Pure powershell (even the most locked down environments appear to still have Powershell locally for the most part)
  2. No admin / elevated rights required (assuming you don't use a service)

This is a very quick hack, and I have limited dev experience. I'll do my best to support changes but my skill is limited.

latetedemelon avatar Jun 14 '24 19:06 latetedemelon

Pushed more changes.

latetedemelon avatar Jun 18 '24 18:06 latetedemelon

Hi,

I came across your PR as I also am restricted by not having admin rights. I ran your Get-TeamsStatus.ps1 on the command line to test it out and I'm finding the status never changes from 'Available'. As the script runs, I change my Teams v2 status from Available to Busy or Away but the script keeps posting 'Available' each time. I tried to see what the cause is myself but I couldn't narrow it down. It seems in the If logic for the $TeamsStatus, it always hits the first ElseIf condition after each loop and never goes to the next ElseIf when I change the Teams status. Here's the output with PI removed:

PS C:\Scripts\MSTeams> .\Get-TeamsActivity.ps1
Latest log file: C:\Users\*\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\MSTeams_2024-06-18_14-00-10.00.log
Successfully read the log file content.
TeamsStatus entries found: 7
TeamsActivity entries found: 9
Microsoft Teams process is running.
Status set to: Available
Activity set to: Not in a call     
Successfully updated status to Home Assistant.
Successfully updated activity to Home Assistant.
Latest log file: C:\Users\*\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\MSTeams_2024-06-18_14-00-10.00.log
Successfully read the log file content.
TeamsStatus entries found: 7
TeamsActivity entries found: 9     
Microsoft Teams process is running.
Status set to: Available      
Activity set to: Not in a call
Latest log file: C:\Users\*\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\MSTeams_2024-06-18_14-00-10.00.log
Successfully read the log file content.
TeamsStatus entries found: 7
TeamsActivity entries found: 9     
Microsoft Teams process is running.
Status set to: Available
Activity set to: Not in a call
Latest log file: C:\Users\*\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\MSTeams_2024-06-18_14-00-10.00.log
Successfully read the log file content.
TeamsStatus entries found: 7
TeamsActivity entries found: 9
Microsoft Teams process is running.
Status set to: Available
Activity set to: Not in a call
Latest log file: C:\Users\*\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\MSTeams_2024-06-18_14-00-10.00.log
Successfully read the log file content.
TeamsStatus entries found: 7
TeamsActivity entries found: 9
Microsoft Teams process is running.
Status set to: Available
Activity set to: Not in a call
Latest log file: C:\Users\*\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\MSTeams_2024-06-18_14-00-10.00.log
Successfully read the log file content.
TeamsStatus entries found: 7
TeamsActivity entries found: 9
Microsoft Teams process is running.
Status set to: Available
Activity set to: Not in a call

harphere avatar Jun 18 '24 21:06 harphere

I've borrowed some code and updated the original script which is working with the new (or current 😅) Teams client. Thanks for your help!

EBOOZ avatar Dec 21 '24 17:12 EBOOZ