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
- Email this to a friend
- Printable version
- Rss Feed
- Last Updated: Sep/6/2007

{ 4 comments… read them below or add one }
smbclient -M machine1 <<EOF
I tried the given command & syntax but received an error message “Connection to machine1 failed”
Please suggest ..
Regards,
Manish
use the ip instead
$ smbclient -M 192.168.1.45 <<EOF
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
Thanks. It’s an useful tip :)