cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SivaR
New Member

remove or add user to D365 when a user removed or added to Azure AD

Hi,

I am trying to import the email address to D365 for the D365 marketing mail-out. 

I imported all the emails from Azure AD to D365 following this guide.  

https://powerusers.microsoft.com/t5/Building-Flows/import-All-Azure-AD-emails-to-D365-contact-entity...

 

However, Now i have to schedule a flow to run in the following scenarios:

1. if a new user joins the department or leaves the department, that user will be added or removed from the Azure AD.
- How I can bring the added new user only from Azure AD and save it to the D365 contact entity

- how I can identify the user removed from Azure AD and remove from D365.

 

Thank you,

SivaR

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @SivaR,

 

If you want to keep that contacts in sync I would use a different approach compared to my previous answer. That example just showed a one-time import.

 

For keeping contacts in sync I would use a custom Office 365 Group with a Dynamic Membership Rule in Azure AD (which is a P1 feature btw, https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-dynamic-membership) and use the When a group member is added or removed trigger action.

 

When the removed field is not empty you can lookup the contact record and deactivate it.

office365group_keepinsync.png

Thank you for the information.
i am using the dynamics 365 cloud version. 
i tried to select "When a group member is added or removed" connection on the flow, it didn't give this option. 
only i can find "Remove member from group" or "Add member to group" and etc. for the Office 365 group. how i can get the "When a group member is added or removed"  option. 
thank you,
Siva

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,140)