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/