Password Manager Passcode Generation

I'm wondering if there is a way to automate the temporary passcode generation to email when a user is added into active directory? My thinking behind this is when a user is setup in AD, we list their email address always. Once that user has been created, a passcode will be automatically generated and sent to the user via email so they can register. Is this possible?