Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting valid time range for user logon 1

Status
Not open for further replies.

ILAaron

MIS
Aug 12, 2001
4
0
0
US
I have a situation where I need to restrict certain users logon rights to a set time range (8 AM - 5 PM, for example). Days of the week do not matter so much as time.

The Resourse Guide has an article on it, but does not explain how to go about it.

The W2K Prof machine in question is a stand alone with Internet access.

TIA for the help,

ILAaron
 
ILAaron

I don't think you can do this on a stand alone machine without AD (could be wrong though!).

It's simple using Active directory - just select properties
for the user then use "logon to" and "logon hours".

Had a look at local policies thought it might be in there but can't see anything.

Sorry....
 
In windows 2000, there is no way to set logon hours without the computer being a domain member. Here's the info direct from MS:

"You cannot use the Logon Hours feature with Windows 2000 Professional or Windows NT 4.0 in a workgroup.

The Logon Hours feature is a feature of a domain user account. To use this feature, your computer must be a member of a Windows 2000 or Windows NT domain. You can specify logon hours on the domain user object on a computer that is running Windows 2000 and on a domain user account on a computer that is running Windows NT. You cannot specify logon hours on a Windows 2000-based workstation, a Windows NT-based workstation, or in a Windows NT Server-based workgroup environment."

HOWEVER!
;)

You CAN do it from a command prompt - just not from a GUI..
Try this from a command prompt (I know this works for a workgroup, I haven't tried it on a standalone pc yet..)

net user <UserName> /times:M,8AM-5PM;T,8AM-5PM;W,8AM-5PM;Th,8AM-5PM;F,8AM-5PM


reply back if this works - im curious! :p
Please let Tek-Tips members know their posts were helpful. Thanks!

Pbxman
Systems Administrator
 
pbxman,

I have no problems with a CLI solution (must confess I miss DOS a little 8^).

This was a partial solution. I will prevent a user from logging in outside of the set time range, but will not log them off or shut down when the time range expires. At least with my test.

The NET command is pretty powerful and there may be something I haven't found yet. Will keep playing with it.

Thanks,

ILAaron
 
If you wish to force a logoff, you'll need to use the AT command to schedule a .bat or .vbs logoff script at desired times.

If it were me, there's a superb program from Aelita called Boot Admin. It will allow you to schedule one-time, daily, weekly, etc shutdowns & restarts of up to 5 computers. It's a demo version, and only supports 5 computers..perfect for most applications - including mine, and yours it seems.

This way, you can force a shutdown & restart at say, 5:02pm - and it will also allow you to leave a message saying &quot;This computer is being restarted in 60 seconds..please save any work and close any open applications..&quot; etc..

How's that sound for you?
If you need the program, email me at JT@nserv.net, and I can send it to you.

Cheers Please let Tek-Tips members know their posts were helpful. Thanks!

Pbxman
Systems Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top