There are 2 methods to do this:
Open CMD with admin right, then —
A. Type “qwinsta /server:xxx.xxx.xxx.xxx” into the window, replacing “xxx.xxx.xxx.xxx” with the IP address of your server. When you hit “Enter,” a list of active remote-desktop connections will appear. Each session will have an ID number assigned to it.
B. Use the “rwinsta /server:xxx.xxx.xxx.xxx id” command, replacing “xxx.xxx.xxx.xxx” with the IP address of your server and “id” with the ID number of the session you want to end. When you hit “Enter,” Windows will end the selected session.
A. Go to CMD prompt and run “quser /server:YOUR_SERVER_NAME”, it will list all the remote connection.
B. Still in CMD prompt, run “logoff rdp-tcp#123 /server:YOUR_SERVER_NAME”(where 123 is the sessionname)