Choose time intervals when users can login

Mar 15, 2007 17:31 GMT  ·  By

One of my friends complained that his child spends way too much time on his computer. He was very worried for his kid's health. He tried to talk with the child but you know how stubborn they are. It was almost impossible to convince a six-year-old kid that spending too many hours in front of the computer can have a bad influence upon his health condition. I am a person who sustains children should learn how to use computers but I am against excessive use.

Regarding my friend's problem, I advised him to try software applications that restrict access to computer for a defined time interval. He was reticent about this idea asking me if there was a costless solution. He didn't want to use software trying to avoid his child getting suspicious. He just wanted a trick to restrict access in Windows without additional software and at no cost.

I immediately thought that the net user command would be perfect for this issue. Many people are still wondering how come commands are still useful in Windows. You will see one of the benefits of using a command.

What is a "net user" command?

Net user is a command which is used in the command console to do various user account related operations:

- add a new user account - modify a user account - display user account information

Syntax:

To add a new account type: net user "account name" /ADD * (do not use the quotes). The asterisk is to prompt you to provide the password for the account.

Using "net user" solitary, with no parameters, you will get the list with all the users on the computer. To delete an account, just use the syntax with /DELETE parameter:

net user TEST /Delete

How to configure logon hours for a user

Now that you are familiarized with the command, it's time to learn how to add parameters in order to limit logon access for a time interval.

Let's suppose the account for which we want to define the time interval access already exists. The command will look like this:

net user "user account" /time:M-F,14:00-16:00

Replace the text between the quotes with the desired account. Using the above command line, the user has rights to access its account between 14 and 17 every day from Monday to Friday. In case your son/daughter comes home from school around two o'clock he/she will be able to logon until 16 o'clock (when you come back from work).

Please notice that only sharp values are accepted. You can choose any hour but not subdivisions like 14:15 or 15:36.

You can even setup time intervals for different days as following:

net user softpedia /time:W,10am-5pm;T,2pm-3pm;F-Sa,9:00-16:00

One more thing, the week days' abbreviations are M, T, W, Th, F, Sa, Su.

It is your choice how you schedule the computer usage time.

Have fun!