how to add profile and user in mikrotk by tik4net?

886 Views Asked by At

I already tried this

     var cmd = connection.CreateCommandAndParameters("/tool/user-manager/user/add", "customer", "kamrul",
                "username", "test007", "password", "12345678");
            cmd.ExecuteNonQuery();

but giving this error:

    no such command or directory (user-manager)
1

There are 1 best solutions below

0
On

hi I don't know about the tiknet but in mikrotik terminal you can add user using this command

 /user add name=username password=strongpassword group=master disabled=no

I guess you can use it in your code like

var cmd = connection.CreateCommandAndParameters("/user/add", "name", "username","password", "strongpassword", "group", "master","disabled","no");

hope this helps