Код: Выделить всё
Import-Module MikrotikPowerShell.dll
$mikroHost = Read-Host 'Host (access IP address)'
$username = Read-Host 'Username'
$password = Read-Host 'Password'
$address = Read-Host 'Address'
Get-Mikrotik -Host "$mikroHost" -Username "$username" -Password "$password" -Command "/ip/dhcp-server/lease/print" -Query @{"address"="$address"} | Get-Mikrotik -Command "/ip/hotspot/ip-binding/add" -Parameters @{"mac-address"={$_.'mac-address'};"type"="bypassed"}