script for disconnect a local user in router in special time

hi

i want to have a script that can disconnect all of users that the username is in router ( local ) in a special time, only 1 time in 24 hours.

does it possbile?

or if it is possible i want to have an script that can disable and enable a network interface of router one time in 24 hour .

thanks

See this post:
http://forum.mikrotik.com/t/how-to-remove-active-users-whose-names-begin-to-night/34882/1
Schedule the script to run at the time you want them disconnected (/system schedule). I did not write that script, so I have not verified that it works on more than one user with the same user name. Normally requires a FOREACH loop for multiple entries. :confused: If it doesn’t work on multiple user names, post here and I will try to correct it.

ADD: This should disable, then disconnect all users with the same user name “test”.

/ip hotspot user disable [/ip hotspot user find name=test]
:local dumplist [/ip hotspot active find user=test]
:foreach i in=$dumplist do={
    /ip hotspot active remove $i
}

This should enable the user “test” again

/ip hotspot user enable [/ip hotspot user find name=test]

from the first look it looks like it will disable/enable all users named “test”

Yes, sir! That is exactly what it does. If you don’t do that, they will log right back in! Just like my customers. If you disable the account, when you log them out, they can’t log in again until the other script enables the “test” account again. Pretty slick, huh?