Sign in with
Sign up | Sign in
Your question

screen saver for auto log off after a certain period of id..

Last response: in Windows XP
Share
March 8, 2005 4:55:40 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

Hi:

I want to automatically logoff a session when it has been idle for a
configurable time.

In several sources out there I've seen that the better way to do this is to
use a screen saver like "winexit", but I haven't been able to use it and to
work without the "Force application termination" option. The problem with
this option is that the system does not wait the application to terminate,
and I need that because the application must do some things before ending.

The configuration I've used is to configure a screen saver ("winexit.scr")
and screen saver activation time in Active Directory (Windows 2000 server)
in a "group policy"
b) Clients are Windows XP clients

I need a better solution to do this. Has anyone solved a problem like mine
(automatic logoff but waiting the applications to finish) ?

Thanks,
Juan Carlos
Anonymous
March 8, 2005 4:55:41 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

JC wrote:
> I want to automatically logoff a session when it has been idle for a
> configurable time.
>
> In several sources out there I've seen that the better way to do this
> is to use a screen saver like "winexit", but I haven't been able to
> use it and to work without the "Force application termination"
> option. The problem with this option is that the system does not wait
> the application to terminate, and I need that because the application
> must do some things before ending.
>
> The configuration I've used is to configure a screen saver
> ("winexit.scr") and screen saver activation time in Active Directory
> (Windows 2000 server) in a "group policy"
> b) Clients are Windows XP clients
>
> I need a better solution to do this. Has anyone solved a problem like
> mine (automatic logoff but waiting the applications to finish) ?

The problem is catch 22..

If you are waiting for the application to finish to log me off, what is to
stop me, the savvy user, from making sure my applications NEVER finish while
I am away?

--
<- Shenan ->
--
The information is provided "as is", it is suggested you research for
yourself before you take any advice - you are the one ultimately
responsible for your actions/problems/solutions. Know what you are
getting into before you jump in with both feet.
March 8, 2005 4:55:42 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

Well, I have an application that finishes in about half a second. I think
that waiting the application to finish for 10 seconds and then finishing it
is not bad for me. Is there a way to do something like this?
Also, I will be using this configuration for a system that has this
requirements (auto log-off) and other applications are not important.

Juan Carlos.


"Shenan Stanley" <newshelper@gmail.com> escribió en el mensaje
news:o kEH5B$IFHA.2640@TK2MSFTNGP09.phx.gbl...
> JC wrote:
> > I want to automatically logoff a session when it has been idle for a
> > configurable time.
> >
> > In several sources out there I've seen that the better way to do this
> > is to use a screen saver like "winexit", but I haven't been able to
> > use it and to work without the "Force application termination"
> > option. The problem with this option is that the system does not wait
> > the application to terminate, and I need that because the application
> > must do some things before ending.
> >
> > The configuration I've used is to configure a screen saver
> > ("winexit.scr") and screen saver activation time in Active Directory
> > (Windows 2000 server) in a "group policy"
> > b) Clients are Windows XP clients
> >
> > I need a better solution to do this. Has anyone solved a problem like
> > mine (automatic logoff but waiting the applications to finish) ?
>
> The problem is catch 22..
>
> If you are waiting for the application to finish to log me off, what is to
> stop me, the savvy user, from making sure my applications NEVER finish
while
> I am away?
>
> --
> <- Shenan ->
> --
> The information is provided "as is", it is suggested you research for
> yourself before you take any advice - you are the one ultimately
> responsible for your actions/problems/solutions. Know what you are
> getting into before you jump in with both feet.
>
>
Related resources
Can't find your answer ? Ask !
Anonymous
March 8, 2005 8:32:34 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

JC wrote:

> I want to automatically logoff a session when it has been idle for a
> configurable time.
>
> In several sources out there I've seen that the better way to do this is to
> use a screen saver like "winexit", but I haven't been able to use it and to
> work without the "Force application termination" option. The problem with
> this option is that the system does not wait the application to terminate,
> and I need that because the application must do some things before ending.
>
> The configuration I've used is to configure a screen saver ("winexit.scr")
> and screen saver activation time in Active Directory (Windows 2000 server)
> in a "group policy"
> b) Clients are Windows XP clients
>
> I need a better solution to do this. Has anyone solved a problem like mine
> (automatic logoff but waiting the applications to finish) ?
Hi

You could create an scheduled task that starts at user logon and is
configured to kick in at a set idle time. Let the scheduled task
launch a script that handles the closing of the app and then logs the
user off.

If you want to use WinXP's shutdown.exe utility, and the user to be
logged off is not the same as the one that is defined in the task,
you might need to enable the remote shutdown privilege for the task
user even if you are going to only operate on the local computer.
If the task user is a member of the local Administrators group, I
think the privilege is already in place.

Take a look here for how to add remote shutdown privilege:
http://groups.google.co.uk/groups?threadm=uq2jIcw2EHA.1...

Anyway, Psshutdown.exe in SysInternals's free PSTools suite does not
suffer under this limitation and is the tool I recommend to use in
this case.

http://www.sysinternals.com

Alternatively, to avoid any 3rd party tool, you can use a VBScript
instead (I don't think it have the same issue as shutdown.exe, but I
am not 100% sure):
http://groups.google.co.uk/groups?selm=uq2jIcw2EHA.1564...


For the application closing part:

The free command line utility Cmdow.exe is an option, using the /CLS
or /END switch.

http://www.commandline.co.uk/cmdow/index.html

More about this here:
http://groups.google.co.uk/groups?threadm=cace82a5.0410...

Another option is to use use AutoIt/AutoItX and e.g. it's
WinClose function.

Here is an example on WinClose:
http://groups.google.co.uk/groups?selm=3DA05988.9BD87F8...

AutoIt/AutoItX is free and can be found here:
http://www.hiddensoft.com/autoit3/index.php

AutoItX is an ActiveX control version of AutoIt and can be used from a
vbscript.

Note:
AutoIt(X) window handling defaults to match the start of a window title that
you specify, use "SetTitleMatchMode 2" to specify ANY substring of the window
title you want to match. Also, the Windows titles and text are case sensitive.




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
March 8, 2005 8:32:35 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

Ok, thanks for your answer.

I've seen some of the tools you mention, but I didn't understand how to
"catch" the event "the PC has been idle for X time" on a client. How would I
do that? Who would start the process/task to log off the user?

Thanks,
Juan Carlos


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> escribió en el
mensaje news:e26JD0$IFHA.3356@TK2MSFTNGP12.phx.gbl...
> JC wrote:
>
> > I want to automatically logoff a session when it has been idle for a
> > configurable time.
> >
> > In several sources out there I've seen that the better way to do this is
to
> > use a screen saver like "winexit", but I haven't been able to use it and
to
> > work without the "Force application termination" option. The problem
with
> > this option is that the system does not wait the application to
terminate,
> > and I need that because the application must do some things before
ending.
> >
> > The configuration I've used is to configure a screen saver
("winexit.scr")
> > and screen saver activation time in Active Directory (Windows 2000
server)
> > in a "group policy"
> > b) Clients are Windows XP clients
> >
> > I need a better solution to do this. Has anyone solved a problem like
mine
> > (automatic logoff but waiting the applications to finish) ?
> Hi
>
> You could create an scheduled task that starts at user logon and is
> configured to kick in at a set idle time. Let the scheduled task
> launch a script that handles the closing of the app and then logs the
> user off.
>
> If you want to use WinXP's shutdown.exe utility, and the user to be
> logged off is not the same as the one that is defined in the task,
> you might need to enable the remote shutdown privilege for the task
> user even if you are going to only operate on the local computer.
> If the task user is a member of the local Administrators group, I
> think the privilege is already in place.
>
> Take a look here for how to add remote shutdown privilege:
>
http://groups.google.co.uk/groups?threadm=uq2jIcw2EHA.1...
x.gbl
>
> Anyway, Psshutdown.exe in SysInternals's free PSTools suite does not
> suffer under this limitation and is the tool I recommend to use in
> this case.
>
> http://www.sysinternals.com
>
> Alternatively, to avoid any 3rd party tool, you can use a VBScript
> instead (I don't think it have the same issue as shutdown.exe, but I
> am not 100% sure):
>
http://groups.google.co.uk/groups?selm=uq2jIcw2EHA.1564...
bl
>
>
> For the application closing part:
>
> The free command line utility Cmdow.exe is an option, using the /CLS
> or /END switch.
>
> http://www.commandline.co.uk/cmdow/index.html
>
> More about this here:
>
http://groups.google.co.uk/groups?threadm=cace82a5.0410...
ting.google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26c2coff%3D1%26selm%3D
cace82a5.0410130525.43a7fe48%2540posting.google.com
>
> Another option is to use use AutoIt/AutoItX and e.g. it's
> WinClose function.
>
> Here is an example on WinClose:
> http://groups.google.co.uk/groups?selm=3DA05988.9BD87F8...
>
> AutoIt/AutoItX is free and can be found here:
> http://www.hiddensoft.com/autoit3/index.php
>
> AutoItX is an ActiveX control version of AutoIt and can be used from a
> vbscript.
>
> Note:
> AutoIt(X) window handling defaults to match the start of a window title
that
> you specify, use "SetTitleMatchMode 2" to specify ANY substring of the
window
> title you want to match. Also, the Windows titles and text are case
sensitive.
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
March 8, 2005 11:40:44 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

JC wrote:

> Ok, thanks for your answer.
>
> I've seen some of the tools you mention, but I didn't understand
> how to "catch" the event "the PC has been idle for X time" on a
> client. How would I do that?

Create a scheduled task, and then under the Schedule tab select
"When idle" in the drop down menu, and select the number of
minutes you want.

You may need to go to the settings tab as well, and enable the
"Only start this task if the computer has been idle for at least".

In the "If the computer has not been idle that long, retry for
up to:" select 0 minutes.


Alternatively, create the task using SCHTASKS.exe, like this (one
line that will wrap over two lines in this post):

SCHTASKS.exe /Create /RU "%COMPUTERNAME%\Administrator" /RP xxx
/SC ONIDLE /I 30 /TN "IdleLogoff" /TR "C:\myshutdown.bat"

Run the command in a command prompt (cmd.exe) so you see any
messages from SCHTASKS.

You will need to replace xxx with the password for the user
specified after /RU, or use * to be asked for the password.

Using the command above, the task will be configured to kick
in when the computer have been idle for 30 minutes, and it will
then start the batch file C:\myshutdown.bat


> Who would start the process/task to log off the user?

Your script (that is started by the scheduled task).


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
March 9, 2005 6:09:15 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

Thanks a lot. I could solve it with your help.
I used "Cmdow" with the "/CLS" and "/END" options, and "psshutdown" with the
"-o" option, and a task that executes the script when idle.

Juan Carlos


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> escribió en el
mensaje news:eZ9$7cBJFHA.1528@TK2MSFTNGP09.phx.gbl...
> JC wrote:
>
> > Ok, thanks for your answer.
> >
> > I've seen some of the tools you mention, but I didn't understand
> > how to "catch" the event "the PC has been idle for X time" on a
> > client. How would I do that?
>
> Create a scheduled task, and then under the Schedule tab select
> "When idle" in the drop down menu, and select the number of
> minutes you want.
>
> You may need to go to the settings tab as well, and enable the
> "Only start this task if the computer has been idle for at least".
>
> In the "If the computer has not been idle that long, retry for
> up to:" select 0 minutes.
>
>
> Alternatively, create the task using SCHTASKS.exe, like this (one
> line that will wrap over two lines in this post):
>
> SCHTASKS.exe /Create /RU "%COMPUTERNAME%\Administrator" /RP xxx
> /SC ONIDLE /I 30 /TN "IdleLogoff" /TR "C:\myshutdown.bat"
>
> Run the command in a command prompt (cmd.exe) so you see any
> messages from SCHTASKS.
>
> You will need to replace xxx with the password for the user
> specified after /RU, or use * to be asked for the password.
>
> Using the command above, the task will be configured to kick
> in when the computer have been idle for 30 minutes, and it will
> then start the batch file C:\myshutdown.bat
>
>
> > Who would start the process/task to log off the user?
>
> Your script (that is started by the scheduled task).
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.m...
Anonymous
March 9, 2005 9:16:55 PM

Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

JC wrote:

> Thanks a lot. I could solve it with your help.

Great :-)


> I used "Cmdow" with the "/CLS" and "/END" options,

"/CLS" and "/END" is more an OR than AND (you should use only
one of them) if I am not mistaken.

> and "psshutdown" with the "-o" option, and a task that
> executes the script when idle.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.m...
!