JSI Tip 0439 - Configuring Logon Hours from the command line.
March 5, 1998
You can use the NET USER command:
net user jennifer /time:M-F,08:00-17:00 /Domain
would allow Jeniffer to logon to the server between 08:00 and 17:00 on weekdays.
The format of the /times parameter is:
/times:{times | all}
Specifies the times the user is allowed to use the computer. The times value is expressed as
day[-day][,day[-day]] ,time[-time][,time[-time]]
It is limited to 1-hour time increments. Days can be spelled out or abbreviated (M,T,W,Th,F,Sa,Su). Hours can be 12- or 24-hour notation. For 12-hour notation, use AM, PM, or A.M., P.M. The value all means a user can always log on. A null value (blank) means a user can never log on. Separate day and time with commas, and units of day and time with semicolons (for example, M,4AM-5PM;T,1PM-3PM). Do not use spaces when designating /times.
/domain
Performs the operation on the primary domain controller of the computer's primary domain. This parameter applies only to Windows NT Workstation computers that are members of a Windows NT Server domain. By default, Windows NT Server computers perform operations on the primary domain controller.
About the Author
You May Also Like