Is it possible to connect via Remote Desktop Connection to a windows 7 machine without locking the remote computer (I want to use the same logged in user)? Or is it possible to release the lock after the remote desktop session is closed?
As far as I know, it's not possible to prevent Remote Desktop Connection from locking the computer, but Ultra VNC allows you to remote control another machine without locking it.
If you need to unlock the remote computer after closing the Remote Desktop Connection, here’s a trick which you can use to force RDP to disconnect without locking the session and logged local user back in on the local console screen upon disconnection of Remote Desktop Connection.
On the remote system connected through RDC (not on your computer which RDC is initialized to connect to remote system), open a Command Prompt window as administrator, then run the command depending on the Windows operating system that is running on the remote system.
On Windows XP:
tscon 0 /dest:console
On Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 or newer:
tscon 1 /dest:console
On Windows Server:
tscon %sessionname% /dest:console
No Locking Local Console when Using Remote Desktop Connection
Take a look at remote assistance. It basically uses the same remote desktop technology under the hood.
You go into the help and support area and create a remote assistance request you can send to the person you want to remote at the same time.
Alternatively you could use Logmein.com and install LogmeinFree which enables you to remote control a users pc at the same time they;re using it.
As an alternative you can use Gbridge: "Gbridge is a free software that lets you remotely control PCs, sync folders, share files, and chat securely and easily. An extention of Google's gtalk service, Gbridge automatically forms a collaborative, encrypted VPN (Virtual Private Network) that connects your computers and your friends' computers directly and securely. Gbridge has many unique features." http://www.gbridge.com/
Mentioned in another answer, but LogMeIn.com has a free version, and allows you to share the connection with the local user or blank the screen. I have found the response time fairly decent over slower connections, but the graphics quality goes down when speed does.
It can't be done with RDC itself, you'll need to use a third party tool like TeamViewer. You technically can use remote assistance, but once you're out of requests you can't do anything.
To solve a similar Task where we had to prevent Screen-lock for a Schedule Task, I've written a Batch File which looks like this:
for /f "tokens=3-4" %%a in ('query session %username%') do @if "%%b"=="Active" set RDP_SESSION=%%a tscon %RDP_SESSION% /dest:console
This also requires
Admin Rights for execution but it's pretty handy as a shortcut on the user's desktop.
Please note, this process is designed to leave the the desktop in an unlocked, and thus insecure, state. It should not be used if an untrusted third-party might have physical access to the system while the user is not present.
I ran across this issue (and question) because I commonly connect to my desktop machine from my laptop using RDP. I'm actually doing so right now when typing this answer, since I keep my "main" browser session on my desktop. When I tried connecting Moonlight, an open-source nVidia Gamestream client, I found that RDP was locking the system when exiting. This is good behavior, of course, but GameStream requires that the desktop not be locked.
While there are a lot of answers here already, some of them dating back almost a dozen years, my preference on how to solve it in 2021 on Windows 10 comes down to what I consider a "simpler" PowerShell one-liner:
Start-Process tscon -ArgumentList ((quser | Select-Object -skip 1) -replace ".* (\d+) .*", '$1'), "/dest:console" -Verb RunAs
This builds on Felix's answer:
It first runs
quserto get the session ID. On a single-user, Windows 10 Professional system, there should only be one session. However, the ID will change if you connect often, so you need to retrieve that via the RegEx
-replace, which finds the first "number" on the line. Unless the username itself is purely a number, then this should work in all other cases.
tscon ... /dest:consoleto disconnect that session using the result of the
It does so using
Start-Process ... -Verb RunAsto run the command elevated with Admin permissions, which is necessary on Windows 10, at least. Given the lack of mention of this in previous answers, it might not have been needed on Windows 8 or before.