Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Your message function still works! Why? Magic?

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

5 comments
Date Votes
  • 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?

    0
  • 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

    0
  • 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:

     

    Send-Msg -Username <user to send message too, * for all logged in users) -Computer <computername> -MessageText "Your Message Text in quotes"
    0
  • 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! 

    0
  • You're welcome. I kinda love writing Powershell, so happy to help. Adds to the Github repertoire of goodies! Haha!

    0