Scripts to remove customers who have with H in Flags of hots

Good afternoon.

I wonder if any of friends can help me. I need to do a search on the Mikrotik Hotspot by the flags. For example / ip hotspot host removes [/ ip hotspot host find Flags: H]. Does anyone know if this possible? Behold, I give it my print command reported the following message [admin@MikroTik] ip hotspot host> print
Flags: S - static, H - DHCP, D - dynamic, A - authorized, P - bypassed

MAC-ADDRESS ADDRESS TO-ADDRESS SERVER IDLE-TIMEOUT

0 SP 00:0C:42:16:E7:41 192.168.75.1 192.168.75.1 hotspot1
1 SP 00:1B:78:2D:D5:A9 192.168.74.2 192.168.74.2 hotspot1
2 SP 00:15:AF:9D:3A:41 192.168.75.159 192.168.75.159 hotspot1
3 SP 00:0E:2E:4A:A4:D9 192.168.75.156 192.168.75.156 hotspot1
4 DA 00:E0:4C:34:EF:78 192.168.74.5 192.168.74.5 hotspot1
5 SP 00:15:AF:56:D0:E2 192.168.75.183 192.168.75.183 hotspot1
6 DA 00:1B:38:51:0D:E6 192.168.74.11 192.168.74.11 hotspot1
7 HA 00:0E:2E:50:BC:D3 192.168.75.153 192.168.75.153 hotspot1
8 DA 00:1A:4D:98:75:A9 192.168.74.3 192.168.74.3 hotspot1
9 DA 00:19:21:81:13:98 192.168.74.6 192.168.74.6 hotspot1
10 DA 00:1A:4D:AE:57:88 192.168.74.8 192.168.74.8 hotspot1
11 DA 00:15:C5:B1:84:E1 192.168.74.7 192.168.74.7 hotspot1
12 H 00:E0:4D:08:51:86 192.168.75.164 192.168.75.164 hotspot1
13 H 00:16:EC:82:23:84 192.168.75.245 192.168.75.245 hotspot1


I would rodasse minutes minutes in a script that removes all macs are with the FLAGS H.

Best regards,

Gilberto Andrade

I believe you want something like this

/ip hotspot host remove [/ip hotspot host find DHCP]

yes …

More so he vai remove all the flags which are AH and H. I would remove only those customers with flags H, because here use hostspot with authentication by mac, and often the customers get stuck asking user and password, ah I need to do the process manually to kill all macs that are only in it for H they begin using the Internet. I want to automate this process, creating a script that automatically kill him only the macs with H flags in the hosts and not those who are already connected with AH.


Best regards,

Gilberto Andrade

Try this then

/ip hotspot host remove [/ip hotspot host find DHCP !STATIC !DYNAMIC !AUTHORIZED !BYPASSED]

I returned the following message of error.

[admin@MikroTik] > /ip hotspot host remove [/ip hotspot host find DHCP !STATIC !DYNAMIC !AUTHORIZED !BYPASSED]
no such argument (!DYNAMIC)

Try with just the DCHP and !AUTHORIZED arguments.

I returned the following message of error.

[admin@MikroTik] > /ip hotspot host remove [/ip hotspot host find DHCP !AUTHORIZED]
invalid value of DHCP, must be either yes or no


then tried

[admin@MikroTik] > /ip hotspot host remove [/ip hotspot host find DHCP=yes !AUTHORIZED]
no such argument (!AUTHORIZED)

Which version are you using. I am on v3.9

use the two versions 2.9.51 shows that this error and the version 3.10 that does not present any error, no more nothing happens too.

Try something like this for v2

/ip hotspot host remove [/ip hotspot host find DHCP=yes authorized=no]

Now working perfect. I am grateful for the help

you must use this
/ip hotspot host remove [find dynamic !authorized !bypassed]

…and in a few seconds, it will be back.