rencore.com (opens in a new tab) Start a trial (opens in a new tab)

Archive or unarchive a team with an automation

Last updated Automation Teams

AI summary

Use the Archive or unarchive a Team action in automations to archive or unarchive Teams automatically based on your criteria, such as inactivity. The action requires the Read and change all teams' settings permission, and you can set it up in the Automation Builder by selecting the Team, choosing your action, and saving. A ready-made automation template archives Teams that have been inactive for six months and notifies the Team owners by email.

Use the Archive or unarchive a Team action to archive or unarchive a Team automatically, for example when a Team has been inactive for months. The action is under the type “Archiving”.

Before you begin

  • Your Rencore role includes the Create Automation or Edit Automation permission. Owner, Admin and Contributor have it. See Rencore roles.
  • The action needs the permission Read and change all teams’ settings. It lets Rencore Governance read and change all teams’ settings without a signed-in user.

Steps

  1. Open the automation in the Automation Builder. See Create a custom automation.
  2. Click + in the flow and select Archive or Unarchive a Team under Archiving.
  3. In Team, choose a Team ID or enter it manually. If the automation runs from a Team policy, enter {{Team.TeamId}}.
  4. In Action, choose Archive or Unarchive.
  5. Click Save.

What you see

The action turns the “Archive” mode of the Team on or off, as described in Archive or restore a team on Microsoft Learn.

Limits

  • The automation does not archive content in the Team by transferring it to an external archive system.

Automation template: Archive unused Teams

Once it is turned on, the automation template Archive Unused Teams archives Teams automatically.

Trigger

The automation runs on the trigger “on policy violation” and the policy Inactive Teams. Before you turn the automation on, edit or clone this policy and change it to the logic you want.

The Inactive Teams policy has the following logic:

  • Report a violation for every: Team
    • Filter Conditions: Last Message Is Posted [More than] 6 months ago.
  • and that all: SharePoint Site Collections
    • Filter Conditions: Last Used [Is More Than] 6 months ago.
  • and that No: Teams Private Channel Site Collections
    • Filter Conditions: Last Used [Is Less Than] 6 months ago.
  • and that Any: Teams Private Channel Site Collections
    • Filter Conditions: Last Used [Is Less Than] 6 months ago.

Actions

The automation has two actions. The first archives the Team, the second sends an email to the owners.

  • Archive or Unarchive a Team
    • Team: set to {{Team.TeamId}}.
    • Action: set to archive.
  • Context Change
    • From Team to Teams Owners.
    • Send email
      • Execute For: Team > Teams Owners (run this action for each Teams Owner).
      • To: set to {{User.UserEmail}}.
      • Cc: blank.
      • Subject: Team {{ParentTeam.DisplayName}} has been archived.
      • Body: Dear {{User.FirstName}} {{User.LastName}},
        The Microsoft Teams team {{ParentTeam.DisplayName}} has been archived automatically because no messages have been posted and no files used or modified in the last 6 months.
        Best regards
        The Teams administration team.

Placeholders

  • {{Team.TeamId}} pulls the TeamId from the results of the policy.
  • {{User.UserEmail}} pulls the email of each owner of the Team.
  • {{ParentTeam.DisplayName}} pulls the display name of the Team.
  • {{User.FirstName}} pulls the first name of the owner.
  • {{User.LastName}} pulls the last name of the owner.

Frequently asked questions

Which permissions do I need to archive or unarchive a team with an automation?

Your Rencore role needs the Create Automation or Edit Automation permission, which Owner, Admin and Contributor have. The action also needs the permission Read and change all teams' settings, which lets Rencore Governance read and change all teams' settings without a signed-in user.

What team ID do I enter when the automation runs from a team policy?

Enter {{Team.TeamId}} in the Team field. This placeholder pulls the TeamId from the results of the policy.

Does the archive or unarchive a team action move team content to an external archive system?

No. The action only turns the Archive mode of the Team on or off. It does not archive content in the Team by transferring it to an external archive system.

When does the archive unused Teams template archive a team?

The template runs on the trigger on policy violation and the policy Inactive Teams. By default, that policy reports a Team when its last message was posted more than 6 months ago and its SharePoint Site Collections were last used more than 6 months ago. You can edit or clone the policy first.

Are team owners notified when the archive unused Teams automation archives a team?

Yes. After the Team is archived, the automation sends an email to each Teams Owner. The email states that the Team has been archived automatically because no messages were posted and no files used or modified in the last 6 months.