If you want to log everyone out and kill all their apps ( I am a teacher. I have delusions of omnipotence... ;-) ), use /etc/init.d/gdm restart or stop.
That stops all the login sessions to the GUI which accomplishes a lot. I sometimes set that up in a crontab to dismiss class at a certain time... You can also use pkill -u someuser or pkill -f somecommand (watch out. That kills fred's somecommand and Bill's somecommand but it allows to kill all instances of something like a web browser.)