Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automatically unlock remote computers screen after a RDP session?

Posted on 2012-03-19
11
Medium Priority
?
11,375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

704 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