Your message function still works! Why? Magic?
Jack Flint
I'm struggling with the demise of “net send”, and the Microsoft documentation I read says “msg” only works for RDS (Terminal Server). What are you running to accomplish the sending of the message? If it is a script, can you share the code?
0
Comments
msg does in fact work on every flavor of windows, not just RDS, and it is what they are using. What documentation are you referencing?
Thanks for the reply Stephen,
I’d be happy to be wrong. The evidence of the PDQ message actually working indicates I might be (although magic is still a feasible answer). I pasted a few links below that all say that MSG is an RDS command. I tried several iterations of the command outside of RDS and never got it working. That being said I certainly could have gotten the syntax wrong. If anyone has a (I assume PowerShell) wrapper you can share you’ll make my day a very good day.
https://technet.microsoft.com/en-us/library/cc771903(v=ws.11).aspx
https://www.lifewire.com/msg-command-2618093
https://answers.microsoft.com/en-us/windows/forum/windows_7-networking/msgexe-netsend-anything-availible-on-windows-7/e9743edc-afa9-4942-b1c7-66baf443067b
Unfortunately, I'll have to admit your wrong.
basically they are doing this:
msg <username> (* for all logged in users) /server:localhost "Message Text"
A quick Powershell wrapper could look something like this. NOTE: this is a quick 5 minute script, but it does the trick:
Function Send-Msg{
Param(
[cmdletBinding()]
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[string]$Username,
[Parameter(Mandatory=$true,Position=1,ValueFromPipeline=$true)]
[string]$Computer,
[Parameter(Mandatory=$true,Position=2)]
[string]$MessageText
)
Start-Process msg -ArgumentList "$Username", "/server:$Computer", "$MessageText" -NoNewWindow
}
Usage:
Very Cool Stephen,
I can't wait to give this a try. I appreciate it so much. I guess I have to admit I'm wrong!
You're welcome. I kinda love writing Powershell, so happy to help. Adds to the Github repertoire of goodies! Haha!