Automatically unlock remote computers screen after a RDP session?

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
kevin1983Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

helpfinderIT ConsultantCommented:
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
kevin1983Author Commented:
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
IT-ShrekCommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

kevin1983Author Commented:
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
kevin1983Author Commented:
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
TomascatCommented:
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
kevin1983Author Commented:
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
TomascatCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kevin1983Author Commented:
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
kevin1983Author Commented:
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
kevin1983Author Commented:
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
Jennifa AfrinCommented:
Hello There,

Great info! I recently came across your blog and have been reading along.
I thought I would leave my first comment. I don’t know what to say except that I have
Going from round to  corner is much easier than corner  to round, because you don't have to consider the effects (i.e. errors) caused by a very large radius.  For a closed shape, which a plane should be, the resulting number of vertices will equal the number of straight line segments, which is easy to determine from a Geometry XYR PointsArray.  
All you need to do is compute the 'point of intersection' for each sequential pair of line segments.  The internet has plenty of websites with formulas for doing that.  Given that the plane shape is controlled by Mentor, you should not have to deal with the special case involving intersection of sequential parallel segments.
Anyways great write up, your efforts are much appreciated.

Best Regards,
Juille
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Remote Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.