script to get user id reports korn shell

Dear Friends,

Can Any one provide me script to generate list of username with the gecos field.

(cat /etc/passwd | cut -d: -f1,5)

Please note i have to run this command from nim server and i have password less ssh access.(ssh hostname command)

and i want a file to be generated on nim server.

Thanks in advance !!:b:

Regards,
Vinod

lsuser -a gecos ALL

issue from nim and pipe to a file