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:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 10 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 :)
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.
I have turned off the firewall also. I am getting session request failed.
r there any changes to be made in smb.conf file???
Hi,,,, me too getting same message….
Help to solve… Make it as complete post…
I have turned off the firewall also. I am getting session request failed.
r there any changes to be made in smb.conf file???
use netbios name of computer instead of IP
i have such error when using IP, but with netname – all working
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