There are plenty of script samples out there that do this, here's one of mine: https://www.michev.info/blog/post/4409/remove-user-from-all-microsoft-365-groups-updated-2023-version-of-the-script It works for both Exchange (Distribution) and Entra ID (security or M365) groups, expect dynamic ones.
Is there any way via GUI or PowerShell to remove the disabled user account from M365 groups, Distributions lists and Security groups when users account is disabled in tenant?
Vinod Survase
4,726
Reputation points
Is there any way via GUI or PowerShell to remove the disabled user account from M365 groups, Distributions lists and Security groups when users account is disabled in tenant? I know there is way from Dynamic user and security group but I was looking from M365 and other type of groups which I mentioned above except Dynamic groups.