Broadcast Winpopup -HOWTO

Christian Barth barth at cck.uni-kl.de
Wed Nov 22 06:40:40 GMT 2000


I have written a (buggy) skript to do so: 
Give the username as argument and the Message is dilivert to all PC's he/she is using. 
Give "alle" as username and everybody gets the message:

#!/bin/sh

if [ "$1" = "alle" ]; then
 pc=`smbstatus -b | grep -v PID | grep -v Samba | grep -v "\-\-" | awk '{print $3}' | sort -u`
else
 pc=`smbstatus -Su $1 | grep $1 | awk '{print $5}' | sort -u`
fi

# echo $pc

if [ $# !=  2 ] ; then
  echo Meldung eingeben und mit Crtl+D beenden !
  meldung=`cat - | unix2dos`
 else
  meldung=$2
fi

for p in $pc
do
  echo $meldung | smbclient -M $p
done

Christian




More information about the samba-ntdom mailing list