Why?
I have been working with Dynamics365 since 2015 and ever since my firsts projects, I have heard how heavy the onboarding process is for new users. There are so many manual tasks that it will take an administrator a whole day, to make sure that the user is correctly set up as they should.
As years went by and it still was the same case, everything from adding business units, security roles, enabling mailboxes had to be done manually. This is not only time consuming, but also a very easy way for various errors to appear in the system. To be fair, if you need to manually go through a list of 50 people, adding roles, right business units, etc. You will make a mistake or two. We all would, that’s only human!
The worse part was that not all tasks could be performed by the same administrator. So they could set the person up for working in the Dynamics365/ Dataverse environment, but if the user needed to connect their mailbox to it, there was an Exchange administrator needed to approve that task.
This takes the time of atleast 2 people and I could not understand how that was not automated yet. The answer that I received from various D365 partners and colleagues that have been working with the system longer than me was, that this can’t be done better. You have to do this manually.
Well, that’s not true 😁
I decided to try if I could automate the approval of mailboxes for a co-speaking session with Yannick Reekmans at CollabDays NL 2022. Our session was about automating the user creation with AAD, Dataverse and Power Platform.
My efforts were successful, and I managed to automate the mailbox approval process, event took it further and added the App for Outlook to all relevant users as well. 😉 But that will be the topic of another post.
Now, let’s see how You can automatically approve your users mailboxes using Power Automate.
How?
The flow
I created a new automated cloud flow to trigger on the creation of a new mailbox in Dataverse.
Filled in the required information, such as:
- Change type: Added
- Table name: Mailboxes
- Scope: Organization
Now I know, that every time a new mailbox is added to Dataverse, this flow will trigger. If you wish to limit this to only specific mailboxes, then you can add your specific criteria to the Filter rows line.
The second step is to modify the Mailbox record, to test/enable the mailbox and approve email. Those of you that have been working with mailboxes in Dataverse/ Dynamics365 before, know that manually you would need to make sure that all information is correct, then press test/enable mailbox and then also click on approve mailbox, then you cross your fingers, hope for the best and if it went through without issues, you could save/close the 1 record 😁
This can of course also be done as a bulk activity, but who would want to have to do this manually 😁
Therefore, we instead build upon the flow we created:
We are now modifying the Mailbox record; the flow has fetched from Dataverse. You need to fill in the following information:
- Email Address O365 Admin Approval Status: Yes
- Email Address Status: Approved
- Enabled For Appointments, Contacts, and Tasks: Yes
- Enabled for Incoming Email: Yes
- Enabled for Outgoing Email: Yes
Advanced options:
- Appointments, Contacts, and Tasks: Server-Side Synchronization
- Appointments, Contacts, and Tasks status: Success
- Crm Org Marked As Primary Org for Exchange Mailbox: Yes
- Test Email Configuration Scheduled: Yes (If you forget this, the emails won’t be approved 😉)
Then you save it, test it and say goodbye to the manual mailbox enabling 😉
Prerequisites and notes:
- This can be run as a regular user but also as an application user. I recommend using the application user, to make sure it won’t break when users leave the company.
- The connection used to run this flow needs to have
Exchange Admin role in Azure AD. Update 05.12.2022 – It is no longer needed to have Exchange admin role, this can be done with the Delegated Mailbox Approver security role in Dataverse.
More info
Here are some links to read more about the subject 😊