Microsoft Teams – Resolving error – “Set-CsTeamsMeetingPolicy : The term ‘Set-CsTeamsMeetingPolicy’ is not recognized as the name of a cmdlet, function, script file, or operable program.” – Executing Microsoft Teams PowerShell CMDLETs

Microsoft Teams - Error while executing CMDLET - Set-CsTeamsMeetingPolicy
Microsoft Teams - Error while executing CMDLET - Set-CsTeamsMeetingPolicy

Hi All,

Greetings for the day!!! Today new small issue and solution!!!

Background / Details :

  • I was going through the Microsoft Teams major update – Teams Meeting Recordings Auto-Expiration in OneDrive and SharePoint
  • Default auto expiration date for Teams recordings are 120 days
  • We can update default expiration date by either using PowerShell or Microsoft Teams admin center
  • So I went and tried with PowerShell using the cmdlet – Set-CsTeamsMeetingPolicy

Set-CsTeamsMeetingPolicy -Identity Global -NewMeetingRecordingExpirationDays 50

  • On execution of the above CMDLET we got an error

Issue / Error :

Set-CsTeamsMeetingPolicy : The term ‘Set-CsTeamsMeetingPolicy’ is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1

Set-CsTeamsMeetingPolicy -Identity Global -NewMeetingRecordingExpirat …

CategoryInfo : ObjectNotFound: (Set-CsTeamsMeetingPolicy:String) [], CommandNotFoundException

FullyQualifiedErrorId : CommandNotFoundException

Microsoft Teams - Error while executing CMDLET - Set-CsTeamsMeetingPolicy
fig : Microsoft Teams – Error while executing CMDLET – Set-CsTeamsMeetingPolicy

Solution :

  • By looking at error it seems Microsoft Teams module is not installed
  • We need to install Microsoft Teams module by using Install-Module CMDLET as

Install-Module MicrosoftTeams

Microsoft Teams - Installing Module - MicrosoftTeams
fig : Microsoft Teams – Installing Module – MicrosoftTeams

  • Make sure MicrosoftTeams module installed successfully
  • Once MicrosoftTeams module installed successfully, we are ready to execute our CMDLET
  • To execute our CMDLET – Set-CsTeamsMeetingPolicy we need to connect to Microsoft Teams first using – Connect-MicrosoftTeams as

Connect-MicrosoftTeams

Account Environment Tenant TenantId
-------                                    ----------- ------                         
prasham@knowledgejunction1.onmicrosoft.com AzureCloud  6b38e1c3-a1fe-40cc-8b93-a4159a50592c 6b38e1c3-a1fe-40cc-8b93-a4159a50592c

Microsoft Teams - Connecting Microsoft Teams - Connect-MicrosoftTeams
fig : Microsoft Teams – Connecting Microsoft Teams – Connect-MicrosoftTeams

  • As we connected to Microsoft Teams, our CMDLET – Set-CsTeamsMeetingPolicy will executed successfully as

Set-CsTeamsMeetingPolicy -Identity Global -NewMeetingRecordingExpirationDays 50

Microsoft Teams - Executing Teams CMDLET - Set-CsTeamsMeetingPolicy
fig : Microsoft Teams – Executing Teams CMDLET – Set-CsTeamsMeetingPolicy

Thanks for reading !!! Please feel free to discuss in case any issue / suggestions / thoughts !!!

HAVE A GREAT TIME AHAED !!! LIFE IS BEAUTIFUL 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: