Commands › Microsoft Teams

Set-TeamTargetingHierarchy

Microsoft Teams MicrosoftTeams Set-*

Upload a hierarchy to the tenant. A tenant may only have 1 active hierarchy. Each Set-TeamTargetingHierarchy cmdlet call will overwrite the previous one.

Quick start script

# Set-TeamTargetingHierarchy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-TeamTargetingHierarchy
$before | Format-List

# 3. Make the change
Set-TeamTargetingHierarchy -FilePath <String>

# 4. Verify and diff
$after = Get-TeamTargetingHierarchy
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-TeamTargetingHierarchyStatus [-FilePath <String>] [-ApiVersion <String>] [<CommonParameters>]

Parameters (2)

ParameterTypeRequiredWhat it controls
-ApiVersion String The version of the Hierarchy APIs to use. Valid values are: 1 or 2.
-FilePath String yes Specifies the path to a CSV file that defines the hierarchy.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.