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

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
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
- 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
- As we connected to Microsoft Teams, our CMDLET – Set-CsTeamsMeetingPolicy will executed successfully as
Set-CsTeamsMeetingPolicy -Identity Global -NewMeetingRecordingExpirationDays 50

Thanks for reading !!! Please feel free to discuss in case any issue / suggestions / thoughts !!!
HAVE A GREAT TIME AHAED !!! LIFE IS BEAUTIFUL 🙂
You must be logged in to post a comment.