Microsoft Tech Community Live:  Microsoft Teams Edition
November 09, 2021, 08:00 AM - 12:00 PM (PST)

The term 'New-CsTeamsComplianceRecordingPolicy' is not recognized

%3CLINGO-SUB%20id%3D%22lingo-sub-2347490%22%20slang%3D%22en-US%22%3EThe%20term%20'New-CsTeamsComplianceRecordingPolicy'%20is%20not%20recognized%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2347490%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20creating%20Policy%20Recording%20Bot%20in%20Microsoft%20Teams%20as%20per%20the%20below%20URL%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmicrosoft-graph-comms-samples%2Ftree%2Fmaster%2FSamples%2FV1.0Samples%2FLocalMediaSamples%2FPolicyRecordingBot%23create-a-recording-policy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmicrosoft-graph-comms-samples%2Ftree%2Fmaster%2FSamples%2FV1.0Samples%2FLocalMediaSamples%2FPolicyRecordingBot%23create-a-recording-policy%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20have%20created%20bot%20in%20Azure.%3CBR%20%2F%3EI%20am%20able%20to%20create%20Application%20instance%20using%20below%20powershell%20command%3CBR%20%2F%3ENew-CsOnlineApplicationInstance%20-UserPrincipalName%20%3CUPN%3E%20-DisplayName%20%3CDISPLAYNAME%3E%20-ApplicationId%20%3CYOUR_BOTAPPID%3E%3C%2FYOUR_BOTAPPID%3E%3C%2FDISPLAYNAME%3E%3C%2FUPN%3E%3C%2FP%3E%3CP%3ENow%20working%20on%20creating%20Recording%20Policy%20with%20the%20below%20command%20in%20Powershell%3C%2FP%3E%3CP%3ENew-CsTeamsComplianceRecordingPolicy%20-Enabled%20%24true%20-Description%20%22Test%20policy%20created%20by%20%3CYOURNAME%3E%22%20%3CPOLICYIDENTITY%3E%3C%2FPOLICYIDENTITY%3E%3C%2FYOURNAME%3E%3C%2FP%3E%3CP%3EBut%20while%20executing%20this%20command%20getting%20following%20message%20-%3C%2FP%3E%3CP%3EThe%20term%20'New-CsTeamsComplianceRecordingPolicy'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%3CBR%20%2F%3Eoperable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%3CBR%20%2F%3Eagain.%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(New-CsTeamsComplianceRecordingPolicy%3AString)%20%5B%5D%2C%20CommandNotFoundExcepti%3CBR%20%2F%3Eon%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20CommandNotFoundException%3CBR%20%2F%3E%2B%20PSComputerName%20%3A%20api.interfaces.records.teams.microsoft.com%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20have%20installed%20powershell%20version%202.3.1%20of%20Microsoft%20Teams.%20Also%20%22New-CsTeamsComplianceRecordingPolicy%22%20this%20command%20exists%20in%20the%20module%20%22MicrosoftTeams%22.%3C%2FP%3E%3CP%3ECould%20you%20please%20assist.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2347490%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBots%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2348123%22%20slang%3D%22en-US%22%3ERe%3A%20The%20term%20'New-CsTeamsComplianceRecordingPolicy'%20is%20not%20recognized%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2348123%22%20slang%3D%22en-US%22%3EHello%2C%20any%20difference%20if%20you%20import%20the%20module%20to%20the%20session%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2353607%22%20slang%3D%22en-US%22%3ERe%3A%20The%20term%20'New-CsTeamsComplianceRecordingPolicy'%20is%20not%20recognized%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2353607%22%20slang%3D%22en-US%22%3E%3CP%3ENo.%20In%20the%20Import%20Module%20the%20command%20-New-CsTeamsComplianceRecordingPolicy%20is%20exists.%20But%20While%20executing%20it%20gives%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

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/Loca...

I have created 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 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.

3 Replies
Hello, any difference if you import the module to the session?

No. In the Import Module the command -New-CsTeamsComplianceRecordingPolicy is exists. But While executing it gives error.

Well, the message says it's not available for use as it cannot be found. I would probably start over, remove and reinstall.