Powershell script for offboarding multiple users

Hi Team,
I need to build a Powershell script for offboarding multiple users in AD and Office 365, can you one share if you have any,

The script should do the following:

Disable the user in AD
remove the user from the AD Groups
Convert employee’s mailbox to a shared mailbox and assign manager as the owner
Remove employee’s license
remove the user from the AD Groups
Send a confirmation email

Thanks Vel

Hi Vel. You’ve made several posts and it seems you still haven’t grasped the purpose of this forum. This forum is here to help people with their powershell code, generally issues and questions about their specific code. This is not a script factory where people write or otherwise provide ready to use scripts. Most of us volunteer our time to assist many people for free. I personally would appreciate if you can take some time to read the help topics about the forum. Then when you have some code you’re trying to write and run into issues or have questions about, apply those simple guidelines to your request for assistance. This includes posting any code or error messages as preformatted text, have specific question(s), and hopefully a minimal example of what you’re trying, what is expected, and what is happening. This would make your experience here better as well as the rest of us. Thank you in advance.