0

I'm having a hard time connecting to Microsoft Teams with Microsoft Orchestrator 2016. When I run my powershell code with RunbookTester, the code ends successfully. However, when I use another platform to test the same runbook, there is always a problem with the connection. I've checked and the module is well instled and imported. Here is my code:

  $User = "xxx@contoso.com"
  $PassWord = ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force
  $UserCredential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $PassWord

  Connect-MicrosoftTeams -Credential $UserCredential

The errors occurs in the last command, with the credentials, which is strange because this does not happen when I run the runbook with runbookTester. I've done some research and found this command:

 Set-ExecutionPolicy RemoteSigned

I'm not sure what this command does and if it will solve my problem. Has someone has the same problem? How can I fix this?

Sam
  • 247
  • 5
  • 16
  • What is the exact error message you get? Please include this in your post. – zett42 Mar 06 '21 at 18:14
  • Sorry for the delay, but it«s mostly SocketException, HttpRequestException, WebException and AggregateException – Sam Mar 12 '21 at 15:47

0 Answers0