PowerShell can be used for TTS / Text-to-Speech. In this specific example, PowerShell will be used for Paessler/PRTG (www.paessler.com) text-to-speech notifications. It will actually run against a remote-system in this scenario in a central NOC/Network Operations Center room and announce down sensors/systems. This was originally posted by myself on https://kb.paessler.com/en/topic/79674-can-we-have-the-ability-to-set-audio-notifications-when-sensors-go-down-up.
You simply create the script in the path C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE and create a new notification for it.
The parameters should be configured like this:
-TargetComputer ‘COMPUTER123’ -Device ‘%device’ -Name ‘%name’ -Status ‘%status’ -Message ‘%message’
Replace the COMPUTER123 with what ever client should play the sound – in our case this is the workstation that shows the MAPs on a TV and the sound actually comes out of the TV.
You might need to enable remote power shell execution on the target system, a hint for this is the following command: Enable-PSRemoting -Force
Here is the script file: Name: PRTGtoWorkstationText2Speach.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #By Florian Rossmark Param( [string]$TargetComputer, [string]$Device, [string]$Name, [string]$Status, [string]$Message ) $TextMessage = "$($Device) $($Name) is $($Status) $($Message)" Invoke-Command -ComputerName $TargetComputer -ScriptBlock { $TextMessage = $args[0] Add-Type -AssemblyName System.speech $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer $speak.Rate = -2 $speak.Speak($TextMessage) } -ArgumentList $TextMessage |