MSTerminalServices.org Forums

Forums Home | FAQ | Search | Profile | Private Messages | Log in/Register/Password

how to automate user logoff

Page 1 of 1
Next:  Citrix: Need to print to an HP 6127 inkjet  
Author Message
al

External


Since: Sep 25, 2004
Posts: 6



(Msg. 1) Posted: Wed Apr 15, 2009 4:47 pm
Post subject: how to automate user logoff
Archived from groups: alt>os>citrix (more info?)

Hi All,
I would like to automatically reboot my Citrix servers for example every
Friday night.
My problem is that most of my users are still logged in to the server and if
I automate the server's reboot, it will corrupt our database that the users
have left opened.
Are there any utilities that I can use to also automate user's logoff like
probably one hour before I automate my Citrix server reboot?
Thanks,
Al
Back to top
Send e-mail Login to vote
StruikRover

External


Since: Apr 16, 2009
Posts: 1



(Msg. 2) Posted: Thu Apr 16, 2009 1:09 am
Post subject: Re: how to automate user logoff [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Apr 16, 1:47 am, "al" <al....TakeThisOut@somplace.com> wrote:
> Hi All,
> I would like to automatically reboot my Citrix servers for example every
> Friday night.
> My problem is that most of my users are still logged in to the server and if
> I automate the server's reboot, it will corrupt our database that the users
> have left opened.
> Are there any utilities that I can use to also automate user's logoff like
> probably one hour before I automate my Citrix server reboot?
> Thanks,
> Al
Try this in a script. I use it when a system is going down. But
otherwise - Citrix can do it self with a schedule. Depending on what
Citrix version you have.

:: Logoff any Disconected sessions
Echo. >> %SystemRoot%\Scripts\log\shutdown.log
Echo Logoff The following Disconected sessions >> %SystemRoot%
\Scripts\log\shutdown.log
qwinsta | find "Disc" > %SystemRoot%\Scripts\log\disc.lst
Type %SystemRoot%\Scripts\log\disc.lst >>
%SystemRoot%\Scripts\log\shutdown.log
for /f "tokens=2" %%i in (%SystemRoot%\Scripts\log\disc.lst) do logoff
%%i

:: Logoff any Active sessions
Echo. >> %SystemRoot%\Scripts\log\shutdown.log
Echo Logoff the following Active sessions >> %SystemRoot%
\Scripts\log\shutdown.log
qwinsta|find "Active" > %SystemRoot%\Scripts\log\active.lst
Type %SystemRoot%\Scripts\log\active.lst >>
%SystemRoot%\Scripts\log\shutdown.log
for /f "tokens=3" %%i in (%SystemRoot%\Scripts\log\active.lst) do
logoff %%i

:: Clear any hung ICA sessions by re-settting ica-tcp
Echo. >> %SystemRoot%\Scripts\log\shutdown.log
Echo clear any hung ICA sessions by re-settting ica-tcp >>
%SystemRoot%\Scripts\log\shutdown.log
echo y|reset session ica-tcp
Back to top
Send e-mail Login to vote
"Hank Arnold

External


Since: Jul 16, 2007
Posts: 167



(Msg. 3) Posted: Thu Apr 16, 2009 4:38 am
Post subject: Re: how to automate user logoff [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

StruikRover wrote:
> On Apr 16, 1:47 am, "al" <al....RemoveThis@somplace.com> wrote:
>> Hi All,
>> I would like to automatically reboot my Citrix servers for example every
>> Friday night.
>> My problem is that most of my users are still logged in to the server and if
>> I automate the server's reboot, it will corrupt our database that the users
>> have left opened.
>> Are there any utilities that I can use to also automate user's logoff like
>> probably one hour before I automate my Citrix server reboot?
>> Thanks,
>> Al
> Try this in a script. I use it when a system is going down. But
> otherwise - Citrix can do it self with a schedule. Depending on what
> Citrix version you have.
>
> :: Logoff any Disconected sessions
> Echo. >> %SystemRoot%\Scripts\log\shutdown.log
> Echo Logoff The following Disconected sessions >> %SystemRoot%
> \Scripts\log\shutdown.log
> qwinsta | find "Disc" > %SystemRoot%\Scripts\log\disc.lst
> Type %SystemRoot%\Scripts\log\disc.lst >>
> %SystemRoot%\Scripts\log\shutdown.log
> for /f "tokens=2" %%i in (%SystemRoot%\Scripts\log\disc.lst) do logoff
> %%i
>
> :: Logoff any Active sessions
> Echo. >> %SystemRoot%\Scripts\log\shutdown.log
> Echo Logoff the following Active sessions >> %SystemRoot%
> \Scripts\log\shutdown.log
> qwinsta|find "Active" > %SystemRoot%\Scripts\log\active.lst
> Type %SystemRoot%\Scripts\log\active.lst >>
> %SystemRoot%\Scripts\log\shutdown.log
> for /f "tokens=3" %%i in (%SystemRoot%\Scripts\log\active.lst) do
> logoff %%i
>
> :: Clear any hung ICA sessions by re-settting ica-tcp
> Echo. >> %SystemRoot%\Scripts\log\shutdown.log
> Echo clear any hung ICA sessions by re-settting ica-tcp >>
> %SystemRoot%\Scripts\log\shutdown.log
> echo y|reset session ica-tcp

I'm not sure that will do what he needs... Closing a session without
first doing a clean shutdown of the database application can, in certain
circumstances lead to database corruption. The user could lose a
significant amount of data depending on how the database is structured
and whether the user bothers to save often. The Hospice I support uses
an application called Allscripts Homecare. Nurses use it to generate an
assessment for each visit to a patient. This can take a long time,
depending on the visit and the nurse's computer skills. We have had
nurses spend an hour doing an assessment and lose it all when their
computer locks up.

It seemed to me that the OP needs a way to cleanly close the database
application with no response required by the user. We've found that
users will often ignore warnings and keep working to the bitter end. In
most cases, this is OK, they just lost their last xx minutes of work
(they learn quickly). However, with databases, it can be disaster...

--

Regards,
Hank Arnold
Microsoft MVP
Windows Server - Directory Services
http://mypcassistant.blogspot.com/
Back to top
Send e-mail Login to vote
Display posts from previous:   
    All times are: Eastern Time (US & Canada) (change) Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Looking for more Terminal Services info?

Sign up to the MSTerminalServices.org Monthly Newsletter, written by Terminal Server MVP & Citrix CTP Stefan Vermeulen, containing news, tips, interviews, links of the month and much more. Subscribe today and don't miss a thing!

Become an MSTerminalServices.org member!

Discuss your Terminal Services & Citrix issues with thousands of other SBC experts. Click here to join!

Community Area

Log in | Register