編輯

共用方式為


New-CsTeamsTemplatePermissionPolicy

Creates a new instance of the TeamsTemplatePermissionPolicy.

Syntax

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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Description of the new policy instance to be created.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HiddenTemplates

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

Type:System.Management.Automation.PSListModifier`1[Microsoft.Teams.Policy.Administration.Cmdlets.Core.HiddenTemplate]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Identity

Name of the new policy instance to be created.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

TeamsTemplatePermissionPolicy.Cmdlets.TeamsTemplatePermissionPolicy