This cool blog
First you must have administrative rights on the machine you are trying to log yourself off of.
You will need to get the SessionId to do that run this command bellow
quser /server:[ServerName]
You will something close to this:
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
[YourId] 2 Disc 3 10/2/2014 12:28 PM
Make a note of the number under the ID column. In this case it is 2.
Next you run the following command using the ID that you got before:
logoff 2 /server:[ServerName]
All done you are logged off.