Create Users via API

Hallo,

I’m now back fighting with RouterOS.

I have upgraded my test box (RB750GL) to firmware v5.14 I’m running 100 % standard:

  1. WAN
    1 DHCP server
  2. HOTSPOT server
  3. USER-MAN

When I add users through "http://router_ip:8080/userman every things works nicely users are added and I can give each user a profile with time limits.

3 users perfect:
[admin@MikroTik] > /tool user-manager user print
Flags: X - disabled, A - active, I - incomplete
0 customer=admin name=“ged” actual-profile=“1 time” password=“ged”
shared-users=1 wireless-psk=“” wireless-enc-key=“”
wireless-enc-algo=none uptime-used=1m28s download-used=793673
upload-used=90934 last-seen=jan/02/1970 00:32:55

1 customer=admin name=“gris” actual-profile=“1 time” password=“gris”
shared-users=1 wireless-psk=“” wireless-enc-key=“”
wireless-enc-algo=none uptime-used=12m52s download-used=5272817
upload-used=799134 last-seen=jan/02/1970 00:46:35

2 customer=admin name=“flyver” actual-profile=“6timer” password=“flyver”
shared-users=1 wireless-psk=“” wireless-enc-key=“”
wireless-enc-algo=none uptime-used=7m1s download-used=1853791
upload-used=222722 last-seen=jan/02/1970 00:53:48 active-sessions=1

However, how do I do the same through terminal/API and create a valid user?

It seems to me that I can’t set actual-profile=“” when use the terminal/API When I want to use the function:
/tool user-manager user add

I only get the following options:
caller-id first-name random-password wireless-enc-key
caller-id-bind-on-first-use ip-address reg-key wireless-psk
comment last-name registration-date customer
copy-from location shared-users name
disabled password username
email phone wireless-enc-algo

/tool user-manger user add name=newuser password=newpassword customer=admin This dosnt work.
When I look in the User-man webmanager the user is also not on the list and the “actual-profile” is not there.

How do create a fully user through TERMINAL/API?

Best Regards.

Thomas Hasen

  • a new RouterOs user *

You have given a very detailed description of the problem, I see, but I still don’t completely understand it… I guess, that’s just because I’m stupid, I am only a beginner who needs help just as well. Hope you get the answer, I’ll keep watching the thread so that I can at least learn from the others’ replies if any…

I use the following:

“/tool user-manager user add customer=admin disabled=no name=xxx password=yyy shared-users=3 phone=12345; /tool user-manager user create-and-activate-profil customer=admin profile=DailyPlan user=xxx”

I hope it helps

RGDS
Jörgen

Thanks! this was really helpful, though made slight adjustment to second line for it to work

/tool user-manager user create-and-activate-profil customer=admin profile=DailyPlan xxx