Scripting help with Sudoers file

Hello,
Recently our team noticed access to groups had not been revoked per sudo file.

We currently have around 160 AIX LPARS.

I am hoping someone can help me write a script that would copy all sudoers file at each machine and dump into 1 large file for me to review.

I have public key setup to run from my NIM server.

Any help would be greatly appreciated.

Below code will help to you.

put all the ips in one file line by line.

while read ip
do
ssh -n ${ip} "cat $full path of sudoers" >> $output
done < $file