if you want to do it when user logs off, as the user, you have no choice.
if you do remote scripting, then you can do some reg check of dir scanning.

but keeping it simple, %username% or @userid and doing logoff script is the simpliest way.