Configuring Expiration and Naming Policies

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 8 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Configuring Expiration and Naming Policies in Microsoft Teams

Introduction: The Necessity of Governance in Collaboration

Microsoft Teams has become the primary digital workspace for millions of organizations. As teams grow, the number of groups, channels, and associated SharePoint sites can balloon rapidly. Without proper oversight, an organization can quickly find itself dealing with a "digital sprawl" problem. This sprawl is characterized by hundreds of inactive, abandoned, or poorly named groups that clutter the interface, confuse users, and create security risks by making it difficult to track who has access to which data.

Governance is not about restricting users or stifling productivity; it is about creating a structured environment where collaboration can flourish without becoming unmanageable. Two of the most effective tools for maintaining a clean and organized Teams environment are Naming Policies and Expiration Policies. Naming policies ensure that all groups follow a consistent structure, making it easier to identify the purpose, department, or geographic location of a team at a glance. Expiration policies, on the other hand, act as an automated housekeeping mechanism, ensuring that inactive teams are identified and removed if they are no longer needed.

In this lesson, we will explore how to plan, implement, and manage these policies. We will look at the technical requirements, the practical application of these settings, and the best practices for ensuring your governance strategy supports your business goals rather than hindering them.


Not read yet

Part 1: Implementing Naming Policies

A naming policy is a set of rules that automatically applies prefixes and suffixes to the names of Microsoft 365 groups. When a user creates a new team, they are essentially creating a Microsoft 365 group. By enforcing a naming convention, you ensure that every team name follows an organization-wide standard. This helps in administrative reporting, searchability, and clarity for end-users who may be members of dozens of different teams.

Understanding the Components of Naming Policies

Naming policies consist of two primary parts: the Prefix/Suffix and the Blocked Words list.

  • Prefix/Suffix: These are strings of text that are automatically added to the beginning or end of a team name. You can use static text (like "TEAM-") or dynamic attributes (like the department or office location of the creator).
  • Blocked Words: This is a custom list of words that users are prohibited from using in their team names. This is useful for preventing inappropriate language or terms that might cause confusion, such as "HR-Confidential" or "Finance-Payroll."

Step-by-Step: Configuring Naming Policies

To configure these policies, you need to use the Azure Active Directory (now known as Microsoft Entra ID) module for Windows PowerShell. Note that you must have a Microsoft Entra ID P1 license or higher for each unique user who is a member of any group to which a naming policy is applied.

  1. Install the Microsoft Graph PowerShell SDK: Before you begin, ensure you have the necessary modules installed on your machine. Open PowerShell as an administrator and run Install-Module Microsoft.Graph -Scope CurrentUser.
  2. Connect to your tenant: Run Connect-MgGraph -Scopes "Directory.ReadWrite.All". You will be prompted to sign in with your administrator credentials.
  3. Define the Policy: You need to create a JSON object that defines the naming policy. For example, to add a department prefix, your configuration might look like this:
$namingPolicy = @{
    "GroupNamingPolicy" = @{
        "PrefixSuffixNamingRequirement" = "[Department]_[GroupName]"
        "BlockedWordsList" = "Confidential,Salary,Secret"
    }
}
  1. Apply the Policy: Once the object is defined, you apply it to the directory settings using the following command:
$settings = Get-MgDirectorySetting -DirectorySettingId <Your-Settings-ID>
$settings.Values += @{Name = "GroupNamingPolicy"; Value = (ConvertTo-Json $namingPolicy)}
Update-MgDirectorySetting -DirectorySettingId <Your-Settings-ID> -DirectorySetting $settings

Callout: Why Use Dynamic Attributes? Dynamic attributes are significantly more powerful than static strings. By using attributes like [Department] or [Office], the naming policy adapts to the user creating the team. If a user from the Marketing department creates a team, the system automatically prepends "Marketing_" to the name, ensuring consistency without requiring the user to manually type it every time.

Best Practices for Naming Conventions

When designing your naming policy, consider the following best practices:

  • Keep it Short: Users have limited screen space. If your prefix is too long, the actual name of the team will be truncated in the sidebar, making it hard to read.
  • Use Standardized Abbreviations: Instead of using full department names like "HumanResources," use "HR." This keeps names concise.
  • Communicate the Policy: Before turning on the policy, inform your users. If they try to create a team and it is suddenly renamed, they might be confused or frustrated if they don't understand the "why" behind the change.
  • Avoid Overly Complex Rules: If your naming policy is too complex, users will find workarounds or stop creating teams altogether. Aim for clarity and simplicity.

Not read yet

Part 2: Implementing Expiration Policies

Expiration policies are the primary defense against the accumulation of "ghost teams." A ghost team is a team that was created for a specific project or event, finished its purpose, but was never deleted. These teams continue to consume storage, appear in search results, and potentially host sensitive data that is no longer being monitored.

How Expiration Policies Work

An expiration policy sets a specific lifetime for a group (e.g., 180 days). If a team reaches its expiration date without any activity, the group owners are notified. They then have the opportunity to renew the team for another period. If they do not take action, the team is soft-deleted.

It is important to understand what constitutes "activity." Activity is not just someone logging in. It includes:

  • Sending a message in a Teams channel.
  • Uploading or editing a file in the team's SharePoint site.
  • Visiting the team's site or interacting with the group's mailbox in Outlook.
  • Adding or removing a member from the team.

Step-by-Step: Configuring Expiration Policies

Like naming policies, expiration policies are managed through the Microsoft Entra ID (Azure AD) PowerShell module.

  1. Define the Expiration Period: Decide on a reasonable time frame. 180 days is the standard industry default, but you can adjust this based on the typical length of projects in your organization.
  2. Configure the Policy: You will define the lifetime in days and identify which groups the policy applies to. You can apply it to "All" groups, "Selected" groups, or "None."
# Define the expiration policy settings
$expirationPolicy = @{
    "GroupLifetimeInDays" = 180
    "ManagedGroupTypes" = "All"
    "GroupLifetimeInDays" = 180
    "EmailNotificationIntervals" = "30,15,1"
}

# Apply the policy
$settings = Get-MgDirectorySetting -DirectorySettingId <Your-Settings-ID>
$settings.Values += @{Name = "GroupExpirationPolicy"; Value = (ConvertTo-Json $expirationPolicy)}
Update-MgDirectorySetting -DirectorySettingId <Your-Settings-ID> -DirectorySetting $settings
  1. Monitor Notifications: The EmailNotificationIntervals setting is critical. It sends reminders to the group owner at 30, 15, and 1 day before expiration. This gives them ample time to renew the team if it is still needed.

Note: When a team is deleted by the expiration policy, it enters a "soft-delete" state for 30 days. During this period, administrators can restore the group and all its contents. After 30 days, the group is permanently deleted and cannot be recovered.


Not read yet

Part 3: Managing the Intersection of Policies

When you combine naming and expiration policies, you create a robust governance framework. However, managing these together requires a proactive approach. You cannot simply "set it and forget it."

Common Mistakes and How to Avoid Them

Mistake 1: Not designating proper owners. Expiration policies rely on group owners to renew teams. If a team is created by a user who leaves the company, or if the owner is unaware they are responsible for the team's lifecycle, the team will expire and be deleted accidentally.

  • Solution: Always ensure every team has at least two owners. Implement a quarterly review process where you check for teams with only one owner or no active owners.

Mistake 2: Ignoring the "Blocked Words" list. Many organizations create a blocked words list once and never update it. New slang, project codenames that should remain confidential, or sensitive topics emerge constantly.

  • Solution: Schedule a review of your blocked words list every six months. Update it based on current organizational needs and feedback from the legal or HR departments.

Mistake 3: Over-applying policies. Applying an expiration policy to every single group might be too aggressive for groups that are meant to be permanent, such as "Company-Wide Announcements" or "IT Support."

  • Solution: Use the "Selected" groups option for expiration policies. This allows you to exclude permanent groups from the automated deletion cycle while keeping temporary project teams under control.

Comparison: Naming vs. Expiration Policies

Feature Naming Policy Expiration Policy
Primary Goal Consistency and organization Housekeeping and storage management
User Impact Visible at creation time Visible via email notifications
Automation Enforced at time of creation Enforced based on inactivity
License Required Entra ID P1/P2 Entra ID P1/P2
Remediation Renaming (if allowed) Restoring from soft-delete

Not read yet

Part 4: Advanced Governance Considerations

As your organization scales, you might find that standard naming and expiration policies are not enough. You may need to integrate these policies with other Microsoft 365 features.

Integration with Retention Labels

While expiration policies delete inactive teams, they do not necessarily handle data retention requirements. If your organization is subject to legal or regulatory requirements (like HIPAA or GDPR), you must use Retention Policies in the Microsoft Purview portal.

Retention policies ensure that even if a team is deleted by an expiration policy, the underlying data (files, chats) is preserved for a set period. Never rely on an expiration policy as a way to "clean up" data that you are legally required to keep.

Handling "Permanent" Teams

There will always be teams that should never expire. Creating a naming convention for these can help distinguish them from project-based teams. For example, you might require permanent teams to have a prefix like CORP-. You can then create a script that runs periodically to check for any team starting with CORP- and exclude them from your expiration policy logic.

Dealing with Inactive Owners

One of the biggest pitfalls in expiration policy management is the "Absentee Owner." If the owner of a team is on long-term leave, they won't see the expiration notification.

  • Tip: Use a script to identify teams where the owner has been inactive in the tenant for more than 30 days. Automatically assign a secondary owner from the same department to ensure that the team remains managed.

Not read yet

Part 5: Practical Workflow for Governance Implementation

To implement these policies successfully, follow this structured six-step workflow:

  1. Inventory Assessment: Run a report on all existing teams. Identify how many teams have been created, who owns them, and when they were last active. Use this data to determine if your expiration period should be 90, 180, or 365 days.
  2. Stakeholder Consultation: Meet with department heads. Explain that you are implementing naming policies to improve search and expiration policies to reduce clutter. Ask if there are any specific "permanent" teams that need to be exempted.
  3. Drafting the Policy: Create your naming convention and blocked words list. Document this clearly in an internal wiki or knowledge base so users know what to expect.
  4. Pilot Phase: Apply the policies to a small, non-critical department first. Observe the impact for two weeks. Monitor the Teams admin center for any issues with group creation or renewal notifications.
  5. Organizational Rollout: Once the pilot is successful, apply the policies to the entire tenant. Send a company-wide email explaining the change.
  6. Continuous Review: Set a recurring calendar item for yourself to review the "Blocked Words" list and the list of exempted groups. Governance is a living process, not a one-time configuration.

Not read yet

Part 6: Troubleshooting Common Issues

Even with careful planning, you may encounter issues. Here is how to handle the most common scenarios:

Issue: Users complaining that their team name was "changed"

Users often think the system is broken when they see a prefix added to their team.

  • Fix: This is usually a communication issue. Ensure your naming policy is clearly stated in the "New Team" creation screen if possible, or provide a link to the policy in your internal documentation. If the policy is strictly enforced, there is no way to bypass it for standard users.

Issue: A critical team was accidentally deleted

If an owner ignores the expiration emails and the team is deleted, you have a 30-day window to restore it.

  • Fix: Use the Microsoft Entra ID portal to find the deleted group and click "Restore." Once restored, the team will reappear in the Teams client within 24 hours. If it has been more than 30 days, the data is gone unless you have a separate backup solution.

Issue: The naming policy is too restrictive

If you find that users are choosing names that are technically compliant but functionally useless because the prefix takes up all the characters, you may need to reconsider your prefix length.

  • Fix: Shorten your prefixes. For example, instead of [Department], use a 3-letter code like MKT for Marketing or FIN for Finance.

Not read yet

Summary and Key Takeaways

Governance in Microsoft Teams is the difference between an organized, efficient digital workplace and a chaotic, cluttered mess. By implementing naming and expiration policies, you take control of your environment and ensure it remains a productive space for your users.

Key Takeaways:

  1. Consistency Matters: Naming policies provide a predictable structure that makes finding and managing teams significantly easier for both users and administrators.
  2. Automate Housekeeping: Expiration policies are essential for preventing "ghost teams." They ensure that storage is freed up and the interface remains clean by removing abandoned content.
  3. Communication is Vital: Before implementing these policies, ensure your users understand why they are being introduced. Transparency reduces frustration and increases compliance.
  4. License Appropriately: Remember that these features require Microsoft Entra ID P1 or P2 licenses. Ensure your tenant is properly licensed before attempting to configure these settings.
  5. Regular Maintenance: Governance is not a "set and forget" task. Regularly review your blocked words list, check for teams with single/inactive owners, and adjust your policies as your organization evolves.
  6. Prioritize Data Safety: Always pair expiration policies with proper retention policies if your organization has legal or regulatory requirements for data preservation.
  7. Plan for Exceptions: Not all teams are created equal. Identify permanent, high-level, or sensitive teams and create an exemption strategy to ensure they are not accidentally deleted by automated processes.

By following these steps and maintaining a proactive stance on governance, you will build a sustainable Teams environment that supports your organization's growth while maintaining security and order.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.