Skip to content

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

by peterdk on February 20th, 2010

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.

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
Value : 1

Reboot. Now it should work. 🙂

From → Windows

  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
    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 (

  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:

    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 (

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

    Trying with IP
    msg /server: * “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 . 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?

  19. The BOFH permalink

    HKLM is shorthand for HKEY_LOCAL_MACHINE in the Registry. I would suggest if you didn’t already know this, then you know too little to be fiddling around in there.

  20. Antonio Cuevas permalink

    modify regedit file



    HKLM \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server

    Name: AllowRemoteRPC

    Type: REG_DWORD

    Value: 1 (the dafault is ‘0’)

    sending message

    msg / SERVER: Destination User “send message”


    modificar archivo regedit



    HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server

    Name : AllowRemoteRPC

    Type : REG_DWORD

    Value : 1 (the dafault is ‘0’)

    envio de mensaje

    msg /SERVER:Destino Usuario “mensaje a enviar”


  21. Skype: Captain.TechLord permalink

    It’s even easier! Just enter the following line into CMD or RUN (Win+R)
    Reg ADD “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v AllowRemoteRPC /d “1” /t REG_DWORD /f

  22. Wiz_of_redstone permalink

    Skype: Captain.TechLord I keep getting the Error: Access is denied> How do i fix this.

  23. SlickStretch permalink

    Wiz, try logging in as an administrator and/or running CMD and admin.

  24. cirus permalink

    msg * /server:servername(or ip) messenger

  25. Windows XP use the NET SEND command, Windows Vista got the MSG command, and Windows 7 Business, Enterprise, and Ultimate also have the MSG command, but Windows 7 Home was out of such commands. There is no simple command-line based messaging tool for LAN-wide messages included with Windows 7 Basic and Home, and recreating the command line experience is a hassle (as you need a replacement for both the command line tool msg.exe and for the messaging services running in the background).

    If you’re not big fan of on a command line interface, a easy Windows 10 based application you may want to check out is LAN cet chat. It’s looks like an usual IM client, and compatible with net-send/pop-up messages so older PCs on the network won’t even need the app installed to receive the messages.

  26. i have a little promlem pls help

  27. তোমার টায় কাজ করে না।।

  28. ক্যান ইউ টক টু মি বাঙ্গালী।

Trackbacks & Pingbacks

  1. Msg.exe - 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

Comments are closed.