Skip to content

Entra ID Groups

Create, list, update, and manage Microsoft 365, security, and dynamic groups — including membership, owners, lifecycle policies, and cleanup.


Prerequisites

Permission Description Reference
Group.Read.All Read groups, members, owners Group permissions
Group.ReadWrite.All Create, update, delete groups Group permissions
GroupLifecyclePolicy.ReadWrite.All Group expiration policies Group lifecycle policy

How the group operations fit together

graph TD
    subgraph Group lifecycle
        C["Create<br/>(create_m365 / create_security /<br/>create_with_team)"]
        U["Update<br/>(update_group)"]
        M["Members<br/>(add_member / list_members)"]
        O["Owners<br/>(add_owner / list_owners)"]
        D["Delete<br/>(delete_groups / delete_batch)"]
    end

    C --> M
    C --> O
    M --> U
    O --> U
    U --> D

Which operation to use: use create_m365 for collaboration groups with a mailbox, create_security for access control, and create_with_team to get a team alongside the group. Ownership is key to governance — groups without owners cannot be administered (see find_orphans).


Examples

Operation File Permission API
List groups list.py Group.ReadWrite.All group list
Create a Microsoft 365 group create_m365.py Group.ReadWrite.All group create
Create a security group create_security.py Group.ReadWrite.All group create
Create a group with a team create_with_team.py Group.ReadWrite.All create group and team
Update group properties update_group.py Group.ReadWrite.All group update
Add/remove a member add_member.py Group.ReadWrite.All member add
List members list_members.py Group.Read.All members list
Add/remove an owner add_owner.py Group.ReadWrite.All owner add
List owners list_owners.py Group.Read.All owners list
Delete groups delete_groups.py Group.ReadWrite.All group delete
Delete groups in batch delete_batch.py Group.ReadWrite.All group delete
Export groups to CSV export_csv.py Group.Read.All group list
Find orphaned groups find_orphans.py Group.Read.All group list
Inspect groups & orphans manage.py Group.ReadWrite.All group list
Group lifecycle policies lifecycle_policies.py GroupLifecyclePolicy.ReadWrite.All lifecycle policy

API reference