Step 1: Choose a server where you can access all your VIO’s
Step 2: Generate a key from the chosen server and then scp same key to VIO under /home/padmin
Step 3: Now, You can execute the below script from chosen server

Note:- In our case, We have chosen NIM server as our source server where the script to be executed
vio_server – Should contain VIO server name
Name of the script: vio_wwpn_number.sh

echo Server Name,FCS,WWPN,Location Code

CSV=","

for vio_wwpn_number_list in `cat vio_server`
do
for FCSX in `ssh padmin@$vio_wwpn_number_list ioscli lsdev |grep fcs |awk '{print $1}'`
do
echo $vio_wwpn_number_list${CSV}${FCSX}${CSV}`ssh padmin@$vio_wwpn_number_list ioscli lsdev -dev $FCSX -vpd |grep "Network Address" |sed -e "s/^.*\.//"|sed 's/../&:/g;s/:$//'`${CSV}`ssh padmin@$vio_wwpn_number_list ioscli lsdev -dev $FCSX -vpd |grep "Hardware Location Code" |awk -F "Hardware Location Code......" '{print $2}'`
done
done