Forum Discussion

ah_ha's avatar
ah_ha
Copper Contributor
Aug 26, 2025

Migrating users from M365 security group

Anyone know of a way in PowerShell to migrate multiple users in a M365 security group to a SharePoint group? Is this possible? Thanks!

3 Replies

  • Hi ah_ha​ 

     

    this are two different concepts. M365 security groups are available in M365 admin center, SharePoint groups are available "only" on SharePoint sites. You can use M365 security groups in SharePoint groups but not the other way around.

     

    On the Microsoft 365 Active teams and groups page, you can create groups of user accounts that you can use to assign the same permissions to in SharePoint Online and CRM Online. For example, an administrator can create a security group to grant a certain group of people access to a SharePoint site.

    Here are more detailled informations: https://learn.microsoft.com/microsoft-365/admin/email/create-edit-or-delete-a-security-group?WT.mc_id=DX-MVP-5004845 

     

    You can create an Power Automate flow to "sync" your M365 security members into an SharePoint group.

     

    Best, Dave

    • ah_ha's avatar
      ah_ha
      Copper Contributor

      Hello DaveMehr365​ Thanks for the info, I have tried using PA, but to no avail. I will continue to test for a viable solution. 

    • PankajBadoni's avatar
      PankajBadoni
      Iron Contributor

      Hi ah_ha​,

       

      In addition to DaveMehr365​ suggestion to use Microsoft 365 security groups, you can also leverage dynamic groups if you need to add\remove users based on user attributes (e.g., department, location) or device-based rules. 

      Dynamic groups can be added to a SharePoint group, and once the rule is configured, users will be automatically added or removed based on the criteria—ensuring access stays aligned with your organizational policies without manual intervention.

      https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership

      You can create user-based or device attribute-based rules to enable membership for dynamic membership groups in Microsoft Entra ID. You can add and remove dynamic membership groups automatically by using membership rules based on member attributes. In Microsoft Entra, a single tenant can have a maximum of 15,000 dynamic membership groups.

       

      Thanks,

      Pankaj

Resources