Edit

Share via


New-CsTeamsTemplatePermissionPolicy

Creates a new instance of the TeamsTemplatePermissionPolicy.

Syntax

Default (Default)

New-CsTeamsTemplatePermissionPolicy

    [-HiddenTemplates <System.Management.Automation.PSListModifier`1[Microsoft.Teams.Policy.Administration.Cmdlets.Core.HiddenTemplate]>]
    [-Description <String>]
    [-Identity] <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Creates a new instance of the policy with a name and a list of hidden Teams template IDs. The template IDs passed into the HiddenTemplates object must be valid existing template IDs. The current custom and first-party templates on a tenant can be fetched by Get-CsTeamTemplateList.

Examples

Example 1

Assuming there are two valid templates with IDs com.microsoft.teams.template.ManageAProject and com.microsoft.teams.template.ManageAnEvent, we will first create the HiddenTemplate objects.

The next step would be to create the policy instance.

PS >$manageEventTemplate = New-CsTeamsHiddenTemplate -Id com.microsoft.teams.template.ManageAnEvent
PS >$manageProjectTemplate = New-CsTeamsHiddenTemplate -Id com.microsoft.teams.template.ManageAProject
PS >$HiddenList = @($manageProjectTemplate, $manageEventTemplate)
PS >New-CsTeamsTemplatePermissionPolicy -Identity Foobar -HiddenTemplates $HiddenList
Identity   HiddenTemplates                                                                           Description
--------   ---------------                                                                           -----------
Tag:Foobar {com.microsoft.teams.template.ManageAProject, com.microsoft.teams.template.ManageAnEvent}

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

-Description

Description of the new policy instance to be created.

Parameter properties

Type:String
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

-Force

The Force switch hides warning or confirmation messages. You don't need to specify a value with this switch.

You can use this switch to run tasks programmatically where prompting for administrative input is inappropriate.

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

-HiddenTemplates

The list of Teams template IDs to hide. The HiddenTemplate objects are created with New-CsTeamsHiddenTemplate.

Parameter properties

Type:

System.Management.Automation.PSListModifier`1[Microsoft.Teams.Policy.Administration.Cmdlets.Core.HiddenTemplate]

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

-Identity

Name of the new policy instance to be created.

Parameter properties

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

Parameter sets

(All)
Position:1
Mandatory:True
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

None

Outputs

TeamsTemplatePermissionPolicy.Cmdlets.TeamsTemplatePermissionPolicy