Clean up Microsoft Teams
AI translated from the German original
Learn how to use Seamless to bring order to existing Microsoft Teams and SharePoint workspaces, establish governance and archive inactive workspaces.
How does disorder arise in Microsoft Teams
Section titled “How does disorder arise in Microsoft Teams”Microsoft’s self service approach lets users create teams and SharePoint sites and invite guests on their own. This quickly leads to numerous workspaces, often without clear responsibilities or governance rules.
Missing responsibilities, outdated permissions and unused teams make administration harder, increase security risks and encourage oversharing.
This guide shows the steps to bring order to existing Microsoft Teams. For information on cleaning up guest access, see the guide Clean up guest access.
- Configure templates for Teams
- Enable jobs and subscriptions
- Assign and apply the template
- Define responsibility
- Enable group expiration (optional, Entra ID P1)
- Request a review
- Archive inactive teams
- Restrict self service
- Adjust email address and site URL (optional)
1. Configure templates for Teams
Section titled “1. Configure templates for Teams”Seamless templates control how new teams are created, checked against governance rules and archived.
Open Groups → Templates → organisation → template and select the corresponding tab:
-
Group tab
Minimum number of owners
Select the minimum number of owners, e.g.2. Several owners prevent orphaned teams, see Minimum owners.Sensitivity label
If you have prepared sensitivity labels for groups in Microsoft Purview, select the matching label, see Sensitivity labels.Visibility
Select Public or Private, see Visibility.Guest access
Allow or block guests, see Guest access. -
SharePoint tab
SharePoint site sharing permissions
Define who may share files and folders, see SharePoint sharing. -
Lifecycle tab
Status “Review required”
Enable the review and define the interval, e.g.180days. In the review, the primary contact confirms:- whether they are still responsible for the team,
- whether the team is still needed or can be archived,
- whether owners, members and guest access are still up to date.
For details, see Reviews.
-
Archiving tab
Actions
Define which actions are carried out when archiving, see Archiving. -
Save the template.
2. Enable jobs and subscriptions
Section titled “2. Enable jobs and subscriptions”Background jobs regularly check the teams against the rules of the template. Subscriptions report changes to teams to Seamless immediately.
- Open Monitoring → Jobs and enable the jobs Owner and Review, see Background jobs.
- Owner marks teams with too few owners.
- Review marks teams with a due review.
- Open Monitoring → Subscriptions and check whether the subscription for
groupsis active. Drift detection is based on it, see Subscriptions.
3. Assign and apply the template
Section titled “3. Assign and apply the template”Teams created outside Seamless are not assigned to an organisation or template.
- Open Groups → Manage and filter by Unassigned under Organisation.
- Select the teams you want and click Bulk operations → Assign organisation template.
- Select the matching organisation and template and confirm the assignment.
- Repeat until no teams are shown as Unassigned anymore.
- Select the assigned teams and click Bulk operations → Apply template settings. Leave Reset permissions disabled. Seamless then applies the settings from section 1 to the existing teams, see Apply a template.
4. Define responsibility
Section titled “4. Define responsibility”Every team needs a primary contact and enough owners.
- Filter by Unassigned under Primary Contact and assign a primary contact with Bulk operations → Assign responsible person.
- The job Owner marks teams with too few owners as Not enough owners.
- Under Some workspaces require attention, click Not enough owners and add the owners, see Missing owners.
5. Enable group expiration (optional, Entra ID P1)
Section titled “5. Enable group expiration (optional, Entra ID P1)”The group expiration policy (Entra ID P1) automatically deletes inactive Microsoft 365 groups after a defined time.
- Active teams are renewed automatically.
- Unused teams can be renewed by the owners, who receive an email reminder 30, 15 and 1 day before expiry.
- Without renewal, the team is deleted and can be restored for 30 days.
-
In the Microsoft Entra admin center, open Groups → Expiration.
-
Define the lifetime, the email address for groups without owners and the scope.
6. Request a review
Section titled “6. Request a review”In the review, the primary contact checks whether the team is still needed and who has access.
- Make sure the Seamless App is available in Microsoft Teams. The review takes place there.
- Select the teams under Groups → Manage and click Request review under Bulk operations.
- In the review, the primary contact confirms the responsibility, keeps or archives the team and checks the permissions.
Teams with an open review are marked with Review required under Groups → Manage.
7. Archive inactive teams
Section titled “7. Archive inactive teams”The primary contact archives teams that are no longer needed directly in the review. Admins can also archive teams themselves:
- Select the team under Groups → Manage.
- Click Archive in the … menu.
8. Restrict self service
Section titled “8. Restrict self service”To ensure that new teams, SharePoint sites and guests are only created via Seamless, restrict the default functions of Microsoft 365.
Restrict group creation
Section titled “Restrict group creation”By default, all users can create Microsoft 365 groups and therefore teams.
- Create a security group for authorised users, e.g.
AllowGroupCreation. - Restrict group creation to this group with Microsoft Graph PowerShell, see Microsoft: Configure group settings with PowerShell.
- Users create new teams via the Seamless App, administrators via the Seamless Admin Center.
Restrict SharePoint site creation
Section titled “Restrict SharePoint site creation”Restricting group creation does not prevent communication sites.
- In the SharePoint admin center, open Settings → Site creation.
- Turn off site creation by users, see Microsoft: Manage site creation in SharePoint.
- Save the changes.
Restrict guest invitations
Section titled “Restrict guest invitations”- In the Microsoft Entra admin center, open Entra ID → External Identities → External collaboration settings.
- Restrict guest invitations to administrators, see Microsoft: Configure external collaboration settings.
- Save the changes.
- New guests are then invited via Seamless. In Teams, users can only add existing guests.
9. Adjust email address and site URL (optional)
Section titled “9. Adjust email address and site URL (optional)”The naming convention of the template only applies to new teams. For existing teams, adjust the email address and site URL with PowerShell.
Change email address and alias
Section titled “Change email address and alias”-
Install the Exchange Online Management module, connect and define the group. This works on Windows and Mac:
Install-Module ExchangeOnlineManagement -Scope CurrentUserConnect-ExchangeOnline$group = "<group>" -
Change the primary email address:
Set-UnifiedGroup -Identity $group -PrimarySmtpAddress "<new-address>@<domain>" -
If needed, change the alias (mail nickname):
Set-UnifiedGroup -Identity $group -Alias "<new-alias>" -
Check the result:
Get-UnifiedGroup -Identity $group | Format-List Alias, PrimarySmtpAddress, EmailAddresses
For details, see Microsoft: Set-UnifiedGroup.
Change site URL
Section titled “Change site URL”-
Open Windows PowerShell, install the SharePoint Online Management Shell, connect and define the old and new URL:
Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUserConnect-SPOService -Url "https://<tenant>-admin.sharepoint.com"$old = "https://<tenant>.sharepoint.com/sites/<old>"$new = "https://<tenant>.sharepoint.com/sites/<new>" -
Validate the change first without running it:
Start-SPOSiteRename -Identity $old -NewSiteUrl $new -ValidationOnly -
Run the change:
Start-SPOSiteRename -Identity $old -NewSiteUrl $new
The SharePoint Online Management Shell only runs on Windows. On Mac, use PnP PowerShell. It requires its own app registration in Microsoft Entra ID, see PnP: Register an application.
-
Start PowerShell 7 with
pwsh, install PnP PowerShell, connect and define the old and new URL:Install-Module PnP.PowerShell -Scope CurrentUserConnect-PnPOnline -Url "https://<tenant>-admin.sharepoint.com" -Interactive -ClientId "<client-id>"$old = "https://<tenant>.sharepoint.com/sites/<old>"$new = "https://<tenant>.sharepoint.com/sites/<new>" -
Run the change. PnP has no validation without running:
Rename-PnPTenantSite -Identity $old -NewSiteUrl $new -Wait
Alternatively, change the address in the SharePoint admin center under Active sites → site → General → Site address → Edit. For details, see Microsoft: Change a site address.
Frequently asked questions
Section titled “Frequently asked questions”What counts as an owner?
The role Owner. The primary contact only counts if they also have the role Owner.
Does Seamless delete unused teams automatically?
No. Seamless never archives or deletes teams automatically. Only the Microsoft expiration policy deletes unused teams if nobody renews them.
How do I clean up visibility and sharing?
See Clean up oversharing.
How can I restrict the creation of teams?
Restrict the creation of Microsoft 365 groups to a security group with Microsoft Graph PowerShell, see Restrict group creation. New teams are then created via Seamless.
How do I find teams without owners?
The job Owner marks teams with too few owners as Not enough owners. Filter teams without a primary contact by Unassigned under Primary Contact, see Define responsibility.
How do I archive inactive teams?
Let the primary contact decide in the review or archive the team directly in the Seamless Admin Center, see Archive inactive teams.