Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search for a user on all AIX server 1

Status
Not open for further replies.

hoang06

Technical User
Jan 6, 2003
15
CA
Hi,
Is there a script that look for a user on all AIX server?
This is to check if a user has an entry in /etc/passwd file on all server.

Thanks
 
Hi,
you can use such script:
#!/bin/ksh
cat <<EOD |&
server1
server2
......
serverN
EOD
while read -p S
do
F=`rsh $S grep $1 /etc/passwd`
if [ ${#F} -eq 0 ]
then
echo &quot;User $1 does not have an entry on the server $S&quot;
else
echo &quot;User $1 has an entry on the server $S&quot;
fi
done

If you will give this srcipt name CheckUser call it:
$ CheckUser usernm

Regards Boris

 
You only need the [tt]lsuser -a username[/tt] command!
I hope it works...
Unix was made by and for smart people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top