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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading