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

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

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 4 comments… read them below or add one }

1 Manish 10.10.08 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

2 MaZ 11.05.08 at 7:06 am

use the ip instead

$ smbclient -M 192.168.1.45 <<EOF

3 Manish 11.05.08 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

4 rilwis 12.05.08 at 3:07 pm

Thanks. It’s an useful tip :)

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , ,

Previous post: FreeBSD > Sending a Message by E-Mail

Next post: FreeBSD > Init to reboot or shutdown system