Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Keeping A Citrix Session Alive?

5,777 views
Skip to first unread message

(PeteCresswell)

unread,
May 10, 2009, 9:49:51 PM5/10/09
to
I've got a production app that runs under Citrix.

Due to various problems, a two-hour batch job that the app runs
has tb initiated manually in the wee hours of the morning instead
of being run by a simple .CMD file that starts the Access app in
a "Overnight Batch" mode.

Problem is that the Citrix admins enforce a 40-or-so-minute
timeout on inactive sessions - and the session performing the
batch job in question looks inactive to Citrix.

So if I VPN/RemoteDesktop in, open up the Citrix-deployed app,
kick off the process and then just go back to sleep; the Citrix
timeout kicks in, the whole session gets flushed, and the batch
job never finishes what it has to do.

Consequently I have to wake up and hit "Enter" every 30 minutes
or so.

I was thinking that maybe I could write a little MS Access app tb
run on the same PC than I'm VPN/RemoteDesktopping into that would
just keep looping and send a MouseOver or a KeyDown or something
to the Citrix window in time to avoid the inactivity timeout and
I could go back to getting a decent night's sleep.

I know from SendKeys(), but don't have a clue on how to find that
Citrix sesh's window and push the keystroke or whatever into it.

Can anybody offer up a clue?
--
PeteCresswell

David W. Fenton

unread,
May 10, 2009, 10:11:00 PM5/10/09
to
"(PeteCresswell)" <x...@y.Invalid> wrote in
news:3gie05hkt2sg0vbat...@4ax.com:

> Problem is that the Citrix admins enforce a 40-or-so-minute
> timeout on inactive sessions - and the session performing the
> batch job in question looks inactive to Citrix.

Why not ask the Citrix admins to fix this setting for you, instead
of coming up with a dailywtf-style solution?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

(PeteCresswell)

unread,
May 12, 2009, 12:18:56 AM5/12/09
to
Per David W. Fenton:

>Why not ask the Citrix admins to fix this setting for you, instead
>of coming up with a dailywtf-style solution?

That was my first move. No hope there, hence the desire for a
workaround.
--
PeteCresswell

Tony Toews [MVP]

unread,
May 12, 2009, 1:32:17 AM5/12/09
to
"(PeteCresswell)" <x...@y.Invalid> wrote:

>Consequently I have to wake up and hit "Enter" every 30 minutes
>or so.

There was a hilarious DailyTWF.com posting on this topic. The manager brought in a
electrically operated baby's rocking chair and put the optical mouse in it. And they
let it run 24x7.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Granite Fleet Manager http://www.granitefleet.com/

David W. Fenton

unread,
May 12, 2009, 2:07:39 AM5/12/09
to
"(PeteCresswell)" <x...@y.Invalid> wrote in
news:q2gh051ppskbs5brn...@4ax.com:

Accelerate up the chain of command.

I would not begin to get up in the middle of the night to babysit
something like this for a client unless they paid me through the
nose for that. As long as you acquiesce to their expectation that
you should be getting up in the middle of the night to do something
that is fixable with a server configuration change, they will
continue to take advantage of you.

Don't let them -- it's the only way you can bring them into reality.

David W. Fenton

unread,
May 12, 2009, 2:08:49 AM5/12/09
to
"Tony Toews [MVP]" <tto...@telusplanet.net> wrote in
news:m9kh05lstagpmppng...@4ax.com:

> "(PeteCresswell)" <x...@y.Invalid> wrote:
>
>>Consequently I have to wake up and hit "Enter" every 30 minutes
>>or so.
>
> There was a hilarious DailyTWF.com posting on this topic. The
> manager brought in a electrically operated baby's rocking chair
> and put the optical mouse in it. And they let it run 24x7.

The frightening thing to me is the idea that if you presented
management with the choice of doing this right or buying a baby's
rocking chair for Pete to put his mouse on, I know *exactly* which
one management would choose.

Builder

unread,
May 12, 2009, 3:55:46 AM5/12/09
to
(PeteCresswell) wrote:
> I've got a production app that runs under Citrix.
>
> Due to various problems, a two-hour batch job that the app runs
> has tb initiated manually in the wee hours of the morning instead
> of being run by a simple .CMD file that starts the Access app in
> a "Overnight Batch" mode.
>
> Problem is that the Citrix admins enforce a 40-or-so-minute
> timeout on inactive sessions - and the session performing the
> batch job in question looks inactive to Citrix.
>
> So if I VPN/RemoteDesktop in, open up the Citrix-deployed app,
> kick off the process and then just go back to sleep; the Citrix
> timeout kicks in, the whole session gets flushed, and the batch
> job never finishes what it has to do.

Why does your batch job appear inactive to Citrix?

Can you edit it to write/update a file to the filesystem every N minutes?
Or open and close another Access app along with the batch job? The Access
app would open a form with a Timer and fire off a tiny routine every N
minutes - such as selecting data from an .mdb.

Wayne Gillespie

unread,
May 12, 2009, 3:24:50 AM5/12/09
to

Perhaps you could periodically halt the routine temporarily and do something
which would defer the timeout (write and delete a record to a temp table to
update the ldb?).

If [RecordNumber] Mod 100 = 0 Then
Do something to update ldb
DoEvents
Else
Continue with batch job
End if

Wayne Gillespie
Gosford NSW Australia

Tony Toews [MVP]

unread,
May 12, 2009, 6:28:53 AM5/12/09
to
"David W. Fenton" <XXXu...@dfenton.com.invalid> wrote:

>>>Consequently I have to wake up and hit "Enter" every 30 minutes
>>>or so.
>>
>> There was a hilarious DailyTWF.com posting on this topic. The
>> manager brought in a electrically operated baby's rocking chair
>> and put the optical mouse in it. And they let it run 24x7.
>
>The frightening thing to me is the idea that if you presented
>management with the choice of doing this right or buying a baby's
>rocking chair for Pete to put his mouse on, I know *exactly* which
>one management would choose.

Depends on management. If it's local or IT management then it'd be the rocking chair.
If it was the CEO then the right thing might happen.

Stories of Gestapo IT departments abound.

Tony Toews [MVP]

unread,
May 12, 2009, 6:29:56 AM5/12/09
to
Wayne Gillespie <bes...@NObestfitSPAMsoftwarePLEASE.com.au> wrote:

>Perhaps you could periodically halt the routine temporarily and do something
>which would defer the timeout (write and delete a record to a temp table to
>update the ldb?).

Trouble is this kind of Citrix/TS keep alive reuires a mouse movement or keyboard
movement. Updating a table isn't sufficient.

David W. Fenton

unread,
May 12, 2009, 7:07:57 PM5/12/09
to
"Builder" <nos...@buildit.com> wrote in
news:zq5Ol.40159$v8.2...@bignews5.bellsouth.net:

> Why does your batch job appear inactive to Citrix?
>
> Can you edit it to write/update a file to the filesystem every N
> minutes? Or open and close another Access app along with the batch
> job? The Access app would open a form with a Timer and fire off a
> tiny routine every N minutes - such as selecting data from an
> .mdb.

I think it's the connection inactivity that is causing the session
to be dropped. Every Windows Terminal Server I've ever worked on
that had a timeout would close the RDP connection, but leave the WTS
session active (in the locked "terminal" mode). Closing both the
connection and the session after a timeout seems severely misguided
to me.

If the Citrix session supports access to the remote server, perhaps
you could run a VBScript that copies a file across the wire every 15
minutes or so. But that may not be allowed by the admins, either.

David W. Fenton

unread,
May 12, 2009, 7:09:06 PM5/12/09
to
"Tony Toews [MVP]" <tto...@telusplanet.net> wrote in
news:fp5i059sc6n35poj7...@4ax.com:

> Wayne Gillespie <bes...@NObestfitSPAMsoftwarePLEASE.com.au>
> wrote:
>
>>Perhaps you could periodically halt the routine temporarily and do
>>something which would defer the timeout (write and delete a record
>>to a temp table to update the ldb?).
>
> Trouble is this kind of Citrix/TS keep alive reuires a mouse
> movement or keyboard movement. Updating a table isn't sufficient.

The point is that the activity has to come from the client PC, not
from activity within the Citrix session.

I've never seen a Windows Terminal Server configured to log out the
session on inactivity, just close the RDP connection.

Samantha Turner

unread,
Nov 16, 2009, 7:27:05 PM11/16/09
to
I'm having a similar problem. Because of compliance rules developed
outside my company, we have implemented a 15 minute time out on the
citrix connections. In reality, the rule states that the user is
required to retype their password in order to regain access to the
application(s) they are running. That's really what I would like to
implement, but our IT staff hasn't found a way to do this yet so we have
the timeout which ends all applications to which they are connected.

What I would really like is.... If a user is connected to a database via
MS Access and Crystal Reports and a 3rd application and they walk away
to get coffee, when they come back to their desk 20 minutes later, I'd
like for them to just be able to type their password and have their
everything where it was when they walked away (similar to the Lock
Computer option on windows). If anyone knows of how to do this, I'd be
very grateful!

Thanks!

*** Sent via Developersdex http://www.developersdex.com ***

paii, Ron

unread,
Nov 16, 2009, 8:37:27 PM11/16/09
to

"Samantha Turner" <stu...@accessint.com> wrote in message
news:4b01a789$0$89394$815e...@news.qwest.net...

Can you have your IT group change it to Disconnect after 15 min and not
Reset. If they are doing a Reset on time-out, are you having any issues with
corruption?


Tony Toews [MVP]

unread,
Nov 17, 2009, 5:53:08 AM11/17/09
to
Samantha Turner <stu...@accessint.com> wrote:

>I'm having a similar problem. Because of compliance rules developed
>outside my company, we have implemented a 15 minute time out on the
>citrix connections. In reality, the rule states that the user is
>required to retype their password in order to regain access to the
>application(s) they are running. That's really what I would like to
>implement, but our IT staff hasn't found a way to do this yet so we have
>the timeout which ends all applications to which they are connected.

Your IT staff can't figure out how the users get back to their apps by rekeying their
password? Umm, that's default behavior unless Citrix changed things there. And
that's a very basic setting so if they can't figure it out either

1) they're lying
2) they're remarkably incompetent.

I administer my Terminal Server remotely. Indeed I've only seen it "in the flesh" so
to speak a few times in the past five or six years. I TS/RDP in, work away and close
the session. Days later I can open up the session and everthing is right where I
left it.

>What I would really like is.... If a user is connected to a database via
>MS Access and Crystal Reports and a 3rd application and they walk away
>to get coffee, when they come back to their desk 20 minutes later, I'd
>like for them to just be able to type their password and have their
>everything where it was when they walked away (similar to the Lock
>Computer option on windows). If anyone knows of how to do this, I'd be
>very grateful!

You can't do this from Access. This is a Citrix/Terminal server setting.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

For a free, convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Tony Toews [MVP]

unread,
Nov 17, 2009, 5:55:35 AM11/17/09
to
"paii, Ron" <no...@no.com> wrote:

>If they are doing a Reset on time-out, are you having any issues with
>corruption?

Shuttong down a TS/Citrix session is very unlikely to cause corruptions.

1) after fifteen minutes any batch processing is likely to have finished.

2) I would think that TS/Citrix would send a program shutdown message to the apps
running inside the session which would then gracefully end. Now what might not
happen is your last updates which you haven't completed on the form might not make it
to the data storage.

Samantha Turner

unread,
Nov 17, 2009, 11:33:05 AM11/17/09
to
Thanks for the responses!

I should have mentioned that before we had things set up this way, the
timeout was set up differently and the citrix window with the app icons
would timeout but, when the users came back to their workstations, they
still had access to work in the applications they had already opened.
This conflicts with the rules that we are required to comply with.

I also should have explained about the Access and Crystal better, I
guess. Those are applications that the users have published to them
once they login to Citrix. So, if the user opens these applications,
i.e. connected to a database, and they walk away from their machine for
15 minutes, I need them to have to enter their password in order to
continue working in these applications. I'm even okay with them having
to log back into Citrix and then have the applications right where they
left off, but I can't have the open applications available to them once
the idle timeout has been reached.

Tony, if you can relay to me how I would go about setting this up, I
would be grateful!

Thanks!
Sam

James Avenant

unread,
Jul 27, 2010, 7:32:10 AM7/27/10
to
Hi,

All and all you need to write client code to manipulate the window on
your behalf.

So first, from an Access macro, you need to get a handle to the window
that you are interested in. You may need to import the correct Win32
API to do this. Use a sniffer like Visual Studio's Spy tool to get the
Window name or handle class.

Once you have an actual window handle (hWnd pointer which will change
for every execution) you can use this to send all kinds of Windows
events, including fake mouse movements.

You would need to find a way to do this from a separate thread than
your batch job, otherwise you may simply have a lot of movement after
your job is finished.

Also, in certain scenarios, Office (Access) may be running in a
background mode and not interact with Windows' UI layer. This is why
Office Automation (from Office as well as out of Office) is and always
has been a bit of a black art (VSTO is solving this somewhat).

So all-and-all it can be done, but you are actually facing a problem
domain that has it's own set of problems. You can read up on "automated
UI testing" since these guys do similar things (how to automate mouse
and keystrokes while running batch processes).

Getting the administrator to extend the timeout may strech your
political skills, but is still easier than writing a script that works
predictably :-)

Good luck.
JamesA

fredjm...@gmail.com

unread,
Jul 6, 2018, 10:58:29 PM7/6/18
to
I have a similar issue that I solved using AutoIT scripting tool
the access timer event runs every minute (Because the default time out setting for Citrix is 180 Seconds) and shells out to the AutoIT Script which does a mouse click on the citrix window. Slightly more elegant than the mouse in the rocking chair idea. AutoIT is free to download here https://www.autoitscript.com/site/autoit/downloads/ Good Luck.
Message has been deleted

Luuk

unread,
Jul 11, 2018, 8:21:04 PM7/11/18
to
On 11-7-2018 21:48, jag...@yahoo.com wrote:
> Why not give a useful answer instead of this worthless snarky reply?
>

The only usefull answer to the question (from 2009) asked is:
'kill the admin!'

(Or explain properly to the admin what your problem is ... )




claire...@gmail.com

unread,
Sep 12, 2018, 2:18:28 PM9/12/18
to
IF you download a program like this, can your company see you have it running in the background? I don't want my company knowing I downloaded something to make my mouse move but I don't want to have to log in every time I walk away because I'm told they log it to make sure we're actually working when we're working at home!
0 new messages