This script can be used as part of the offboarding process for an employee. It will do the following:
- Block O365 Sign-In.
- Disconnect Existing sessions in case employee is signed in at another location.
- Forward emails to assigned Manager
- Set Internal and External Out-Of-Office
- Cancel all meetings organized by employee
- Remove from all distribution groups
- Re-assign O365 Group Ownerships.
- Remove from all O365 Groups
- Make Manager admin for OneDrive for Business account
- Send an email to the Manager when all is completed, with results.
The PS script is already available, I have used this to create a nice GUI application, I am changing a few things in it so that it will be easily transferable to any company, i.e. define your own domains, etc. I will let you have a copy if you want, just let me know.