Commands › Microsoft Teams

Grant-CsTeamsFilesPolicy

Microsoft Teams MicrosoftTeams Grant-*

This cmdlet applies an instance of the Teams AI policy to users or groups in a tenant.

Quick start script

# Grant-CsTeamsFilesPolicy — 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-CsTeamsFilesPolicy -Global <SwitchParameter> -Group <String> -Identity <String> | Format-List

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

Syntax — 4 parameter sets

Identity (Default)

Grant-CsTeamsFilesPolicy [<CommonParameters>]

GrantToUser

Grant-CsTeamsFilesPolicy -Identity <String> [[-PolicyName] <String>] [<CommonParameters>]

GrantToGroup

Grant-CsTeamsFilesPolicy [[-PolicyName] <String>] [-Group] <String> -Rank <Int32> [<CommonParameters>]

GrantToTenant

Grant-CsTeamsFilesPolicy [[-PolicyName] <String>] [-Global] [-Force] [<CommonParameters>]

Parameters (6)

ParameterTypeRequiredWhat it controls
-Force SwitchParameter Suppresses the display of any non-fatal error message that might arise when running the command.
-Global SwitchParameter yes This is the equivalent to `-Identity Global`.
-Group String yes This is the identifier of the group that the policy should be assigned to.
-Identity String yes Specifies the identity of the target user.
-PolicyName String Specifies the name of the policy to be assigned. The PolicyName is the policy identity minus the policy scope ("tag:"), for example, a policy that has an identity of "Tag:Enabled" has a PolicyName of "Enabled".
-Rank Int32 yes The rank of the policy assignment, relative to other group policy assignments for the same policy type.

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