How to remove a Office 365 group or distribution group with PowerShell

How to remove a Office 365 group or distribution group with PowerShell

Delete a Office 365 group via the admin centre

BrowseGo to https://admin.microsoft.com - Select from Teams & Groups -> Active Teams and Groups on the left.

Select the team you wish to delete -> press delete

1

Delete a Office 365 group via the Exchange Control Panel

Browseto the Exchange Control Panel: http://outlook.office.com/ecp

Select groups and delete the Office 365 group.

1

Login via PowerShell in Azure AD

Tutorial: How to install Azure AD preview module with PowerShell

Open Powershell as administrator

1

Install the PowerShell module from Azure AD

Run the following line in PowerShell:

install-package -Name AzureAD

Connect to AzureAD via PowerShell

Connect-AzureAD

Retrieve all deleted Office 365 groups

With this command you can retrieve all Office 365 groups:

Get-AzureADMSDeletedGroup'

Delete a Office 365 Group with Powershell - hard delete

Copy the ID after the get command and place ddit after -ID as in the screenshot below.

Remove-AzureADMSDeletedDirectoryObject -Id 199e5c7....'
1

Also read

Getting started with Powershell for managing Microsoft 365
How to manage Microsoft Teams with Azure Cloud Shell
Tutorial: How to create and manage Microsoft Teams via PowerShell?

Jasper

Jasper

Welcome to 365tips.be. On this website you can read articles and experiences about Office 365 with focus on Microsoft Teams. Feel free to ask me a question and I will answer it in a blog post. Help others by giving feedback at the bottom of the articles. This blog is made in Dutch. The multilingual website is offered with best-effort machine translation.
0 0 votes
Product review
Subscribe
Please let us know if there are
guest
0 Reactions
Inline feedbacks
See all comments
0
Would love to know your thoughts, please leave a comment.x