Hello,
Converting a user mailbox to a shared mailbox using Power Automate and Azure Functions is indeed possible. Here’s how you can achieve it:
Azure Function for PowerShell:
Create an Azure Function that hosts your PowerShell code. This function will execute the necessary PowerShell command to convert the user mailbox to a shared mailbox.
You can trigger this Azure Function from Power Automate using the HTTP action.
PowerShell Command:
The PowerShell command to convert a user mailbox to a shared mailbox is as follows:
Set-Mailbox -Identity <MailboxIdentity> -Type Shared
Replace <MailboxIdentity> with the actual identity (email address or display name) of the user mailbox you want to convert.
Flow Configuration:
In your Power Automate flow:
Use a trigger (e.g., when a new user is offboarded).
Add an HTTP action to call your Azure Function endpoint.
Pass the necessary parameters (e.g., mailbox identity) to the Azure Function.
The Azure Function will execute the PowerShell command to convert the user mailbox to a shared mailbox.
Remember to handle any error scenarios (e.g., if the mailbox doesn’t exist or if the Official Site conversion fails).
Hope this will help you.
Best regards,
Thomas Smith