How to generate random passwords for the already existing users

Hi guys!

I want to create user database with usernames same as the employee ID of all the employees. But I want to generate initial passwords for them on the fly.
Could anyone help me with this?

Thank you.