XP, Vista or Windows 7:
Is there a command to use the "switch user" feature, the same way there is one to lock the workstation?
You can connect to an existing session with
If Fast User Switching is on, then simply locking the workstation
I believe it is possible, this article from Lifehacker explains how: