List all Office 365 Groups & Delete Office 365 Groups

In the tenant using Modern Authentication and/or multi-factor authentication (MFA), connect to the Exchange Online PowerShell Module to work with groups.

  • Use IE/Edge (don’t skip), go to the Exchange admin center
  • Go to Hybrid > Click the second configure >
  • In the PowerShell window enter the following to connect. Details docs are in the reference links.

Connect-EXOPSSession -UserPrincipalName anupam.ranku@domain.com

To list all Office 365:

Get-UnifiedGroup

View all the properties of the group:

Get-UnifiedGroup -Identity "My Group Name" | Format-List

Note: ExternalDirectoryObjectId is same as other group Ids (e.g. Teams GUID).

Selected properties can be exported to excel file:

Get-UnifiedGroup | Select-Object -Property DisplayName, GroupType, ExternalDirectoryObjectId, PrimarySmtpAddress, Name | Export-Csv -Path .\ExportGroups.csv -NoTypeInformation

After manipulating the excel files, the same file can be used to delete/clean-up test/unwanted Groups:

Import-CSV .\ExportGroups.csv | Foreach-Object{
Write-Host "Deleting" $_.Name
Remove-UnifiedGroup -Identity $_.Name -confirm:$false
}

The above is a soft-delete of the groups and will be retained for another 30 days (for admin to restore). To reuse the same group internal name, those groups need to be permanently deleted. We will need to use AzureAD PowerShell Module for this. Run the following commands and sign-in again to see the list of deleted groups.

Import-Module AzureADPreview
Connect-AzureAD
Get-AzureADMSDeletedGroup
#The list can be exported in a excel for curation.
Get-AzureADMSDeletedGroup | Select-Object -Property DisplayName, ID | Export-Csv -Path .\DeletedGroups.csv -NoTypeInformation

After modifying the export file, same can be used to permanently delete those groups.

Import-CSV .\DeletedGroups.csv | Foreach-Object{
Write-Host "Permanently deleting" $_.DisplayName
Remove-AzureADMSDeletedDirectoryObject -Id $_.ID
}

Issues: if you are getting the following error, you have missed the step highlighted above in red. Use IE/Edge.
You cannot start application Microsoft Exchange Online Powershell Module from this location because it is already installed from a different location.

References:

Sydney (Office 365 Meetup) – Microsoft Teams – What’s Next?| Extend and Build App

Microsoft Team is the hub for teamwork in Office 365 that brings together conversations, files and tools. Teams give people a single place to communicate and collaborate and also allows the team members to customise Team with apps, bots (T-Bot, Who-Bot), tabs, Planner, Forms, Flow etc. as per their needs. There is an enormous number of out-of-the-box extensibilities exist within Team. But what if you need more features that are not in the MS Team but is essential for your company, team, or project? – this is what we will discuss during the session.
The session will include some updates on the newest additions to the development and extension for the MS Team. We will also demonstrate how you can leverage the existing resources from Microsoft and build the app you need for your business.

Thanks to Ken Josling for the snap

Meetup Event:
https://www.meetup.com/Sydney-Office-365-Meetup/events/254672548/
The slides are made available here:

Melbourne (MS365 Meetup) – Microsoft Teams | SharePoint – The Final Frontier

While Office 365 adoption continues to grow, some organisations are struggling to understand how to move past the traditional SharePoint and intranet-centric view of the world, and truly leverage all of the latest and greatest technology Microsoft has to offer. Microsoft Teams is a new way to focus on collaboration and communication, giving project teams and individuals the flexible features they need to get work done. This is the hub for teamwork in Office 365 that brings together conversations, files and tools. MS Teams gives people a single place to communicate and collaborate and also allows the team members to customize Team with apps, bots, tabs etc. as per their needs.

Meetup Event:
https://www.meetup.com/Melbourne-Office-365-Meetup/events/249012734/

Slides are available below