Created
March 24, 2025 12:22
-
-
Save DavaGordon/6202234d5760d1521edf7fe416a1de3b to your computer and use it in GitHub Desktop.
Stop Teams Status Away
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while ($true) { | |
try { | |
Get-Process -Name 'ms-teams' -ErrorAction stop | Out-Null | |
Write-Host ("{0} - Microsoft Teams is running..." -f $(get-date)) -ForegroundColor Green | |
$wshell = New-Object -ComObject wscript.shell | |
$wshell.sendkeys("{NUMLOCK}{NUMLOCK}") | |
Write-Host ("{0} - Pressed NUMLOCK twice and waiting for 60 seconds" -f $(get-date)) -ForegroundColor Green | |
Start-Sleep -Seconds 60 | |
} | |
catch { | |
Write-Warning ("{0} - Microsoft Teams is not running, sleeping for 15 seconds..." -f $(get-date)) | |
Start-Sleep -Seconds 15 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment