Skip to content

Solution to Msg.exe “Error 5 getting session names”

by peterdk on February 20th, 2010

Info
My Windows-Server 2008 R2 machine couldn’t msg my Windows 7 box due to Error 5 getting session names.
I found the solution here, in a comment made by Consoles. I reblog it so it can be found easier.

It turns out it has nothing to do with not being on the same domain or whatever. It is due to a setting related to Terminal Server.
That’s not to miraculous, since msg.exe is designed for messaging to terminal users.

So, changing a simple registry value and rebooting makes it all work again.

Solution
On the machine that you cannot message to:
Use regedit to navigate to: HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
Then change the following value:

Name : AllowRemoteRPC
Type : REG_DWORD
Value : 1

Reboot. Now it should work. :)

From → Windows

23 Comments
  1. wick422 permalink

    I did this on all my Windows 7 HP machines and it got rid of the error 5 but now it says [username] does not exist or is disconnected. Any solution yet. I have been google-ing for about 3 hours on this and haven’t found anything other than 3rd party installs which is impractical in my situation.

  2. peterdk permalink

    What is the exact command you give to send a message? Does the user you send the message to indeed exists on the target machine? And is it logged on there?

  3. AbO 3atreeS permalink

    hey [wick422] try this one
    msg /server:servername * yourmessage
    Example:
    msg /server:AMMAR-LAPTOP * HelloThere!

  4. Alex permalink

    Try msg * /server:AMMAR-LAPTOP “HelloThere!”

  5. superray permalink

    Hi All after much trying and re trying i got it right to send windows 7 to windows 7

    using the following command

    msg /server:pcname username message

    server stays as is. pcname is the name of the pc you are sending to. user name is the name the user is logged in under on that PC. message is obviously the msg u want to send.

    you will also need to change a setting on the receiving computer by using regedit.

    the following registry key must be activated (as described by Consoles above):

    HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server

    Name : AllowRemoteRPC

    Type : REG_DWORD

    Value : 1 (the dafault is ’0′)

  6. Zach permalink

    I do not appear to have HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server on my computer? Is there any way for me to get it?

  7. Anon permalink

    Isn’t allowing remote RPC like, a *HUGE* security risk?

    I’d like to enable this so me and my roommate downstairs can have a ridiculously simple way to communicate, but if it means allowing his computer to make RPC calls, I’m afraid if he has a virus my computer will catch it, or if for some reason RPC requests are able to pass through my router, anyone over the internet will have an easy attack vector to my machine.

    I think there’s a reason it’s disabled in Vista/7 by default. I’m not sure if the winpopup is worth compromising your security.

  8. shen permalink

    superray: search in regedit (F3) for ‘allowremoterpc’ it will find it

    anon: yes, but only in intranet, and only if your firewall does not stop it. the rooter firewall will prevent all attempts by default. (it could be a problem only in mass lan-s like barding school. If scared, use skype or msn (meeboo.com)

  9. Wells permalink

    You can send messages among Windows 7 machines and Windows XP machines on a LAN using freeware. It took a lot of searching, but I found an app that works from a command prompt and in batch files to send messages.

    For sending messages, use Sent from WinSend.
    For receiving messages, each machine needs to run WinSent Innocenti.
    Both are available here:
    http://www.winsentmessenger.com/download/

    I had hoped to use msg.exe on our LAN, but after trying all the recommended Registry tweaks, firewall changes, etc., I could only send messages to Windows 7 machines. The above freeware apps worked right away sending to Windows XP machines and to Windows 7 machines. They work on both Workgroup LANs and on domains.

    WinSend is a more traditional Instant Messaging application that starts at about $12 and goes down in price based on quantity of licenses purchased.

  10. jastreender permalink

    ssghsg sjjsjtr 146776378

  11. lo mejor

  12. Alex permalink

    I know this is old, but maybe someone has a solution.

    My computer: PC
    Target: LAPTOP (192.168.0.110)

    msg /server:laptop * “Hello Laptop”
    Returns * does not exist or is disconnected.

    Trying with IP
    msg /server:192.168.0.110 * “Hello Lappy”
    Returns ‘Error 5 getting session names’

    I have already applied the registry change and rebooted the machine multiple times.

    Any other suggestions?

  13. suhail permalink

    if both system is running on win7, then u need to add to receiver system’s login userid and password in “windows credentials”

  14. Static permalink

    you need to do what SUHAIL said…
    and the computer wich you are triying to conect need a password, and user… added in windows credentials,
    shearch in windows credential manager… and add the user and password…

  15. RonaldNah permalink

    My name is Ronald. Am new here. Am getting a lot of help from this forum.

  16. Martina permalink

    I recommend to try http://messenger.softros.com . This app very stable and it has Terminal service support. Windows Server is supported too.

  17. this is what did it for me. Needed notification from a remote service a long running job had finished!

  18. Hi i tried to go to regedit and follow the steps but it doesn’t have a folder called HKML instead it has HKEY_CLASSES_ROOT and HKEY_CURRENT_USER etc. can i get the path for the folders i have?

Trackbacks & Pingbacks

  1. Msg.exe - TechExams.net IT Certification Forums
  2. Triggern einer Infobox auf einer Win7 workstation - IP-Symcon Community Forum
  3. Displaying Messages
  4. Anonymous
  5. Displaying a message on Networked Computer

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS