7.1 Start Teams as‐a‐code configuration ‐ policies - dcasota/m365-scripts GitHub Wiki

Create and assign a Teams messaging policy

In https://learn.microsoft.com/en-us/training/modules/guided-project-create-assign-teams-policies.introduction/ you get a step-by-step guide for how to manage messaging policies. The beginning of the step-by-step guide works flawlessly.

Create a static security group.

Add members.

Create a messaging policy "GIFs disabled".

Assign to group.

Create and assign a Teams meeting policy

In the next exercise of the guided project, the goal is to create a teams meeting policy, however the powershell cmdlet suggested would grant a messaging policy.

The correct powershell cmdlet is grant-CsTeamsMeetingPolicy, see https://learn.microsoft.com/en-us/microsoftteams/who-can-bypass-meeting-lobby#set-meeting-policies-by-using-powershell.

To check the policy settings, you can use the get-CsTeamsMeetingPolicycmdlet:

get-CsTeamsMeetingPolicy -Identity "No Lobby and no remote control" | select-Object {$_.AutoAdmittedUsers}

To check the security group id, the Microsoft module named Az has to be installed.

PS C:\Users\dcaso> connect-azaccount

Account                        SubscriptionName TenantId                             Environment
-------                        ---------------- --------                             -----------
[email protected]              xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx AzureCloud


PS C:\Users\dcaso> get-azadgroup

DisplayName                         Id                                   MailNickname                         Descripti
                                                                                                              on
-----------                         --                                   ------------                         ---------
Mark 8 Project Team                 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Mark8ProjectTeam                     Welcom...
TeamsRoomsAccounts_dynamic          xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 0aa56c14-e                            Colle...
Digital Initiative Public Relations xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx DigitalInitiativePublicRelations     Descri...
MSFT                                xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx MSFT                                 MSFT
tax specialists                     xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 00000000-0000-0000-0000-000000000000 tax sp...
U.S. Sales                          xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx U.S.Sales                            Descri...
Sales and Marketing                 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SalesandMarketing                    Descri...
Retail                              xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Retail                               Descri...
Sample Team Site                    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx SampleTeamSite                       Sample...

With Get-CsGroupPolicyAssignment you can check the Group Policy Assignment.

PS C:\Users\dcaso> Get-CsGroupPolicyAssignment -PolicyType TeamsMeetingPolicy | where-object {$_.GroupId -eq (get-azadgroup | where-object {$_.DisplayName -eq "tax specialists"}).Id }

GroupId                              PolicyType         PolicyName                     Rank CreatedTime         CreatedBy
-------                              ----------         ----------                     ---- -----------         ---------
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx TeamsMeetingPolicy No Lobby and no remote control 1    17.09.2023 14:37:14 xxxxxxxx-xxxx-xxxx-x...

Prepare meeting room experiences

In https://learn.microsoft.com/en-us/training/modules/guided-project-prepare-meeting-room-experiences/6-exercise-configure-mailbox-properties the powershell cmdlet get-calendarprocessing is used. Despite of the module mentioned in Microsoft's literature, it is NOT named ExchangePowershell from the powershellgallery. The Microsoft module to be installed is named ExchangeOnlineManagement. Install the module and - very important - connect to Exchange Online. With a successfully login, additional cmdlets are installed.

PS C:\Users\dcaso> install-module ExchangeOnlineManagement
PS C:\Users\dcaso> connect-exchangeonline

----------------------------------------------------------------------------------------
This V3 EXO PowerShell module contains new REST API backed Exchange Online cmdlets which doesn't require WinRM for Client-Server communication. You can now run these cmdlets after turning off WinRM Basic Auth in your client machine thus making it more secure.

Unlike the EXO* prefixed cmdlets, the cmdlets in this module support full functional parity with the RPS (V1) cmdlets.

V3 cmdlets in the downloaded module are resilient to transient failures, handling retries and throttling errors inherently.

REST backed EOP and SCC cmdlets are also available in the V3 module. Similar to EXO, the cmdlets can be run without WinRM basic auth enabled.

For more information check https://aka.ms/exov3-module
----------------------------------------------------------------------------------------

PS C:\Users\dcaso> get-module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     3.3.0      ExchangeOnlineManagement            {Add-VivaModuleFeaturePolicy, Get-ConnectionInformation, G...
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Binary     1.0.0.1    PackageManagement                   {Find-Package, Find-PackageProvider, Get-Package, Get-Pack...
Script     1.0.0.1    PowerShellGet                       {Find-Command, Find-DscResource, Find-Module, Find-RoleCap...
Script     2.0.0      PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PS...
Script     1.0        tmpEXO_zmfnjmox.z5s                 {Add-AvailabilityAddressSpace, Add-DistributionGroupMember...

The additional cmdlets installed are inside the tmpEXO...-module and the module contains e.g. get-calendarprocessing.

The exercise example https://learn.microsoft.com/en-us/training/modules/guided-project-prepare-meeting-room-experiences/6-exercise-configure-mailbox-properties works now flawlessly.

PS C:\Users\dcaso> Get-CalendarProcessing -Identity "[email protected]" | Format-List


AutomateProcessing                   : AutoAccept
AllowConflicts                       : False
AllowDistributionGroup               : True
AllowMultipleResources               : True
BookingType                          : Standard
BookingWindowInDays                  : 180
MaximumDurationInMinutes             : 1440
MinimumDurationInMinutes             : 0
AllowRecurringMeetings               : True
EnforceAdjacencyAsOverlap            : False
EnforceCapacity                      : False
EnforceSchedulingHorizon             : True
ScheduleOnlyDuringWorkHours          : False
ConflictPercentageAllowed            : 0
MaximumConflictInstances             : 0
ForwardRequestsToDelegates           : True
DeleteAttachments                    : True
DeleteComments                       : True
RemovePrivateProperty                : True
DeleteSubject                        : True
AddOrganizerToSubject                : True
DeleteNonCalendarItems               : True
TentativePendingApproval             : True
EnableResponseDetails                : True
OrganizerInfo                        : True
ResourceDelegates                    : {}
RequestOutOfPolicy                   : {}
AllRequestOutOfPolicy                : False
BookInPolicy                         : {}
AllBookInPolicy                      : True
RequestInPolicy                      : {}
AllRequestInPolicy                   : False
AddAdditionalResponse                : False
AdditionalResponse                   :
RemoveOldMeetingMessages             : True
AddNewRequestsTentatively            : True
ProcessExternalMeetingMessages       : False
RemoveForwardedMeetingNotifications  : False
AutoRSVPConfiguration                : Microsoft.Exchange.Data.Storage.AutoRSVPConfiguration
RemoveCanceledMeetings               : False
EnableAutoRelease                    : False
PostReservationMaxClaimTimeInMinutes : 10
MailboxOwnerId                       : MTR-US-Seattle 24 3 35
Identity                             : MTR-US-Seattle 24 3 35
IsValid                              : True
ObjectState                          : Changed

Powershell modules

Here the most frequently used powershell modules.

PS C:\Users\dcaso> find-module Microsoft.Graph.*

Version    Name                                Repository           Description
-------    ----                                ----------           -----------
2.6.0      Microsoft.Graph.Authentication      PSGallery            Microsoft Graph PowerShell Authentication Module.
6.1907.1.0 Microsoft.Graph.Intune              PSGallery            PowerShell SDK for Microsoft Intune Graph API
2.6.0      Microsoft.Graph.Groups              PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Teams               PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Users               PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Planner             PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Identity.Directo... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Applications        PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Identity.SignIns    PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.DeviceManagement    PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Users.Actions       PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Devices.Corporat... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.DeviceManagement... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Identity.Governance PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Sites               PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.People              PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Mail                PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Security            PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Bookings            PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Notes               PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.CrossDeviceExper... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.SchemaExtensions    PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Files               PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Education           PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Users.Functions     PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.CloudCommunications PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.PersonalContacts    PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Reports             PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Compliance          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.DeviceManagement... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Calendar            PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.DeviceManagement... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.DirectoryObjects    PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Search              PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.ChangeNotifications PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Devices.CloudPrint  PSGallery            Microsoft Graph PowerShell Cmdlets
1.28.0     Microsoft.Graph.DeviceManagement... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Devices.ServiceA... PSGallery            Microsoft Graph PowerShell Cmdlets
1.28.0     Microsoft.Graph.Financials          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.SchemaExten... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Notes          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Compliance     PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.CrossDevice... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Identity.Pa... PSGallery            Microsoft Graph PowerShell Cmdlets
1.5.4      Microsoft.Graph.PlusPlus            PSGallery            Module to work the Microsoft Graph API using bot...
1.0.0      Microsoft.Graph.Migration.Tool      PSGallery            Microsoft Graph PowerShell Migration Advisor Module
1.28.0     Microsoft.Graph.WindowsUpdates      PSGallery            Microsoft Graph PowerShell Cmdlets
1.28.0     Microsoft.Graph.ManagedTenants      PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.DeviceManagement... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Identity.Partner    PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Identity.Di... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.DeviceManag... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.DeviceManag... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Devices.Cor... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Users          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Identity.Go... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Identity.Si... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Teams          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.DeviceManag... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.DirectoryOb... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Groups         PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.DeviceManag... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Reports        PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Applications   PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Devices.Ser... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.DeviceManag... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta                PSGallery            Microsoft Graph PowerShell module
2.6.0      Microsoft.Graph.Beta.Financials     PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Users.Funct... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Sites          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Bookings       PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Education      PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Devices.Clo... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Planner        PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.ManagedTenants PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Calendar       PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Search         PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.CloudCommun... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.ChangeNotif... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Mail           PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Files          PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.People         PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Users.Actions  PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.PersonalCon... PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.WindowsUpdates PSGallery            Microsoft Graph PowerShell Cmdlets
2.6.0      Microsoft.Graph.Beta.Security       PSGallery            Microsoft Graph PowerShell Cmdlets