How-To Set Logon Hours and Control User Logon Time in Windows XP

Jun 2, 2009

Have you ever wondered How-To restrict unauthorized members to access you PC/network or have you been using costly software to restrict your children from logging to ur PC at odd times??..... If the answer is yes, then here is a solution for you that lets you set Logon hours to your PC so that you can set limits on the times a certain user account is able to logon to the computer. This tweak work for all PC's running on Windows XP.

This can be done in DOS with the use of simple yet wonderful command
"net user"

Let me give you a brief intro about NET USER command.
NET USER is a command used in the command console to create and modify user accounts on computers.

To do this you should have Admin. privileges.

Now, let us know How-To modify a user account by setting Logon Hours.


1)Goto Start-->Run... type cmd or command to get command prompt.

2)If you want the user account for the computer to be listed

type net user without command-line switches and press enter (see below image.Click to enlarge)



Let us know about user accounts listed..

Administrator and Guest are Built-in accounts used for administering and guest access to the computer/domain respectively.

Help Assistant is the Account For Providing Remote Assistance.

SUPPORT_xxxxxx is the vendor's account for the Help and Support Service.

By default you will be having all the above user account.

Besides these, you can create other user accounts with your desired user names as you would do.

VUSR_RAMARAOBOBBY which can be seen in the image above is the
Account for the Visual Studio Analyzer server components.
As I would do Visual Basic programming i got that account listed as well.


3) Now let's learn how-to set logon hours for a user account (say guest) taking an example.
If you wanna do it for other accounts type that user name in place of guest in commands below..

at the command prompt when you type as below

net user Guest /time:M-Su,8am-10am

you made the Guest account to logon only between 8am-10am daily.(coz we have give interval as M-Su)

day codes as follows
Monday -M
Tuesday -T
Wednesday-W
Thursday-Th
Friday - F
Saturday- Sa
Sunday -Su

(as DOS is not case sensitive you can use small or capital letters)

Hours can be mentioned 12-hour or 24-hour notation. For 12-hour notation,use am, pm.
While representing time in 24-hour notation use as 08:00 - 10:00

Note::
only sharp values are accepted for time & Separate day and time entries with a comma

4) To set logon hours at different times for the same day use ; as separator

and To set logon hours at different times for different days use : as separator


for example if you want to set logon hours between 8am-10am and 2pm-5pm daily
then type the command as follows

net user /time:M-Su,8am-10am;M-Su,2pm-5pm

likewise if its for different days use : in place of ;


Note:: When you have given the command correctly then a message saying The Command Completed Successfully will appear after press enter.

and After setting logon hours when you try to logon outside the time interval given , it asks for a password and wont allow you to logon even though you type the correct password. (as in image below, click to enlarge)




5) To disable this feature and make user log on always type as below

net user /time:all


6) To restrict the user to never logon use blank in place of all..

net user /time:

As i have said earlier The command completed successfully message comes when you typed the command correctly (as shown)




Try this on your PC.. n post comments...

Note:: The command can restrict user from logging in but cannot initiate a log off when account is in opened state.

And plz don't misuse this trick.


 
 
 
free counters 
HTML Hit Counter