Edit

Share via


Grant-CsTeamsEventsPolicy

Assigns Teams Events policy to a user, group of users, or the entire tenant. Note that this policy is currently still in preview.

Syntax

Identity (Default)

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

GrantToTenant

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

GrantToGroup

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

Description

Assigns Teams Events policy to a user, group of users, or the entire tenant.

TeamsEventsPolicy is used to configure options for customizing Teams Events experiences.

Examples

Example 1

PS C:\> Grant-CsTeamsEventsPolicy -Identity "user1@contoso.com" -Policy DisablePublicWebinars

The command shown in Example 1 assigns the per-user Teams Events policy, DisablePublicWebinars, to the user with the user principal name (UPN) "user1@contoso.com".

Example 2

PS C:\> Grant-CsTeamsEventsPolicy -Identity "user1@contoso.com" -Policy $null

The command shown in Example 2 revokes the per-user Teams Events policy for the user with the user principal name (UPN) "user1@contoso.com". As a result, the user will be managed by the global Teams Events policy.

Example 3

PS C:\> Grant-CsTeamsEventsPolicy -Group "sales@contoso.com" -Rank 10 -Policy DisablePublicWebinars

The command shown in Example 3 assigns the Teams Events policy, DisablePublicWebinars, to the members of the group "sales@contoso.com".

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Global

Use this switch if you want to grant the specified policy to be the default policy for all users in the tenant.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GrantToTenant
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Group

Specifies the group used for the group policy assignment.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GrantToGroup
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Identity

Specifies the identity of the target user. Acceptable values include:

Example: jphillips@contoso.com

Example: sip:jphillips@contoso.com

Example: 98403f08-577c-46dd-851a-f0460a13b03d

Use the "Global" Identity if you wish to set the policy for the entire tenant.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Identity
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PassThru

Enables passing a user object through the pipeline that represents the user being assigned the policy. By default, the Grant-CsTeamsEventsPolicy cmdlet does not pass objects through the pipeline.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PolicyName

"Name" of the policy to be assigned. The PolicyName is simply the policy Identity minus the policy scope (the "tag:" prefix). For example, a policy with the Identity tag:DisablePublicWebinars has a PolicyName equal to DisablePublicWebinars.

To unassign a per-user policy previously assigned to a user, set the PolicyName to a null value ($Null).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Rank

The rank of the policy assignment, relative to other group policy assignments for the same policy type.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GrantToGroup
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

Outputs

System.Object