How to Automate Shared Mailbox Conversion for Rehired Employees in Microsoft 365
Question details
The administrator needs to automate the process of converting a shared mailbox back to a regular user mailbox when an employee is rehired.

- Product
- Microsoft Exchange Online
- Device & OS
- not provided
- Scenario
- When an employee returns to the company, their previous shared mailbox needs to be converted back to a regular user mailbox so they can receive a Microsoft 365 license and appear in Microsoft Teams.
- Observed behavior
- Currently, the administrator executes this conversion manually and wants to automate the procedure as part of the identity management or re-onboarding workflow.
Ensure you have Exchange Administrator permissions and have installed the Exchange Online PowerShell V3 module to execute the required automation scripts.
Automate the Conversion Using PowerShell and Exchange Cmdlets
Integrate a PowerShell script into your automated identity management or HR onboarding workflow to trigger the mailbox conversion seamlessly.
By utilizing Exchange Online cmdlets, administrators can fully automate the transition of a shared mailbox to a regular user mailbox. Because exact implementations vary depending on directory synchronization (e.g., Azure AD Connect) and licensing models, the script should be tailored to your specific organizational environment.
Open an elevated PowerShell session and execute 'Connect-ExchangeOnline' to authenticate with your Microsoft 365 tenant.
Use the command 'Set-Mailbox -Identity user@yourdomain.com -Type Regular' in your script to change the mailbox from shared to a standard user mailbox.
Integrate Microsoft Graph PowerShell cmdlets (like 'Set-MgUserLicense') into the same script to automatically apply the Microsoft 365 license so the rehired employee can access Outlook and Teams.
Add this script to your primary identity-management platform or HR automation tools so that it executes automatically when the user's status changes to 'Rehired' or 'Active'.

Equip Rehired Employees with WPS Office for Instant Productivity
While your IT team automates backend Microsoft 365 licensing and mailbox conversions, you can provide rehired employees with WPS Office as a fast, lightweight, and completely free alternative for document creation.
- 1. Visit the Official Site: Go to the official WPS website on the rehired employee's workstation.
- 2. Download the Installer: Click the 'Free Download' button to get the lightweight installation package.
- 3. Install and Work: Follow the simple installation prompt to start opening and editing Microsoft Office documents right away.

Frequently Asked Questions
Will converting a shared mailbox to a user mailbox delete any existing emails?
No, all existing emails, calendar entries, and folders remain entirely intact during the conversion process. Only the mailbox classification type changes.
Why isn't the rehired employee appearing in Microsoft Teams immediately after the script runs?
Licensing changes and directory updates in Microsoft 365 can take several hours to fully propagate. It is common to experience a delay before the user appears in Teams or the Global Address List.
Can I convert the mailbox before assigning a Microsoft 365 license?
Yes, you can convert a shared mailbox to a user mailbox first. However, to access the mailbox and utilize services like Microsoft Teams, the user must be assigned a valid license within 30 days, or the mailbox may become inactive.
How do I test the automation script safely?
It is highly recommended to test your PowerShell script on a dummy shared mailbox in your Microsoft 365 tenant before deploying it to your production identity-management workflow.




