Guide
Automation Action: Archive or Unarchive a Team
This automation action allows you to archive or unarchive a team automatically. The action is under the type “Archiving”.
- Once you select this action, you will need to complete the following:
- Team: Choose a Team ID or enter it manually. Alternatively, if the automation is running from a Team Check, enter {{Team.TeamId}}.
- Action: Choose to Archive or Unarchive the specified Team.
- Click “Save”.
Automation Template: Archive Unused Teams
The Automation Template “Archive Unused Teams”, once enabled, would automatically archive teams.
Trigger
The automation runs on the trigger “on policy violation” and the policy “Inactive Teams”.
The “Inactive Teams” check 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.
Automation
The automation has two actions present, the first is to archive the team the second is to send an email to the owner.
-
Archive or Unacrive a Team
- Team: This is set to {{Team.TeamId}}.
- Action: The action is set to archive.
-
Contect Change
-
From Team to Teams Owners.
-
Send email
-
Execute For: Team > Teams Owners (run this action for each Teams Owner).
-
To: This is set to **{{User.UserEmail}}**.
-
Cc: This is currently 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 regardsThe Teams administration team.
-
-
{{Team.TeamId}} will pull the TeamId from the results of the check.
{{User.UserEmail}} will pull the email address of each owner of the Team.
{{ParentTeam.DisplayName}} will pull the Display Name for the Team.
{{User.FirstName}} Will pull the Firstname of the Owner.
{{User.LastName}} Will pull the Lastname of the Owner.