this should be fairly simple. do you intend to run this as a job from bladelogic or from a shell directly?
what arguments do you need to pass to useradd? do you have a sample commandline for user add?
i would first create a script that takes your variables as inputs and passes them to useradd and get that working. then to 'nsh-ize' it you would need to simply wrap that in a nexec call and you could add this as a type 1 nsh script.
Bill, Thank for your reply on this. I intend to run this directly through app server and not through the shell.
command for user add is below
useradd -g <Group> -d <Path of Home Directory> -m -s <Shell> -c " Comments" Userid
I am looking forward to pass the Group, Path of home directory, shell, comments, and userid from the csv stored on app server.
I tried through text file by passing just one variable and though it read the variable, but wont execute using while do loop and nexec, it says command not found, Also if I want to pass all the Variables in CSV could you help me with syntax?. I just started scripting not that good yet.
Also is it possible to pass the server list in the same script and run it without targets? I am looking forward to the bulk creation of users on unix.
1 of 1 people found this helpful
yes - you can run this as a type 2 script and read a file and run w/o any targets.
so it sounds like you need to write a script that will read a csv file as input, split out the columns into the different variables they will fill and pass those variables into the useradd command, and then nexec that useradd command.
what have you written so far? this should be a fairly easy shell script to create.
Thanks for the inputs, I was able to create.
do you have the sample script on how to create user accounts in multiple targets