The term 'New-CsTeamsComplianceRecordingPolicy' is not recognized as the name of a cmdlet

Jay 1 Reputation point
2021-05-12T04:58:07.157+00:00

I am creating Policy Recording Bot in Microsoft Teams as per the below URL
https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/LocalMediaSamples/PolicyRecordingBot#create-a-recording-policy

I have created a bot in Azure.
I am able to create Application instance using below powershell command
New-CsOnlineApplicationInstance -UserPrincipalName <upn@Company portal .com> -DisplayName <displayName> -ApplicationId <your_botappId>

Now working on creating Recording Policy with the below command in Powershell

New-CsTeamsComplianceRecordingPolicy -Enabled $true -Description "Test policy created by <yourName>" <policyIdentity>

But while executing this command getting the following message -

The term 'New-CsTeamsComplianceRecordingPolicy' 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.
+ CategoryInfo : ObjectNotFound: (New-CsTeamsComplianceRecordingPolicy:String) [], CommandNotFoundExcepti
on
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : api.interfaces.records.teams.microsoft.com

I have installed PowerShell version 2.3.1 of Microsoft Teams. Also "New-CsTeamsComplianceRecordingPolicy" this command exists in the module "MicrosoftTeams".

Could you please assist?

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
726 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,969 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,757 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. svijay-MSFT 5,201 Reputation points Microsoft Employee
    2021-05-13T12:15:04.517+00:00

    @Jay Thanks for your question. I did a quick check at my end and I was able to call the cmdlet 'New-CsTeamsComplianceRecordingPolicy'.

    You have mentioned that you have installed the version 2.3.1 of Microsoft Teams. First thing would be check the possibility of multiple versions of the module being installed. Recommend you to Run the below command, you will see all the Modules with MicrosoftTeams

    Get-Module *Teams* -ListAvailable  
    

    96279-image.png

    If you see multiple versions - request you to remove all the older versions .

    Uninstall-Module MicrosoftTeams -RequiredVersion 1.1.6  
    

    Now, you could freshly import the Microsoft teams module Import-Module MicrosoftTeams.

    If there is just one version - 2.3.1 - there could be a possibility of corrupt installation. Please uninstall the MicrosoftTeams and reinstall the module.

    Remove-Module MicrosoftTeams  
    Uninstall-Module MicrosoftTeams  
     
    Install-Module MicrosoftTeams  -RequiredVersion 2.3.1  
    Import-Module MicrosoftTeams   
    

    Also , check whether the command is existent by running Get-command New-CsTeamsComplianceRecordingPolicy .

    96364-image.png

    Once you confirm similar output at your end, try running the cmdlet.