Click here to get back home

How to force User log off when time expires?

 HomeNewsGroups | Search | About
 microsoft.public.windows.server.security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How to force User log off when time expires? shocker 07-20-2007
Posted by Rob (Microsoft) on July 21, 2007, 7:40 am
Please log in for more thread options
You can set up a scheduled task to restart the machine using Shutdown.exe

"shocker" wrote:

> Can this accomplish with scripting? I not very familiar with Windows
> scripting, but I'm just curious to know if what I want to do is possible on a
> local machine.
>
> "Roger Abell [MVP]" wrote:
>
> > > So, specifyig logon hours with net user /time is not applicable?
> > >
> > net user /time
> > controls when an account can log on, it does not kick logged on
> > account out
> >
> > > The user is now restricted from logging on based on the times set in net
> > > user, but they are never logged off if they account is already logged on
> > > when
> > > the time expires.
> > >
> > The time set in the network security policy you mentioned only
> > controls network access and will close off sessions to network
> > shares based on the logoff time; it has nothing to do with local
> > login sessions.
> >
> >
> > > "Rob (Microsoft)" wrote:
> > >
> > >> Not without being able to specify logon hours in the account. I believe
> > >> that
> > >> feature is only in the domain profile.
> > >>
> > >> "shocker" wrote:
> > >>
> > >> > I want to force a user to log off when his logon hours expire.
> > >> > In the Network Security category (under Group Policy), I enabled the
> > >> > Force
> > >> > Logoff When Logon Hours Expire policy, but users are never logged off.
> > >> >
> > >> > I running Windows Server 2003 as a standalone (no domain or AD). the
> > >> > server
> > >> > is just a rubust workstation, but allow remote users to log in
> > >> > simultaneously.
> > >> >
> > >> > Is it possible to log users off in this case?
> >
> >
> >

Posted by shocker on July 21, 2007, 8:06 am
Please log in for more thread options
Shutting down the computer isn't an option, but thanks for all the responses.

"Rob (Microsoft)" wrote:

> You can set up a scheduled task to restart the machine using Shutdown.exe
>
> "shocker" wrote:
>
> > Can this accomplish with scripting? I not very familiar with Windows
> > scripting, but I'm just curious to know if what I want to do is possible on
a
> > local machine.
> >
> > "Roger Abell [MVP]" wrote:
> >
> > > > So, specifyig logon hours with net user /time is not applicable?
> > > >
> > > net user /time
> > > controls when an account can log on, it does not kick logged on
> > > account out
> > >
> > > > The user is now restricted from logging on based on the times set in net
> > > > user, but they are never logged off if they account is already logged on
> > > > when
> > > > the time expires.
> > > >
> > > The time set in the network security policy you mentioned only
> > > controls network access and will close off sessions to network
> > > shares based on the logoff time; it has nothing to do with local
> > > login sessions.
> > >
> > >
> > > > "Rob (Microsoft)" wrote:
> > > >
> > > >> Not without being able to specify logon hours in the account. I
believe
> > > >> that
> > > >> feature is only in the domain profile.
> > > >>
> > > >> "shocker" wrote:
> > > >>
> > > >> > I want to force a user to log off when his logon hours expire.
> > > >> > In the Network Security category (under Group Policy), I enabled the
> > > >> > Force
> > > >> > Logoff When Logon Hours Expire policy, but users are never logged off.
> > > >> >
> > > >> > I running Windows Server 2003 as a standalone (no domain or AD). the
> > > >> > server
> > > >> > is just a rubust workstation, but allow remote users to log in
> > > >> > simultaneously.
> > > >> >
> > > >> > Is it possible to log users off in this case?
> > >
> > >
> > >

Posted by Rob (Microsoft) on July 21, 2007, 8:58 am
Please log in for more thread options
Shutdown.exe can be used to reboot a box not just shutdown. So if you have a
time set for all users not to logon because of backup schedules or whatever,
a Shutdown command with a R switch will reboot the system.

"shocker" wrote:

> Shutting down the computer isn't an option, but thanks for all the responses.
>
> "Rob (Microsoft)" wrote:
>
> > You can set up a scheduled task to restart the machine using Shutdown.exe
> >
> > "shocker" wrote:
> >
> > > Can this accomplish with scripting? I not very familiar with Windows
> > > scripting, but I'm just curious to know if what I want to do is possible
on a
> > > local machine.
> > >
> > > "Roger Abell [MVP]" wrote:
> > >
> > > > > So, specifyig logon hours with net user /time is not applicable?
> > > > >
> > > > net user /time
> > > > controls when an account can log on, it does not kick logged on
> > > > account out
> > > >
> > > > > The user is now restricted from logging on based on the times set in
net
> > > > > user, but they are never logged off if they account is already logged
on
> > > > > when
> > > > > the time expires.
> > > > >
> > > > The time set in the network security policy you mentioned only
> > > > controls network access and will close off sessions to network
> > > > shares based on the logoff time; it has nothing to do with local
> > > > login sessions.
> > > >
> > > >
> > > > > "Rob (Microsoft)" wrote:
> > > > >
> > > > >> Not without being able to specify logon hours in the account. I
believe
> > > > >> that
> > > > >> feature is only in the domain profile.
> > > > >>
> > > > >> "shocker" wrote:
> > > > >>
> > > > >> > I want to force a user to log off when his logon hours expire.
> > > > >> > In the Network Security category (under Group Policy), I enabled
the
> > > > >> > Force
> > > > >> > Logoff When Logon Hours Expire policy, but users are never logged
off.
> > > > >> >
> > > > >> > I running Windows Server 2003 as a standalone (no domain or AD).
the
> > > > >> > server
> > > > >> > is just a rubust workstation, but allow remote users to log in
> > > > >> > simultaneously.
> > > > >> >
> > > > >> > Is it possible to log users off in this case?
> > > >
> > > >
> > > >

Posted by shocker on July 21, 2007, 10:36 pm
Please log in for more thread options
Thanks again Rob. It's just that rebooting the machine is not what I want.
There are only specific users 2 of 5 that need to be forced to logoff if
their time expires. The other users may be active or simply have tasks
running that rebooting will kill.

I guess this is just a limitation of Windows Server 2003 standalone.

"Rob (Microsoft)" wrote:

> Shutdown.exe can be used to reboot a box not just shutdown. So if you have a
> time set for all users not to logon because of backup schedules or whatever,
> a Shutdown command with a R switch will reboot the system.
>
> "shocker" wrote:
>
> > Shutting down the computer isn't an option, but thanks for all the responses.
> >
> > "Rob (Microsoft)" wrote:
> >
> > > You can set up a scheduled task to restart the machine using Shutdown.exe
> > >
> > > "shocker" wrote:
> > >
> > > > Can this accomplish with scripting? I not very familiar with Windows
> > > > scripting, but I'm just curious to know if what I want to do is possible
on a
> > > > local machine.
> > > >
> > > > "Roger Abell [MVP]" wrote:
> > > >
> > > > > > So, specifyig logon hours with net user /time is not applicable?
> > > > > >
> > > > > net user /time
> > > > > controls when an account can log on, it does not kick logged on
> > > > > account out
> > > > >
> > > > > > The user is now restricted from logging on based on the times set in
net
> > > > > > user, but they are never logged off if they account is already
logged on
> > > > > > when
> > > > > > the time expires.
> > > > > >
> > > > > The time set in the network security policy you mentioned only
> > > > > controls network access and will close off sessions to network
> > > > > shares based on the logoff time; it has nothing to do with local
> > > > > login sessions.
> > > > >
> > > > >
> > > > > > "Rob (Microsoft)" wrote:
> > > > > >
> > > > > >> Not without being able to specify logon hours in the account. I
believe
> > > > > >> that
> > > > > >> feature is only in the domain profile.
> > > > > >>
> > > > > >> "shocker" wrote:
> > > > > >>
> > > > > >> > I want to force a user to log off when his logon hours expire.
> > > > > >> > In the Network Security category (under Group Policy), I enabled
the
> > > > > >> > Force
> > > > > >> > Logoff When Logon Hours Expire policy, but users are never logged
off.
> > > > > >> >
> > > > > >> > I running Windows Server 2003 as a standalone (no domain or AD).
the
> > > > > >> > server
> > > > > >> > is just a rubust workstation, but allow remote users to log in
> > > > > >> > simultaneously.
> > > > > >> >
> > > > > >> > Is it possible to log users off in this case?
> > > > >
> > > > >
> > > > >

Posted by Rob (Microsoft) on July 21, 2007, 10:54 pm
Please log in for more thread options
Sorry I couldn't be of more assistance. I'll check with some folks when I
get back in the office on Tuesday to see if there is a script that you can
run to force logoff the user.

"shocker" wrote:

> Thanks again Rob. It's just that rebooting the machine is not what I want.
> There are only specific users 2 of 5 that need to be forced to logoff if
> their time expires. The other users may be active or simply have tasks
> running that rebooting will kill.
>
> I guess this is just a limitation of Windows Server 2003 standalone.
>
> "Rob (Microsoft)" wrote:
>
> > Shutdown.exe can be used to reboot a box not just shutdown. So if you have
a
> > time set for all users not to logon because of backup schedules or whatever,
> > a Shutdown command with a R switch will reboot the system.
> >
> > "shocker" wrote:
> >
> > > Shutting down the computer isn't an option, but thanks for all the
responses.
> > >
> > > "Rob (Microsoft)" wrote:
> > >
> > > > You can set up a scheduled task to restart the machine using Shutdown.exe
> > > >
> > > > "shocker" wrote:
> > > >
> > > > > Can this accomplish with scripting? I not very familiar with Windows
> > > > > scripting, but I'm just curious to know if what I want to do is
possible on a
> > > > > local machine.
> > > > >
> > > > > "Roger Abell [MVP]" wrote:
> > > > >
> > > > > > > So, specifyig logon hours with net user /time is not applicable?
> > > > > > >
> > > > > > net user /time
> > > > > > controls when an account can log on, it does not kick logged on
> > > > > > account out
> > > > > >
> > > > > > > The user is now restricted from logging on based on the times set
in net
> > > > > > > user, but they are never logged off if they account is already
logged on
> > > > > > > when
> > > > > > > the time expires.
> > > > > > >
> > > > > > The time set in the network security policy you mentioned only
> > > > > > controls network access and will close off sessions to network
> > > > > > shares based on the logoff time; it has nothing to do with local
> > > > > > login sessions.
> > > > > >
> > > > > >
> > > > > > > "Rob (Microsoft)" wrote:
> > > > > > >
> > > > > > >> Not without being able to specify logon hours in the account. I
believe
> > > > > > >> that
> > > > > > >> feature is only in the domain profile.
> > > > > > >>
> > > > > > >> "shocker" wrote:
> > > > > > >>
> > > > > > >> > I want to force a user to log off when his logon hours expire.
> > > > > > >> > In the Network Security category (under Group Policy), I
enabled the
> > > > > > >> > Force
> > > > > > >> > Logoff When Logon Hours Expire policy, but users are never
logged off.
> > > > > > >> >
> > > > > > >> > I running Windows Server 2003 as a standalone (no domain or
AD). the
> > > > > > >> > server
> > > > > > >> > is just a rubust workstation, but allow remote users to log in
> > > > > > >> > simultaneously.
> > > > > > >> >
> > > > > > >> > Is it possible to log users off in this case?
> > > > > >
> > > > > >
> > > > > >

Similar ThreadsPosted
User notification before certificate expires May 30, 2006, 4:19 pm
user logon time tracking November 3, 2006, 1:08 am
HELP Needed: Win2k3 - How to restrict Internet access after log on expires. June 23, 2006, 10:24 am
Built-in Administrator acct. for Domain be password never expires? October 2, 2006, 3:01 pm
Force Lockout Session October 21, 2007, 10:11 am
gpupdate /force killed my DC October 31, 2007, 7:03 pm
Use of Kerberos unreliable, can I force it? July 17, 2008, 4:23 am
"Force shutdown from a remote system" October 13, 2006, 3:26 pm
NTP Time September 11, 2006, 1:48 pm
Force desktop icons using Group Policy? December 22, 2005, 12:56 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap