Solved

Automatically unlock remote computers screen after a RDP session?

Posted on 2012-03-19
11
10,221 Views
Last Modified: 2012-03-20
Hi experts,

I use a windows 7 Pro computer to remotely log onto another computer that runs some automated tasks (remote onto the pc to add/edit the tasks) The remote PC also runs windows 7 Pro. I’m using windows inbuilt remote desktop / RDP.

The problem is when I close the remote desktop session the remote computers screen gets automatically locked and tasks that are set to run automatically fail. Most of the tasks are run by using automation anywhere software which works by auto opening programmes, entering keyboard commands and mouse movements so the screen needs to remain unlocked for tasks to run.

Is there a way of automatically unlocking the screen when the remote desktop/ RDP session  ends?. There’s only ever the one user account that is used to log onto the remote computer .

I thought maybe I could automatically run a script and pass the user credentials but not sure how. Ideally I don’t want to use alternative remote control software as we want to keep machines as clean as possible and already use logmein but this seems to have the same issue of automatically locking the remote machine. Any suggestions?

Thanks
0
Comment
Question by:kevin1983
11 Comments
 
LVL 19

Expert Comment

by:helpfinder
ID: 37737543
when you are leaving the remote connection, are you just clicking "x" to close the RDP window?
Because if you log into machine remotely and then log out (start>log off) the computer should not be locked.
If you click the "x" then yes, machine is just locked because your session is still active and this should be not a way how to end the remote work (but log off correctly)
0
 

Author Comment

by:kevin1983
ID: 37737566
Yes I click on the x to close the RDP window. The remote computer needs to remain logged in as the current user thats already logged in (always just the one user account used). If its logged out then the auto tasks will still fail to run.
Any way around this?
0
 
LVL 3

Expert Comment

by:IT-Shrek
ID: 37737567
Hello,

you can use group policy or local policy to allow the user to run the scripts without "unlocked" screen:

You can enable the interactive logon on your domain/ your stand alone
 machine by going to

 Local Security Policy-> Local policies -> User Rights Assignments-> Allow
 log on locally / Allow log on as a batch job

Shrek
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:kevin1983
ID: 37737600
Hi Shrek,

This sounds useful for small number of the auto tasks, but to clarify they are are not scripts.

As mentioned above most of the tasks are run by using mouse movements so the screen/desktop needs to be visible. Most of the tasks were created using automation anywhere by recording mouse movements / keyboard presseses on screen and these commands are re-played back so the tasks need to be able to see the desktop to run.
0
 

Author Comment

by:kevin1983
ID: 37737620
The automation anywhere software has an inbuilt auto login feature to unlock Windows XP but as Microsoft have stopped services execution on the same session due to elevated security privilege in Windows 7 this does not work with Windows 7.

The auto login feature is simply not availabe, and using the software on a windows XP machine is not an option.
0
 
LVL 1

Expert Comment

by:Tomascat
ID: 37741376
You can create a batch file or execute the following command:

tscon.exe 0 /dest:console


It will disconnect the RDP and connect automatically on target device with last logon details used.
0
 

Author Comment

by:kevin1983
ID: 37741456
Ok, I just tired that in a command prompt on the remote computer and I got the following message:

could not connect sessionID 0 to sessionname console, error code 5 error [5]:Access is denied.

Any ideas how to get around this?
I tried running the command prompt as an administrator but got the same message. The user logged in has local admin group rights.
0
 
LVL 1

Accepted Solution

by:
Tomascat earned 500 total points
ID: 37741512
It depend of number of sessions on target computer.

try this:

tscon.exe 1 /dest:console

it means session the computer have only 1 session

for session 2

tscon.exe 2 /dest:console

and so on.
0
 

Author Comment

by:kevin1983
ID: 37741534
ok, tscon.exe 2 /dest:console seems to of worked fine thanks.

Typically i'm the only one that connects to the computer so not sure why it says session2? or is this windows automatically creating this session ID?
Is it possible to automatically find the correct session number or will it likely always be 2 now?
0
 

Author Comment

by:kevin1983
ID: 37741603
ah think i've found a way: the below seems to work:

tscon.exe %sessionname% /dest:console

(source here: http://arstechnica.com/civis/viewtopic.php?f=15&t=69113 )
0
 

Author Closing Comment

by:kevin1983
ID: 37741622
Thanks, I've put the command into a batch file and saved to the remote computers desktop so I can double click on the file when I need to close the RDP session.

I guess a possible option could be to schedule this to run sometimes on the remote pc just in case to clear any remote sessions.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Move windows 10 users 8 72
Need To Expand VMware Disk Size 50 82
Can a default browser by set on Windows 7 9 48
Windows Updates 14 35
In this article, I'll explain how to setup a Plex Media Server (https://plex.tv/) on a Redhat (Centos) 7 based NAS with screenshots to help those looking for assistance.  What is Plex? If you aren't familiar with Plex, it’s a DLNA media serv…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question