Solved

Automatically unlock remote computers screen after a RDP session?

Posted on 2012-03-19
11
9,669 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:kevin1983
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 1

Expert Comment

by:Tomascat
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Hi Friends, These registry tweaks will help you optimizing your Windows 7 system for any VDI. This will improve the machine performanance and can be used on normal systems also. These are few registry tweaks which will add value by enhancing the …
Article by: Lee
Windows 7 Ultimate and Enterprise (and 2008 R2) introduced a new feature you may not be aware of - Boot from VHD.   Boot from VHD (or what Microsoft refers to asNative Boot allows you to install Windows to a VHD (Virtual Hard Disk) file that is t…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

744 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now