Controller Based WLANs

How to add users to the Internal DB using a Windows Batch file ?

Aruba Employee

This article will have a focus on adding users to the Internal Database of the controller using a Windows Batch file.

 

There are occasions when we need to add multiple users to the internal database of the controller , but adding too many users manually would be little inconvenient , hence we can do it in a easier way by Assembling the user credentials into a text file and use a script file to add those credentials to the internal database of the controller.

 

rtaImage.png

 

So lets write a script which on executing will open a new PuTTY session to a certain IP Address and have it automatically enter your username for you and add the users to the internal database of the controller , the program that we use for this is  "plink"  which is the command line interface for Putty and can be used in scripts.

 

Environment : This article applies to Aruba Mobility Controllers running ArubaOS version 5.0.0.0 and above.

 

Copy the below commands on a notepad and save it as internaldb.bat

 

 

@ECHO OFF
C:\plink.exe <username>@<x.x.x.x> -pw <password> <com.txt
exit

 

 In order to automatically run commands without interaction, the commands you want to run need to be inserted into a text file "com.txt"

 

local-userdb add username <username1> password <password1>
local-userdb add username  
<username2> password <password2>
.
.
local-userdb add username 
<username50> password <password50>

 

Keep the internaldb.bat , com.txt and plink.exe on the same directory and execute the bat file

open up a command prompt, black screen comes up. Drag and drop your .bat file onto the window. If that doesnt work use cd (change directory) to go to where the file is and then press enter.

Sample :

@ECHO OFF
C:\plink.exe admin@10.30.156.14 -pw aruba123 <com.txt
exit

- Use ssh to connect
- Connect with the username admin
- The IP address of the device we are connecting is 10.30.156.14
- use the password aruba123
- run the commands contained in the file called com.txt that resides in the current directory.



Contents of com.txt file :

local-userdb add username testprog1 password testprog1
local-userdb add username testprog2 password testprog2
.
.
.
local-userdb add username testprog50 password testprog50

 

Version history
Revision #:
1 of 1
Last update:
‎07-16-2014 01:02 PM
Updated by:
 
Labels (1)
Contributors
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: 
Is this a frequent problem?

Request an official Aruba knowledge base article to be written by our experts.