Have you ever tried to use Remote Desktop Connection to remotely log into another computer only to get a “exceeded maximum number of allowed connections” error?
Most of the time, all those connections are probably legitimate, in which case, you probably shouldn’t be doing what I’m about to tell you. However, in some cases, sessions just aren’t killed properly giving you a valid reason to use this trick.
To see what active sessions are currently running on the remote computer, open a command prompt and type:
qwinsta /SERVER:<IP_ADDRESS_OF_REMOTE_COMPUTER>
You might get something like below:

Look for those sessions with the type “rdpwd”. At this point, you’re just going to have to pick a session to kill. Once you’re made your decision, run:
rwinsta /SERVER:<IP_ADDRESS_OF_REMOTE_COMPUTER> <ID_OF_SESSION_TO_KILL>
These commands require you already be authenticated to the computer you’re trying to log on to. If you’re not, the commands will fail. Just open a UNC path to the computer and authenticate through that. Then you can run the commands again.
And that’s it, you should be able to remote in without exceeding the maximum connections now.
Enjoy and use wisely. Remember, with great power comes great responsibility.