Share via

Connect-MicrosoftTeams interactive login

Anonymous
2021-03-14T08:13:53+00:00

I have found that when certain individuals are running Connect-MicrosoftTeams in PowerShell 7, PowerShell opts for browser-based authentication instead and displays a code to use for authentication. I can’t find any documentation on this option, and moreover can’t replicate this experience... Has anyone else experienced this inconsistency? Is there a parameter i wonder to force the use of this interactive means of MFA..?

Microsoft Teams | Microsoft Teams for business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2021-03-14T19:15:57+00:00

    Hello PhoneMe007,

    Thanks for your post here.

    According to your description, may I understand that you'd like to run the command like the following screenshot?

    If not, please feel free to correct me. If so, please make sure you only run this command as I type in my screenshot and don't include other commands like Import-Module MicrosoftTeams $credential = Get-Credential

    Based on my test, if we have installed the Teams PowerShell module, we can run the command Connect-MicrosoftTeams and sign in with our account in the pop-up page.

    If you need more help or I misunderstand your meaning, please kindly share some screenshots when you run the command with me and I will continue to help you.

    Regards,

    Seven

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-03-15T10:03:24+00:00

    Hi Seven, the login and MFA is not a problem with the old Skype Online connector. The app opens a specific login url in a popup, the user signs in and does MFA, and Microsoft returns a token. This token is then used with the old connector to open a session. (Doesn't matter what MFA they have) and we can use this to run the Powershell commands.

    With the new connector, the app gets apopup automatically if the app doesn't provide any parameters with the Connect-MicrosoftTeams command, but we can't have our azure app somehow "transfer" or make this popup available to the end user. The powershell commands would be run in AWS Lambda, which the end user does not have direct access to. There's also no concept of pop-ups or browsers, or "windows" in lambda.

    But this could be solved via the interactive login https://microsoft.com/devicelogin where we could ask them for the code as in:

    They could then enter the code and allow the Powershell commands to progress.

    This seems to work for some, as in the article above, but not for us...

    0 comments No comments
  3. Anonymous
    2021-03-14T22:00:32+00:00

    Hi PhoneMe007,

    Thanks for your quick reply.

    I understand that you'd like to sign in using the browser-based authentication. The image you post is what you want. However, may I know the current situation after you run the command? 

    Any screenshots would be highly appreciated. Thanks for your cooperation and understanding.

    Regards,

    Seven

    0 comments No comments
  4. Anonymous
    2021-03-14T21:17:44+00:00

    To add, haven't had any luck getting the interactive code using either 7.0.5, 7.1.2 or 7.20-preview.

    0 comments No comments
  5. Anonymous
    2021-03-14T19:28:32+00:00

    Hi Seven

    Others are experiencing the following, which I'd like to use, as accounts with MFA enabled can't be programmatically used.

    Image

    Which provides MFA code via the web browser.

    When running Connect-MicrosoftTeams in PowerShell 7, PowerShell opts for browser-based authentication instead and displays a code to use for authentication.

    You navigate to https://microsoft.com/devicelogin and enter the code to authenticate. With the code entered, enter a username and password or select an existing account to log in. Once successfully authenticated, close the browser window and return to the PowerShell console.

    See here 

    https://jeffbrown.tech/microsoft-releases-new-microsoft-teams-powershell-module/

    Thanks

    phoneme007

    0 comments No comments