question

Jay-4873 avatar image
0 Votes"
Jay-4873 asked SathyamoorthyVijayakumar-MSFT commented

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

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@contoso.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?

office-teams-app-devazure-bot-servicemicrosoft-graph-cloud-communications
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SathyamoorthyVijayakumar-MSFT avatar image
0 Votes"
SathyamoorthyVijayakumar-MSFT answered SathyamoorthyVijayakumar-MSFT commented

@Jay-4873 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.


image.png (15.8 KiB)
image.png (9.4 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Jay-4873 I wanted to drop in and check with you whether above information helped you

0 Votes 0 ·

Hi Sathyamoorthy,

Thanks for the replay.

I have tried to remove old version (1.0.7) but gives following error -
PackageManagement\Uninstall-Package : No match was found for the specified search criteria and module names 'MicrosoftTeams'.


Other version removed successfully.

Checking to remove the above old version.

Thanks,
Jayesh

0 Votes 0 ·

Are you able to import the module MS Teams. If No, can you go ahead proceed with installing the latest module and check whether the issue is reproducible ?

Install-Module MicrosoftTeams -RequiredVersion 2.3.1
Import-Module MicrosoftTeams

0 Votes 0 ·