Script for offbarding user from 365 in Microsoft Exchange online PowerShell module

Rabin Rasaili 21 Reputation points
2022-11-01T23:11:00.087+00:00

Hi, Teams,
I am looking for a script to remove users from all Office 365 groups and SharePoint sites in Microsoft Exchange online PowerShell module

Simply, an Offbarding script would be fine which will include removing from groups and SharePoint sites.

Thanks in advance

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,373 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,995 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
0 comments No comments
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,241 Reputation points
    2022-11-02T02:28:01.997+00:00

    @Rabin Rasaili

    You could use command below to remove mailbox from Office 365 group:

    Get-UnifiedGroup | Remove-UnifiedGroupLinks -Links user@domain.onmicrosoft.com -LinkType members  
    

    About how to remove mailboxes from the SharePoint, you could confirm with the SharePoint team.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful