Skip to content

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.

7 min read

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.

  1. Configure templates for Teams
  2. Enable jobs and subscriptions
  3. Assign and apply the template
  4. Define responsibility
  5. Enable group expiration (optional, Entra ID P1)
  6. Request a review
  7. Archive inactive teams
  8. Restrict self service
  9. Adjust email address and site URL (optional)

Seamless templates control how new teams are created, checked against governance rules and archived.

Open Groups → Templates → organisation → template and select the corresponding tab:

  1. 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.

  2. SharePoint tab

    SharePoint site sharing permissions
    Define who may share files and folders, see SharePoint sharing.

  3. Lifecycle tab

    Status “Review required”
    Enable the review and define the interval, e.g. 180 days. 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.

  4. Archiving tab

    Actions
    Define which actions are carried out when archiving, see Archiving.

  5. Save the template.

Background jobs regularly check the teams against the rules of the template. Subscriptions report changes to teams to Seamless immediately.

  1. 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.
  2. Open Monitoring → Subscriptions and check whether the subscription for groups is active. Drift detection is based on it, see Subscriptions.

Teams created outside Seamless are not assigned to an organisation or template.

  1. Open Groups → Manage and filter by Unassigned under Organisation.
  2. Select the teams you want and click Bulk operations → Assign organisation template.
  3. Select the matching organisation and template and confirm the assignment.
  4. Repeat until no teams are shown as Unassigned anymore.
  5. 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.

Every team needs a primary contact and enough owners.

  1. Filter by Unassigned under Primary Contact and assign a primary contact with Bulk operations → Assign responsible person.
  2. The job Owner marks teams with too few owners as Not enough owners.
  3. 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.
  1. In the Microsoft Entra admin center, open Groups → Expiration.

  2. Define the lifetime, the email address for groups without owners and the scope.

In the review, the primary contact checks whether the team is still needed and who has access.

  1. Make sure the Seamless App is available in Microsoft Teams. The review takes place there.
  2. Select the teams under Groups → Manage and click Request review under Bulk operations.
  3. 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.

The primary contact archives teams that are no longer needed directly in the review. Admins can also archive teams themselves:

  1. Select the team under Groups → Manage.
  2. Click Archive in the … menu.

To ensure that new teams, SharePoint sites and guests are only created via Seamless, restrict the default functions of Microsoft 365.

By default, all users can create Microsoft 365 groups and therefore teams.

  1. Create a security group for authorised users, e.g. AllowGroupCreation.
  2. Restrict group creation to this group with Microsoft Graph PowerShell, see Microsoft: Configure group settings with PowerShell.
  3. Users create new teams via the Seamless App, administrators via the Seamless Admin Center.

Restricting group creation does not prevent communication sites.

  1. In the SharePoint admin center, open Settings → Site creation.
  2. Turn off site creation by users, see Microsoft: Manage site creation in SharePoint.
  3. Save the changes.
  1. In the Microsoft Entra admin center, open Entra ID → External Identities → External collaboration settings.
  2. Restrict guest invitations to administrators, see Microsoft: Configure external collaboration settings.
  3. Save the changes.
  4. 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.

  1. Install the Exchange Online Management module, connect and define the group. This works on Windows and Mac:

    Install-Module ExchangeOnlineManagement -Scope CurrentUser
    Connect-ExchangeOnline
    $group = "<group>"
  2. Change the primary email address:

    Set-UnifiedGroup -Identity $group -PrimarySmtpAddress "<new-address>@<domain>"
  3. If needed, change the alias (mail nickname):

    Set-UnifiedGroup -Identity $group -Alias "<new-alias>"
  4. Check the result:

    Get-UnifiedGroup -Identity $group | Format-List Alias, PrimarySmtpAddress, EmailAddresses

For details, see Microsoft: Set-UnifiedGroup.

  1. Open Windows PowerShell, install the SharePoint Online Management Shell, connect and define the old and new URL:

    Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
    Connect-SPOService -Url "https://<tenant>-admin.sharepoint.com"
    $old = "https://<tenant>.sharepoint.com/sites/<old>"
    $new = "https://<tenant>.sharepoint.com/sites/<new>"
  2. Validate the change first without running it:

    Start-SPOSiteRename -Identity $old -NewSiteUrl $new -ValidationOnly
  3. Run the change:

    Start-SPOSiteRename -Identity $old -NewSiteUrl $new

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.

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.

Next steps

Learn more