Monthly Archives: May 2020

MikroTik LtAP – switch SIM card every X hours

If you have MikroTik LtAP with two SIM cards you can make simple scheduled task that changes currently active card with other:

Script looks like this:

:global simSlot ([/system routerboard modem print as-value]);
:if ($simSlot=”sim-slot=down”) do={:system routerboard modem set sim-slot=up; :log error message=”SIM UP active!”} else={:system routerboard modem set sim-slot=down; :log warning message=”SIM DOWN active!”}

Example (for testing purposes I have reduced time to 3 minutes but it works also with 24 hours …):
up down


Mass/bulk TimeToLive update Windows server DNS (primary zones)

TJust in case someone needs to bulk/mass update (for example) TimeToLive parameter on all A (CNAME, MX, TXT…) records in all primary zones on Windows Server 2016/2019 DNS server …

$allzones = Get-DnsServerZone | Where-Object -Property ZoneType -EQ -Value “Primary”
foreach ($allzone in $allzones) {
$olds = Get-DnsServerResourceRecord -ZoneName $allzone.ZoneName -Name “@” -RRType A
foreach ($old in $olds) {
#$old = “”
#$new = “”
$new = $old.Clone()
$new.TimeToLive = [System.TimeSpan]::FromMinutes(1)
Set-DnsServerResourceRecord -OldInputObject $old -NewInputObject $new -ZoneName $allzone.ZoneName -PassThru