Page 1 of 1

Add profile to user via Console/API/Script

Posted: Tue May 17, 2011 11:18 am
by beepee
Please I need to change/add profile to users in userman (over 5000users)
I know it is best to do this using scripting or API but I dont see any console menu to perform this.
Any way forward
OR
Should I downgrade to v4.17?

Re: Add profile to user via Console/API/Script

Posted: Tue May 17, 2011 12:31 pm
by siprox
now you're in trouble, calm down, we are have the same problems :D

Re: Add profile to user via Console/API/Script

Posted: Tue May 17, 2011 12:37 pm
by normis
are you using v5.2?
*) user manager - added /tool usermanager profile;

Re: Add profile to user via Console/API/Script

Posted: Tue May 17, 2011 1:23 pm
by beepee
are you using v5.2?
*) user manager - added /tool usermanager profile;
Yes profile menu is available, but how do U assign any of the profile to users in console?
i.e
in menu /tool usermanager user, there should be a menu or option to select a profile for the specified user.

Re: Add profile to user via Console/API/Script

Posted: Tue May 17, 2011 1:39 pm
by normis
yes, we will add that feature later

Re: Add profile to user via Console/API/Script

Posted: Tue May 17, 2011 3:03 pm
by beepee
yes, we will add that feature later
But for now, I guess we can downgrade to v4x where such is available
Right.

Re: Add profile to user via Console/API/Script

Posted: Wed May 18, 2011 12:59 am
by siprox
yes, we will add that feature later
But for now, I guess we can downgrade to v4x where such is available
Right.
i think version 5.2 still can't use for real production, at least till mature. They heavy developing nv2, etc but maybe forgot usermanager.

Re: Add profile to user via Console/API/Script

Posted: Tue May 31, 2011 3:45 pm
by fabiosara
yes, we will add that feature later
But for now, I guess we can downgrade to v4x where such is available
Right.
Hello all,
I have the same problem.
Are there any news?
Is there a way to assign profiles to user via web?
Eg http://www.yourradius.com/userman/mwt/x ... =myprofile

Or is there a way to query directly to usermanager database?

Thanks a lot

Fabio

Re: Add profile to user via Console/API/Script

Posted: Mon Jun 06, 2011 6:39 pm
by fabiosara
I found a workaround to assign a profile to a user:

I created a profile like this (2 hours per day)
/tool user-manager profile
add name=2hperday name-for-users=2hperday override-shared-users=unlimited price=0 starts-at=logon validity=0s
/tool user-manager profile limitation
add address-list="" download-limit=0B group-name="" ip-pool="" name=Limit2h transfer-limit=0B upload-limit=0B uptime-limit=2h
/tool user-manager profile profile-limitation
add from-time=0s limitation=Limit2h profile=2hperday till-time=23h59m59s weekdays=sunday,monday,tuesday,friday,saturday

Then I created a user "master"
add customer=admin disabled=no name=user2h password="aseGD73??!jksghrf" shared-users=unlimited wireless-enc-algo=none wireless-enc-key="" wireless-psk=""
and via webmanager, I assigned the profile I want (in this case, "2hperday")


Now, I create the user via script / shell / api using this command
add customer=admin username=USERTEST password=PASSWORDTEST location=test phone=01123456798 email=test@test.com first-name=USER last-name=TEST name=test copy-from=user2h
The key is the copy-from= parameter

So, we can create a "master user" for each profile, and create many users as we want using "copy-from" and give the "master user".

I hope this could be useful until developers fix this bug.


I know it is not optimal solution, because the "total time left" is not diplayed in user manager, but the user statics are correct.

Re: Add profile to user via Console/API/Script

Posted: Tue Jun 07, 2011 7:12 pm
by vdelarenal75
It works!!!! Thank you for sharing this, it really helped.
I found a workaround to assign a profile to a user:

I created a profile like this (2 hours per day)
/tool user-manager profile
add name=2hperday name-for-users=2hperday override-shared-users=unlimited price=0 starts-at=logon validity=0s
/tool user-manager profile limitation
add address-list="" download-limit=0B group-name="" ip-pool="" name=Limit2h transfer-limit=0B upload-limit=0B uptime-limit=2h
/tool user-manager profile profile-limitation
add from-time=0s limitation=Limit2h profile=2hperday till-time=23h59m59s weekdays=sunday,monday,tuesday,friday,saturday

Then I created a user "master"
add customer=admin disabled=no name=user2h password="aseGD73??!jksghrf" shared-users=unlimited wireless-enc-algo=none wireless-enc-key="" wireless-psk=""
and via webmanager, I assigned the profile I want (in this case, "2hperday")


Now, I create the user via script / shell / api using this command
add customer=admin username=USERTEST password=PASSWORDTEST location=test phone=01123456798 email=test@test.com first-name=USER last-name=TEST name=test copy-from=user2h
The key is the copy-from= parameter

So, we can create a "master user" for each profile, and create many users as we want using "copy-from" and give the "master user".

I hope this could be useful until developers fix this bug.


I know it is not optimal solution, because the "total time left" is not diplayed in user manager, but the user statics are correct.

Re: Add profile to user via Console/API/Script

Posted: Mon Oct 31, 2011 2:44 pm
by pljubas
yes, we will add that feature later
Hi Normis,

I've upgraded my userman router from 4.17 to 5.7.
There are 1.400 users with different profiles.

In ROS 5.7 there is still no way to set profile to user from console. Or, I'm I wrong?

It is nearly impossible to set profile to 1.400 users from web...

Any help available?

Best regards,

Petar

Re: Add profile to user via Console/API/Script

Posted: Mon Oct 31, 2011 11:56 pm
by neandero
This issue is now becoming very urgent with each user increase on the network.

Please admins, push developers for sooner feature addition and release.. :D

Re: Add profile to user via Console/API/Script

Posted: Tue Nov 01, 2011 12:10 am
by neandero
Oh yeah, I forgot something...

while you do add this feature, if POSSIBLE, add another feature where UM can auto switch profile for a user based on download used per day.

example:
user1 basic profile is profile2 2M/2M
if user1 download so much per day say 5G to 10G
UM should auto switch user1 profile from profile2 to profile1 1M/1M
UM should reset user1 profile back to profile2 at Midnight each day.

something like this.. a little way to control who's download so much and who's not - and who should get more speed over the other.

Re: Add profile to user via Console/API/Script

Posted: Thu Nov 03, 2011 6:15 am
by tgrand
Before they do any changes, they must first clean things up.
The User-Manager still continues to use 2 databases.

Try clearing stats in web, and you will notice the stats in the console continue to accumulate without having been cleared.

Lots and Lots of clean-up to do.
As well User-Manager development would appear to be of LOW priority.

Re: Add profile to user via Console/API/Script

Posted: Fri Nov 04, 2011 3:18 pm
by Percanta
i was thinking what it uses 2 database too, as the search of sessions in webUM is good but in API-CLI is very poor performance

Re: Add profile to user via Console/API/Script

Posted: Tue Mar 27, 2012 6:35 pm
by jdevora
Any news about this issue?

Cheers
JD

Re: Add profile to user via Console/API/Script

Posted: Fri Mar 30, 2012 12:29 am
by aysan
I was so happy with UM 4.17. But now I cannot work with UM 5.x because of bugs.

I am using UM php & cli, I solve some problems on v.5.x but still more... For example, if I assing an user to 1 hour profile, UM should throw out after 1 hour but user still continuous to use internet.

Another problem is credit-left. I cannot find with cli users credit-left as v.4.17 on v.5.x.

The biggest problem is, I can use 4.17 with no problem but new routerboards doesn't support ROS 4.x. I cannot use ROS 5.x beacuse of new UM so I cannot use new model routerboards. I bought RB1100AH and I have so many RB1200, RB750GL etc. doesn't support ROS 4.x.

I don't understand why new model boards are does not support ROS v4.x and Mikrotik doesn't solve UM v5.x bugs.

Re: Add profile to user via Console/API/Script

Posted: Tue May 21, 2013 9:54 am
by athome
Thank you MTIK developers for this:
/tool user-manager user> create-and-activate-profile user="UUUU" customer="CCCC" profile="PPPP"

Re: Add profile to user via Console/API/Script

Posted: Wed May 22, 2013 5:35 pm
by ojeysky
Thank you MTIK developers for this:

/tool user-manager user> create-and-activate-profile user="UUUU" customer="CCCC" profile="PPPP"
This will only be applicable to already existing user. So i guess the problem still exist. Something like below is required:
/tool user-manager user add username=test password=test customer=test name=sample profile=double

Re: Add profile to user via Console/API/Script

Posted: Wed May 22, 2013 5:37 pm
by ojeysky
Best Workaround so far! Thanks!
I found a workaround to assign a profile to a user:

I created a profile like this (2 hours per day)
/tool user-manager profile
add name=2hperday name-for-users=2hperday override-shared-users=unlimited price=0 starts-at=logon validity=0s
/tool user-manager profile limitation
add address-list="" download-limit=0B group-name="" ip-pool="" name=Limit2h transfer-limit=0B upload-limit=0B uptime-limit=2h
/tool user-manager profile profile-limitation
add from-time=0s limitation=Limit2h profile=2hperday till-time=23h59m59s weekdays=sunday,monday,tuesday,friday,saturday

Then I created a user "master"
add customer=admin disabled=no name=user2h password="aseGD73??!jksghrf" shared-users=unlimited wireless-enc-algo=none wireless-enc-key="" wireless-psk=""
and via webmanager, I assigned the profile I want (in this case, "2hperday")


Now, I create the user via script / shell / api using this command
add customer=admin username=USERTEST password=PASSWORDTEST location=test phone=01123456798 email=test@test.com first-name=USER last-name=TEST name=test copy-from=user2h
The key is the copy-from= parameter
So, we can create a "master user" for each profile, and create many users as we want using "copy-from" and give the "master user".

I hope this could be useful until developers fix this bug.


I know it is not optimal solution, because the "total time left" is not diplayed in user manager, but the user statics are correct.

Re: Add profile to user via Console/API/Script

Posted: Mon May 05, 2014 9:17 pm
by mousa1983
Version 6.12 and This problem is still not resolved

Re: Add profile to user via Console/API/Script

Posted: Mon Oct 06, 2014 1:12 am
by rore
still no solution since Version 4.xx and since 2 years for that?

Re: Add profile to user via Console/API/Script

Posted: Wed Jul 13, 2016 1:28 pm
by nothing
Few years later you still can't add user-manager profiles from CLI...
Geez...

Re: Add profile to user via Console/API/Script

Posted: Fri Jan 13, 2017 3:28 pm
by alisss54
you can do it easily using this code
/tool user-manager user add customer=ali  username=uuuuu password=test  ;/tool user-manager user create-and-activate-profile customer=ali profile=ppppp "uuuuu"

Re: Add profile to user via Console/API/Script

Posted: Fri Dec 08, 2017 3:16 pm
by ADahi
via Script/CLI
suppose username is "111"
suppose profile is TRIAL

To remove user profiles try this
/tool user-manager user clear-profiles numbers=[find username="111"]; 


To add profile to user try this
/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=[find username="111"]; 


Best Regards

Re: Add profile to user via Console/API/Script

Posted: Sun Apr 08, 2018 7:01 pm
by Abdulrahman
Thank you very much. This command works well on the CLI:

/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=[find username="111"];

But unfortunately, it doesn't work when using the api to send the command, because "find" is not supported through the api.

So please, what is the alternatives that work through the api.

Thanks in advance

Re: Add profile to user via Console/API/Script

Posted: Mon Apr 09, 2018 2:20 pm
by ADahi
you can get sequence number of the user
/tool user-manager user print                                        
Flags: X - disabled, A - active, I - incomplete 
 0     customer=admin username="111" password="" shared-users=1 wireless-psk="" wireless-enc-key="" wireless-enc-algo=none last-seen=never

and use it like:
/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=0; 

Great! it works, thanks millions

Posted: Mon Apr 09, 2018 5:37 pm
by Abdulrahman
Great! it works, thanks millions
you can get sequence number of the user
/tool user-manager user print                                        
Flags: X - disabled, A - active, I - incomplete 
 0     customer=admin username="111" password="" shared-users=1 wireless-psk="" wireless-enc-key="" wireless-enc-algo=none last-seen=never

and use it like:
/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=0; 

Re: Great! it works, thanks millions

Posted: Mon Apr 09, 2018 11:24 pm
by ADahi
Great! it works, thanks millions
you can get sequence number of the user
/tool user-manager user print                                        
Flags: X - disabled, A - active, I - incomplete 
 0     customer=admin username="111" password="" shared-users=1 wireless-psk="" wireless-enc-key="" wireless-enc-algo=none last-seen=never

and use it like:
/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=0; 
millions welcome :wink:

Re: Add profile to user via Console/API/Script

Posted: Thu May 17, 2018 12:29 am
by paramex
Thank you very much. This command works well on the CLI:

/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=[find username="111"];

But unfortunately, it doesn't work when using the api to send the command, because "find" is not supported through the api.

So please, what is the alternatives that work through the api.

Thanks in advance
use this char "?"
/tool user-manager user create-and-activate-profile profile=TRIAL customer=admin ?numbers="111"