I think you need to define a bit better what you mean by "log out".
By definition, when the client shuts down it logs the user out of IC (as Robert indicated). If the Client is not running, a user is not logged in, as seen in Interaction Supervisor or the Company Directory Status "Logged In" column.
It sounds more like you are asking how to change the user status to Something other than Available when the computer shuts down, is that correct?
You can run a timer-based handler which checks whether a user is logged in, checks the status, and changes the status as appropriate. You would have to loop through all the Users you are interested in.
I don't have time to give details, unfortunately...