TERMINAL SERVER LOGIN TIMES

G

Guest

Somebody has told me that there is a way to set up login times on a terminal
server, so for example you could say between 8-9 and it resets any
connections that may be logged in after that time.

Does anybody know how to do this? or if it can be done?
 
V

Vera Noest [MVP]

You can enforce logon hours in each user account, but those will
affect also the logon hours on users workstations. If that is not
what you want, you could use this approach:

Schedule a batchfile to run at 08:00.
Include these commands in the batch file:

REM disable new logons
change logon /disable
REM warn users
msg * /TIME:60 System is closing for maintenance, log off now!!
REM reset all sessions
for /F "tokens=2" %%A in ('qwinsta ^| find /i "listen"') do echo y
| rwinsta %%A

Schedule a batchfile to run at 09:00, which includes:

REM enable new logons
change logon /enable

Note that by resetting sessions, users will loose unsaved data!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top