Skip to content

TeamsChannelsPolicy

Parameters

Parameter Attribute DataType Description Allowed Values
Identity Key String Identity of the Teams Channel Policy.
Description Write String Description of the Teams Channel Policy.
AllowChannelSharingToExternalUser Write Boolean Determines whether a user is allowed to share a shared channel with an external user. Set this to TRUE to allow. Set this FALSE to prohibit.
AllowOrgWideTeamCreation Write Boolean Determines whether a user is allowed to create an org-wide team. Set this to TRUE to allow. Set this FALSE to prohibit.
EnablePrivateTeamDiscovery Write Boolean Determines whether a user is allowed to discover private teams in suggestions and search results. Set this to TRUE to allow. Set this FALSE to prohibit.
AllowPrivateChannelCreation Write Boolean Determines whether a user is allowed to create a private channel. Set this to TRUE to allow. Set this FALSE to prohibit.
AllowSharedChannelCreation Write Boolean Determines whether a user is allowed to create a shared channel. Set this to TRUE to allow. Set this FALSE to prohibit.
AllowUserToParticipateInExternalSharedChannel Write Boolean Determines whether a user is allowed to participate in a shared channel that has been shared by an external user. Set this to TRUE to allow. Set this FALSE to prohibit.
AllowCreateChannel Write String This setting enables/disables Next Generation Channel creation and editing. Possible values: Enabled, Disabled.
AllowCreateClassicChannel Write String This setting enables/disables Classic Channel creation and editing. Possible values: Enabled, Disabled.
AllowCreatePrivateChannel Write String This setting enables/disables Next Generation Private Channel creation and editing. Possible values: Enabled, Disabled.
AllowCreateSharedChannel Write String This setting enables/disables Next Generation Shared Channel creation and editing. Possible values: Enabled, Disabled.
CreateSharedChannelsByDefault Write String This setting sets whether users are able to create Next Generation Shared Channels by default. Possible values: Enabled, Disabled.
AllowUsersFromOutsideTeam Write String This setting enables/disables whether users from outside the team are allowed in Next Generation Channels. Possible values: Enabled, Disabled.
AllowGuestsFromOutsideTeam Write String This setting enables/disables whether guests from outside the team are allowed in Next Generation Channels. Possible values: Enabled, Disabled.
AllowUsersFromOutsideTeamInPrivateChannel Write String This setting enables/disables whether users from outside the team are allowed in Next Generation Private Channels. Possible values: Enabled, Disabled.
AllowGuestsFromOutsideTeamInPrivateChannel Write String This setting enables/disables whether guests from outside the team are allowed in Next Generation Private Channels. Possible values: Enabled, Disabled.
AllowSharingWithTeamInOrg Write String This setting enables/disables sharing Next Generation Channels with Teams in the same organization. Possible values: Enabled, Disabled.
AllowSharingPrivateChannelWithTeamInOrg Write String This setting enables/disables sharing Next Generation Private Channels with Teams in the same organization. Possible values: Enabled, Disabled.
DefaultChannelTypeOnCreation Write String This setting sets the default channel type that users have available on channel creation. Possible values: Flexible, Private, Standard, Shared.
Ensure Write String Present ensures the policy exists, absent ensures it is removed. Present, Absent
Credential Write PSCredential Credentials of the Teams Admin
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
TenantId Write String Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.
CertificatePassword Write PSCredential Username can be made up to anything but password will be used for CertificatePassword
CertificatePath Write String Path to certificate used in service principal usually a PFX file.
ManagedIdentity Write Boolean Managed ID being used for authentication.
AccessTokens Write String[] Access token used for authentication.

Description

This resource configures a Teams Channel Policy.

More information: https://docs.microsoft.com/en-us/microsoftteams/teams-policies/

Permissions

Examples

Example 1

This example adds a new Teams Channels Policy.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        TeamsChannelsPolicy 'TeamsChannelsPolicy-Example'
        {
            Identity                                      = 'New Channels Policy'
            Description                                   = 'Enables private and shared channels for project teams'
            AllowChannelSharingToExternalUser             = $True
            AllowOrgWideTeamCreation                      = $True
            EnablePrivateTeamDiscovery                    = $True
            AllowPrivateChannelCreation                   = $True
            AllowSharedChannelCreation                    = $True
            AllowUserToParticipateInExternalSharedChannel = $True
            AllowCreateChannel                            = "Enabled"
            AllowCreateClassicChannel                     = "Enabled"
            AllowCreatePrivateChannel                     = "Enabled"
            AllowCreateSharedChannel                      = "Enabled"
            CreateSharedChannelsByDefault                 = "Disabled"
            AllowUsersFromOutsideTeam                     = "Enabled"
            AllowGuestsFromOutsideTeam                    = "Disabled"
            AllowUsersFromOutsideTeamInPrivateChannel     = "Enabled"
            AllowGuestsFromOutsideTeamInPrivateChannel    = "Disabled"
            AllowSharingWithTeamInOrg                     = "Enabled"
            AllowSharingPrivateChannelWithTeamInOrg       = "Enabled"
            DefaultChannelTypeOnCreation                  = "Standard"
            Ensure                                        = 'Present'
            ApplicationId                                 = $ApplicationId
            TenantId                                      = $TenantId
            CertificateThumbprint                         = $CertificateThumbprint
        }
    }
}

Example 2

This example adds a new Teams Channels Policy.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        TeamsChannelsPolicy 'TeamsChannelsPolicy-Example'
        {
            Identity                                      = 'New Channels Policy'
            Description                                   = 'Enables private and shared channels for project and partner teams' # Updated Property
            AllowChannelSharingToExternalUser             = $True
            AllowOrgWideTeamCreation                      = $True
            EnablePrivateTeamDiscovery                    = $True
            AllowPrivateChannelCreation                   = $True
            AllowSharedChannelCreation                    = $True
            AllowUserToParticipateInExternalSharedChannel = $True
            AllowCreateChannel                            = "Enabled"
            AllowCreateClassicChannel                     = "Enabled"
            AllowCreatePrivateChannel                     = "Enabled"
            AllowCreateSharedChannel                      = "Enabled"
            CreateSharedChannelsByDefault                 = "Disabled"
            AllowUsersFromOutsideTeam                     = "Enabled"
            AllowGuestsFromOutsideTeam                    = "Disabled"
            AllowUsersFromOutsideTeamInPrivateChannel     = "Enabled"
            AllowGuestsFromOutsideTeamInPrivateChannel    = "Disabled"
            AllowSharingWithTeamInOrg                     = "Enabled"
            AllowSharingPrivateChannelWithTeamInOrg       = "Enabled"
            DefaultChannelTypeOnCreation                  = "Standard"
            Ensure                                        = 'Present'
            ApplicationId                                 = $ApplicationId
            TenantId                                      = $TenantId
            CertificateThumbprint                         = $CertificateThumbprint
        }
    }
}

Example 3

This example adds a new Teams Channels Policy.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        TeamsChannelsPolicy 'TeamsChannelsPolicy-Example'
        {
            Identity              = 'New Channels Policy'
            Ensure                = 'Absent'
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}