Page 1 of 1

Restart Reinitialize Reset Renew Refresh a User's Profile

Posted: Fri Feb 07, 2014 8:31 pm
by corkuck
How do I restart (Reinstate, Reinitialize, Reset, Renew, Reactivate, Refresh) a User to their previous profile? And not loses all the logs, sessions, status that have been collected with the user?

I have been working on a profile issue for over 2 weeks. I have seen many examples, but none using only User Manger. Others too are working on this I'm sure. Lets see if others know how to do this? I'm saying "UNCLE" and it's hard for me to admit defeat.

In short, I would like to know how to just reinstate the same user's assigned profile again for that same user, after a 24Hr period has elapsed and not loses anything.

I just wish to restart or reinstate, the existing old profile that was assigned to that user originally.

The removal, expiration or limit reached of an assigned users profile is removed after that profile's "Download, Data, Quota, Limit" or "What Ever" has been reached. So it stops or restricts that user as it should.

So how do I just reinstate that same profile back to that users profile after the 24Hrs and not lose anything else?

So far I have only been able to do something like this every 24Hrs:

1. Go to Winbox
2. Go to system/scripts and add a script call it test or something.
3. Here is mine:

/tool user-manager user remove [find name="test"]

/tool user-manager user add customer=admin name="test"

/tool user-manager user create-and-activate-profile customer="admin" profile="test2Mb4Min" numbers="test"

Obviously you will have to change your profile= and your numbers= above to what ever you have in your XXX.XXX.XXX.XXX/userman

4. Then go to system/scheduler
5. Add a schedule called test
6. At start time change to 00:00:00:01
7. At Interval change it to 1d 00:00:00
8. In on event put in test
9. Apply it

This is not in production because It's not feasible for 200 users to be removed, then added back in daily. Plus there are others disadvantages, like when the user goes to XXX.XXX.XXX.XXX/user and their old sessions are all missing because they had been deleted and added back in, thus the log histories are gone also.

I have also just tried /tool user-manager user create-and-activate-profile customer="admin" profile="test2Mb4Min" numbers="test" with out deleting the user.

But this just adds a new profile/s to that user, and they pile up on each other and still can't be used because the logs show the user has surpassed their 2Mb Quota.

If you have a "Download, Mb, Quota, Limit" in like this built in a profile below

Transfer: 2.0 MiB

once the user reaches this 2Mb quota it just removes that e.g 2Mb profile from that user e.g test. You can also actually see this by going to your not in userman. It will not show up because it's been removed due to the profile's limit was reached.

So after 2Mb has been used up and you try this: /tool user-manager user create-and-activate-profile customer="admin" profile="test2Mb4Min" numbers="test" it only adds this profile to that user yet again. But because the 2Mb quota limit has been reached and it's made record of it you still can't us this new profile ether.

The user e.g "test" can't access this newly given 2Mb even if you try to change the NEW "paused" profile found in under Profile. Because the 2Mb been used and is still on the records as used.

You can't just reset the counters ether e.g /tool user-manager user reset-counters [find name="test"]. Why because it still will not reset the users profile records showing that the 2Mb has been used.

I'm looking for a way to reactivate the old user assigned profile every 24Hrs and not lose everything else for 200 users.

Waiting for someones reply if you would please. Any help is good. It's not like me to ask.

If I'm missing something let me know.

Thank you for any help you can offer. I see other doing this all with out User Manger. But I like the simplicity of the User Manger GUI interface for me and others. But I'm ok with a script to work with User Manger as a mix to make it all work at this point.

Please HELP...

Good luck and "Happy MikroTik-ing"

MikroTikOS x86 ver 6.9


Re: Restart Reinitialize Reset Renew Refresh a User's Profile

Posted: Sat Dec 30, 2017 9:17 pm
by mgreant
Same issue here and I haven't found a solution yet.

When a user reaches its limit, he seems to lose his profile and limitations in the usermanager overview.
However, when I try to connect with that user, I get an error message telling me that the user has reached its limits. So that works fine.

However when I print the vouchers, using %u_limitdownload% as a constant, then it shows that the user has unlimited data... just because he 'loses' his profile after he reached his limit.

This seems to be a bug again Mikrotik... how can we solve this?