how to create 100 users at a time in solaris?

Answers were Sorted based on User's Feedback



how to create 100 users at a time in solaris?..

Answer / hi

We need to write scripting for tht. Write a scripting program to add 100 users at a time.

Is This Answer Correct ?    13 Yes 0 No

how to create 100 users at a time in solaris?..

Answer / nitin thakur

Write a script with make, make can run in parallel. It can
fork 100 process in one go.

Is This Answer Correct ?    3 Yes 0 No

how to create 100 users at a time in solaris?..

Answer / sudas

Can anyone please write the script please ?

Is This Answer Correct ?    3 Yes 0 No

how to create 100 users at a time in solaris?..

Answer / satish

#!/bin/ksh

#
# Adds users from the userlist.txt file if they are not in
# /etc/passwd.
#

CURRENTUSERS=`awk -F":" '{ print $1 }' /etc/passwd`
EXPECTEDUSERS=`cat userlist.txt`
USERFOUND=0

for i in $EXPECTEDUSERS ; do
for x in $CURRENTUSERS ; do
if [ "$x" = "$i" ] ; then
USERFOUND=1
fi
done
if [ $USERFOUND -eq 1 ] ; then
echo Found user: $i
USERFOUND=0
else
/usr/sbin/useradd -d /home/$i -g wheel $i
echo Adding user: $i
sed s/$i:.*:.*:.*:.*:.*:.*:.*:/$i:XOHWcSkDQKZaA:14208:0:99999:7:::/g </etc/shadow>/etc/shadow2
cp /etc/shadow2 /etc/shadow
rm /etc/shadow2
fi
done

exit 0

Is This Answer Correct ?    5 Yes 2 No

how to create 100 users at a time in solaris?..

Answer / raghu

There is a script to write......
we can create 100 users at a time in solaris while using for loop condition......

i know about the script......its very important script not to tell like this,, in this........personal send me the message i ll mail to u ok...................its so simple script....

Is This Answer Correct ?    1 Yes 0 No

how to create 100 users at a time in solaris?..

Answer / net star

Just prepare a /etc/passwd file in notepad for all users ..
and paste to passwd file and rnu pwconv file.

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More Solaris General Interview Questions

How do you remove a swap space?

0 Answers  


in a global zone we are created a zone. how can we know whether it is a sparse root model or whole root model.

3 Answers  


Performace degradations in NFSv4 when upgraded from NFSv3? problems with NFS v4?

0 Answers   IBM, Satyam, Wipro,


how can we know the time of creation of zone in solaris

1 Answers   HCL,


How many types of file system?

12 Answers   Blue Dart,






what are the run levels that are used in solaris10?

10 Answers   TCS,


Process between Kernel and Shell when a command is executed?

2 Answers   Satyam, Wipro,


Explain crashdumps & core files?

3 Answers   Satyam, Wipro,


How to change the default values ( home dir, shell, role, min, max, expire) get by user ?

2 Answers   Satyam, Wipro,


Explain how to view shared memory statistics?

0 Answers  


How to see the route?

4 Answers   Satyam, Wipro,


Explain custom jumpstart procedure?

0 Answers   Satyam, Wipro,


Categories
  • Solaris Commands Interview Questions Solaris Commands (360)
  • Solaris Threads Interview Questions Solaris Threads (9)
  • Solaris IPC Interview Questions Solaris IPC (30)
  • Solaris Socket Programming Interview Questions Solaris Socket Programming (3)
  • Solaris System Calls Interview Questions Solaris System Calls (25)
  • Solaris General Interview Questions Solaris General (170)
  • Solaris AllOther Interview Questions Solaris AllOther (297)