How to Configure Teams Tagging and Role-Based Targeting Policies in PowerShell Using CsTeamsTargetingPolicy

In large enterprise organisations and frontline workforce environments, reaching specific subsets of colleagues quickly—such as on-duty nurses, floor managers, or tier-2 support engineers—requires granular communication tools. Microsoft Teams provides tags, allowing users to categorize team members based on role, skill, project, or location, and address them simultaneously using an @mention (such as @FloorSupervisors or @NightShiftEngineers). However, without administrative governance, uncontrolled tag creation leads to sprawl, communication confusion, and notification fatigue across critical channels. Microsoft Teams manages tag governance at the tenant level through the CsTeamsTargetingPolicy cmdlets in PowerShell.

Administrators can enforce policies determining who can create and manage tags (team owners only vs all members), control custom tag creation permissions, and enable dynamic shift-based tagging integrated with Microsoft Teams Shifts.

Understanding Teams Targeting Policy Architecture

The CsTeamsTargetingPolicy controls how tags function across individual teams within the organization. Key parameters include:

  • TaggingManagement: Controls who has authority to manage existing tags and assign members. Standard options include TeamOwnersOnly (ensures administrative control over tag membership) and TeamOwnersAndMembers (allows collaborative peer tagging).
  • CustomTagsAllowed: Boolean flag ($True or $False) specifying whether users can invent new arbitrary tags or are restricted to pre-provisioned organizational taxonomies.
  • ShiftBasedTaggingAllowed: Enables integration with the Microsoft Teams Shifts application. When enabled, Teams automatically manages dynamic tags (such as @CashierOnDuty) that update in real time based on active clock-in schedules, preventing off-shift employees from receiving urgent work pings.

Connecting to Microsoft Teams PowerShell

To configure and review targeting policies, open an elevated PowerShell console and connect to the Microsoft Teams tenant:

# Install or update Microsoft Teams PowerShell module
Install-Module -Name MicrosoftTeams -Force -AllowClobber

# Connect to tenant with Teams Administrator credentials
Connect-MicrosoftTeams

Inspect existing targeting policies provisioned in the tenant:

# Retrieve current targeting policies
Get-CsTeamsTargetingPolicy | Format-Table Identity, Description, TaggingManagement, CustomTagsAllowed, ShiftBasedTaggingAllowed

Tenants include a default Global policy that defines the baseline behavior across all teams unless an explicit custom policy is assigned.

Creating a Strict Tagging Policy for Enterprise Operations

For sensitive operational departments, corporate communications, or finance teams where notification hygiene is paramount, create a policy that restricts tag management strictly to Team Owners and disables arbitrary custom tag creation:

# Create restricted governance policy
New-CsTeamsTargetingPolicy -Identity "Strict-Owner-Tagging-Policy" `
                           -Description "Restricts tag creation and management exclusively to Team Owners" `
                           -TaggingManagement TeamOwnersOnly `
                           -CustomTagsAllowed $False `
                           -ShiftBasedTaggingAllowed $False

With this policy active, standard team members cannot create arbitrary tags or alter tag assignments, ensuring that @mentions remain authoritative.

Creating a Dynamic Shift-Based Tagging Policy for Frontline Workers

In retail stores, healthcare facilities, and manufacturing plants where employees rotate through morning, evening, and night shifts, enable automated shift-based tagging:

# Create dynamic shift-based tagging policy
New-CsTeamsTargetingPolicy -Identity "Frontline-Shift-Tagging-Policy" `
                           -Description "Enables real-time dynamic shift-based tags tied to Teams Shifts schedule" `
                           -TaggingManagement TeamOwnersAndMembers `
                           -CustomTagsAllowed $True `
                           -ShiftBasedTaggingAllowed $True

When employees clock in via the Shifts mobile app, Teams dynamically enrols them into the corresponding role tag. When their shift concludes and they clock out, Teams automatically removes them from the tag, eliminating notification interruptions during off-duty hours.

Modifying Existing Targeting Policies

To update settings on an existing policy—such as enabling shift-based tagging across a previously configured baseline—use the Set-CsTeamsTargetingPolicy cmdlet:

# Enable shift-based tagging on the Global policy
Set-CsTeamsTargetingPolicy -Identity Global `
                           -ShiftBasedTaggingAllowed $True

Verify that parameter adjustments have taken effect:

# Inspect specific policy parameters
Get-CsTeamsTargetingPolicy -Identity "Frontline-Shift-Tagging-Policy" | Format-List

Assigning Targeting Policies to Users and Teams

Targeting policies can be assigned to individual user accounts, security groups, or applied broadly across business units using the Grant-CsTeamsTargetingPolicy cmdlet.

Assign the frontline policy to an individual user:

# Assign policy to a specific user
Grant-CsTeamsTargetingPolicy -Identity "[email protected]" `
                             -PolicyName "Frontline-Shift-Tagging-Policy"

Assign the strict policy across an entire department using attribute filtering:

# Assign strict policy to all Corporate Headquarters users
$CorporateStaff = Get-CsOnlineUser -Filter {Department -eq "Executive-Communications"}
$CorporateStaff | ForEach-Object {
    Grant-CsTeamsTargetingPolicy -Identity $_.UserPrincipalName -PolicyName "Strict-Owner-Tagging-Policy"
}

To remove a custom policy override and return a user to the tenant-wide Global policy:

# Revert account to Global policy inheritance
Grant-CsTeamsTargetingPolicy -Identity "[email protected]" -PolicyName $Null

By implementing structured targeting policies with CsTeamsTargetingPolicy, IT administrators prevent channel notification fatigue while empowering teams with dynamic, role-based collaboration tools.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.