Your message function still works! Why? Magic?

Comments

5 comments

  • Stephen Valdinger

    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
    Comment actions Permalink
  • Jack Flint

    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
    Comment actions Permalink
  • Stephen Valdinger

    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
    Comment actions Permalink
  • Jack Flint

    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
    Comment actions Permalink
  • Stephen Valdinger

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

    0
    Comment actions Permalink

Please sign in to leave a comment.