[Samba] Winpopup message to all user on a PDC
stymar at agcs.com
Wed Jul 2 14:42:18 GMT 2003
> Il 01/07/2003, alle ore 14:19, Roberto Samarone Araujo (RSA) ha scritto:
> > It it possible to send messages to all users logged in a PDC at
> > time ?
> I didn't find a ready-to-use program, so I use something like this
> inside an executable script:
> for i in $(cat /path/clientlist.txt)
> echo message_text | smbclient -M $i &
> clientlist.txt is an ASCII file containing a list of all NetBIOS names
> of the PCs in the network, e.g.:
> message_text is the text you want to send.
In the above example, you can generate a list of the machine names
(/path/clientlist.txt) on the fly with the following sed script.
The script is all one line even though the mailer will wrap it.
smbstatus | sed -e
"1,4d" -e"s/^[^ ][^ ]*[ ][ ]*[^ ][^ ]*[ ][ ]*[^ ][^ ]*[ ][ ]*[^ ][^ ]*[ ][
]*\([^ ][^ ]*\).*/\1/" -e '/^$/,$d'
By the way, the sed script reads,
1. Delete the first 4 lines
2. Throw away everything but the 5th word from each line.
3. Delete all the lines after you hit a blank line (not counting the first
which were already thrown away.
More information about the samba