Solved

Automatically unlock remote computers screen after a RDP session?

Posted on 2012-03-19
11
10,565 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
SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

 

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
remote desktop drops connection 8 59
Need Remote Registry Editor 3 50
HP ENVY 7645 printer 5 33
Screen saver problem 6 29
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…
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 give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

739 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