Community discussions

MUM Europe 2020
 
techman23
just joined
Topic Author
Posts: 23
Joined: Tue Jun 21, 2016 12:42 am

Print output for hotspot users

Sun May 13, 2018 12:42 pm

Hello everyone,

I have tried to searched for a certain script that can export hotspot users along with their passwords to a CSV file but could not find one, now what I am left with is to output the usernames and passwords through print command at the terminal so that i can copy and paste in excel sheet

How can this be done? as the command /ip hotspot user print only prints other columns excluding the password


Thanks in advance
 
2frogs
Long time Member
Long time Member
Posts: 540
Joined: Fri Dec 03, 2010 1:38 am

Re: Print output for hotspot users

Sun May 13, 2018 2:26 pm

/ip hotspot user print detail file=filename.txt
or
/ip hotspot user export file=filename.txt
Then you should be able to import the txt file into a spreadsheet or in the case of the export simply modify the script directly.
 
techman23
just joined
Topic Author
Posts: 23
Joined: Tue Jun 21, 2016 12:42 am

Re: Print output for hotspot users

Mon May 21, 2018 12:34 am

thanks for your solution, i have already tried this but unfortunately it prints all columns in a format which is very difficult to sort out, I want to get only username and password of users
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2411
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Print output for hotspot users

Sat May 26, 2018 12:09 pm

You can use "print as-value" to save the output into a variable, that you can then loop over, and output in whatever fashion you want.

f.e.
:local users [/ip hotspot user print as-value];
:foreach user in=users do={
    :put ($user->"username");
    :put ($user->"password");
    :put "";
};[code]
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)

Who is online

Users browsing this forum: No registered users and 14 guests