FreeBSD / Linux: Sending a Message to Windows Workstation with smbclient command

by on February 23, 2005 · 10 comments· Last updated September 6, 2007

You can use utility smbclient (part of samba server) to send a message to windows system from FreeBSD (or even from Linux/Solaris/UNIX OS). This command lets you send messages to windows workstations, display browse lists, and connect to SMB shares. Genral syntax of to send a message is as follows:

smbclient -M <WINDOW-SYSTEM-NAME> <<EOF
Message
Message
...
..
...
When the message is complete, press Control-D.

Send message to Windows system from Linux/ FreeBSD

To send a message "Meeting canceled" to windows system called joyxp
$ smbclient -M joyxp <<EOF
Output:

Meeting canceled
See you at coffee house in 2 hrs.
--Vivek
EOF

With –U you can specify the username.
$ smbclient -M myxp -U VIVEK <<EOF
Meeting cancelled
See you at coffee house in 2 hrs.
EOF

This tip also works with Linux and other UNIX variant with Samba client utilities package. Read man page of smbclient for more information.
man smbclient



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 10 comments… read them below or add one }

1 Manish October 10, 2008 at 10:25 am

smbclient -M machine1 <<EOF

I tried the given command & syntax but received an error message “Connection to machine1 failed”

Please suggest ..

Regards,
Manish

Reply

2 MaZ November 5, 2008 at 7:06 am

use the ip instead

$ smbclient -M 192.168.1.45 <<EOF

Reply

3 Manish November 5, 2008 at 9:13 am

Hi,

Actually the problem was at widow client machine’s end. The Firewall was on.

I switched off firewall (diabled) and it started working normally.

Thank you for your suggestions.

Regards,
Manish

Reply

4 rilwis December 5, 2008 at 3:07 pm

Thanks. It’s an useful tip :)

Reply

5 Joe April 20, 2010 at 12:03 pm

The messenger service is a big security hole in windows and its normally turned off now days.
If your gonna turn this back on, make sure your hosts are well protected.

Reply

6 kasyapa April 20, 2010 at 1:21 pm

I have turned off the firewall also. I am getting session request failed.
r there any changes to be made in smb.conf file???

Reply

7 Kumar P August 13, 2010 at 4:20 am

Hi,,,, me too getting same message….

Help to solve… Make it as complete post…

Reply

8 AmarJ August 29, 2010 at 5:32 pm

I have turned off the firewall also. I am getting session request failed.
r there any changes to be made in smb.conf file???

Reply

9 manitou October 2, 2010 at 7:30 am

use netbios name of computer instead of IP
i have such error when using IP, but with netname – all working

Reply

10 Rahul February 7, 2012 at 12:22 pm

I tried the given command & syntax but received an error message
> bash: warning: here-document at line 21 delimited by end-of-file (wanted `EOF’)
Enter root’s password:
Connection to 192.168.100.10 failed. Error NT_STATUS_UNSUCCESSFUL

Please HELP

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 8 + 8 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Tagged as: , , , ,

Previous post:

Next post: