Commands › Microsoft Teams

Grant-CsTeamsMediaLoggingPolicy

Microsoft Teams MicrosoftTeams Grant-*

Assigns Teams Media Logging policy to a user or entire tenant.

Quick start script

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

# 2. Run and inspect
Grant-CsTeamsMediaLoggingPolicy -Group <String> | Format-List

# 3. Export for evidence / drift tracking
Grant-CsTeamsMediaLoggingPolicy | Export-Clixml .\CsTeamsMediaLoggingPolicy-$(Get-Date -Format yyyyMMdd).xml

Syntax — 3 parameter sets

Identity (Default)

Grant-CsTeamsMediaLoggingPolicy [[-Identity] <String>] [-PassThru] [[-PolicyName] <String>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

GrantToTenant

Grant-CsTeamsMediaLoggingPolicy [-PassThru] [[-PolicyName] <String>]
 [-Global] [-WhatIf] [-Confirm] [<CommonParameters>]

GrantToGroup

Grant-CsTeamsMediaLoggingPolicy [-PassThru] [[-PolicyName] <String>]
 -Group <String> [-Rank <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-Global SwitchParameter When this cmdlet is used with `-Global` identity, the policy applies to all users in the tenant, except any that have an explicit policy assignment. For example, if the user already has Media Logging policy set to...
-Group String yes Specifies the group used for the group policy assignment.
-Identity String Specifies the identity of the target user. Acceptable values include:
-PassThru SwitchParameter Enables passing a user object through the pipeline that represents the user being assigned the policy. By default, the Grant-CsTeamsMediaLoggingPolicy cmdlet does not pass objects through the pipeline.
-PolicyName String Specifies the name of the policy to be assigned. The PolicyName is the policy identity minus the policy scope ("tag:"), e.g. a policy that has an identity of "Tag:Enabled" has a PolicyName of "Enabled".
-Rank Int32 The rank of the policy assignment, relative to other group policy assignments for the same policy type.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

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