21 April 2016

How to get the neighboring computer to talk using psexec, PowerShell and System.Speech

Let’s assume, you have domain network and you are using domain admin to do the trick. Also the neighbors computer must be running quite fresh windows version (i tried windows 10 only, let me know when older ones also work).

First of all you need psexec from sysinternals to run something on other computer. http://live.sysinternals.com/ is one good starting point for getting that tool.

Next open your command prompt as the domain admin user and type the following command (yes, it is a one-liner):

psexec \\neighbor cmd /c powershell [Reflection.Assembly]::LoadWithPartialName('System.Speech');$object = New-Object System.Speech.Synthesis.SpeechSynthesizer;$object.Speak('i know what you did last summer')

where neighbor is the name of the neighboring computer and last string is the text to speak. After some waiting the neighboring computer should talk to the default audio device.