In recent versions of QM you can usually log-off agents from the administrator's page. As an alternative, you can create a cron job that does something like:
asterisk -rx "queue remove member Agent/101 from q127"
asterisk -rx "queue remove member Local/103@from-internal/n from q127"
....
and so on...