New Teams Compatability Hack - Testing Required
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:
- Pure powershell (even the most locked down environments appear to still have Powershell locally for the most part)
- 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.
Pushed more changes.
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
I've borrowed some code and updated the original script which is working with the new (or current 😅) Teams client. Thanks for your help!