Share via

Problem when running $Session=New-CsOnlineSession

Lyubomir Petrovski 1 Reputation point
2021-10-08T09:51:57.777+00:00

I'm trying to configure an Azure Call Recording Bot and I'm following this guide https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/LocalMediaSamples/PolicyRecordingBot#create-a-recording-policy sample.

I've made it to the step "Create an Application Instance" but I hit a wall when running "$Session=New-CsOnlineSession"

First command is:
Import-Module SkypeOnlineConnector

SkypeOnlineConnector is deprecated and it is advised to use Microsoft Teams instead.
https://learn.microsoft.com/en-us/skypeforbusiness/set-up-your-computer-for-windows-powershell/download-and-install-the-skype-for-business-online-connector

So instead of "Import-Module SkypeOnlineConnector" I run "Import-Module MicrosoftTeams" which was executed successfully. My MicrosoftTeams version is:
138788-136532942-92676f05-7c31-4a5a-868b-af332bed0d46.png

When I run the second line "$Session=New-CsOnlineSession" I get the following error and cannot continue further:
New-CsOnlineSession: The 'New-CsOnlineSession' command was found in the module 'MicrosoftTeams', but the module could not be loaded. For more information, run 'Import-Module MicrosoftTeams'.

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. Limitless Technology 40,101 Reputation points
    2021-10-11T07:57:53.25+00:00

    Hello

    I think this is what you are looking for:

    "When using Teams PowerShell Module 2.0 or later, update your scripts that refers New-CsOnlineSession to Connect-MicrosoftTeams. Import-PsSession is no longer required to establish a Skype for Business Online Remote PowerShell Session as that is done implicit when using Connect-MicrosoftTeams."

    Reference: https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-move-from-sfbo

    ------------------------------------------------------------------------------------------------------------------------------

    Hope this helps with your query,

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.