[Samba] Submiting a bug: smbclient -M host

Thomas Bork tombork at web.de
Wed May 29 15:13:03 GMT 2002


Hi,

vlindos at vlindos.samba.org wrote:

> so, i have problems with samba when i try to send message over
> netbios to Win2k,WinXp host, it just tell me session request failed!
> What I am suppose to do ? I've test this with samba-2.2.[1-4] - no
> differnce found. Can you help me with something or just tell me what
> information you need? Please I really do need sending messages on my
> local net, but more hosts are winxp - so can you help me ? if you
> have any suggestion - please send me email: vlindos at abv.bg

this worked for me very well in 2.2.x with Win2k and WinXp with
installed service "Nachrichtendienst" - sorry, don't know the english
name.
Here's a script, which Im using in 2.2.3a (maybe you have to use echo
and not colecho and comment out lines with "/var/install/bin/anykey"):

#!/bin/sh
#
# Send message to NETBIOS hosts
#
clrhome
colecho "Send Message to Samba Clients" gn
echo

if [ "$hosts" = "" ]
then
    echo -e "To which Samba Clients the message should be send?"
    echo
    echo -e "Choice 1"
    echo -e "--------"
    echo -e "All Samba Clients with active connections - type 'all'."
    echo
    echo -e "Choice 2"
    echo -e "--------"
    echo -e "One ore more active Samba Clients, type NETBIOS Names
separated with a blank,"
    echo -e "for instance 'client1 client2':"
    echo
    read hosts
fi

if [ "$hosts" = "" ]
then
    echo
    colecho "No Samba Client specified" br x br
    /var/install/bin/anykey
    exit 0
fi

clrhome
colecho "Send Message to Samba Clients" gn
echo

if [ "$message" = "" ]
then
    echo
    echo -e "Which Message should be send?"
    echo -e "For instance 'EIS-Samba-Server is going down in 3
Minutes...':"
    echo
    read message
fi

if [ "$message" = "" ]
then
    echo
    colecho "No Message specified" br x br
    /var/install/bin/anykey
    exit 0
fi

if [ "$hosts" != "" -a "$message" != "" ]
then
    status=`smbstatus -b \
            | grep -vi "Samba version 2.2.3a" \
            | grep -vi "PID     Username  Machine
Time logged in" \
            | grep -vi "-" | grep '[1-9]' | cut -c19-48`

    if [ "$hosts" = "all" ]
    then
        if [ "$status" = "" ]
        then
     echo
     colecho "No Samba Client activ" br x br
            echo
            /var/install/bin/anykey
     exit 0
        else
            for i in $status
            do
                  echo $message|smbclient -U "EIS-Samba-Server" -M "$i"
1> /dev/null
                  if [ "$?" != "0" ]
           then
               echo
               colecho "Sending Message to one or more Clients failed"
br x br
           fi
            done
 fi
    else
        for i in $hosts
        do
                 echo $message|smbclient -U "EIS-Samba-Server" -M $i 1>
/dev/null
                 if [ "$?" != "0" ]
          then
                     echo
       colecho "Sending Message to one or more Clients failed" br x br
   fi
        done
    fi
fi

echo
/var/install/bin/anykey


Thomas Bork






More information about the samba mailing list