Step 1: Choose a server where you can access all your HMC’s
Step 2: Generate a key from the chosen server and then scp same key to HMC’s under /home/hscroot
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

hmc_server – Should contain HMC server name
Name of the script: hmc_frame_list.sh

echo HMC Name,Frame Name,LPAR Name,Status,OS Running,Running Profile

for hmc_frame_list in `cat hmc_server`
do
ssh hscroot@$hmc_frame_list lssyscfg -r sys -F name|while read FRAME; do ssh -n hscroot@$hmc_frame_list lssyscfg -r lpar -m $FRAME -F"name,state,os_version,curr_profile" |while read LPARS; do echo "$hmc_frame_list,$FRAME,$LPARS"; done; done
done