powershell connect-microsoftteams already connected profile

Felippe Silvestre 0 Reputation points
2024-03-14T17:37:02.52+00:00

I have a powershell script that I run repeatedly. My user are already connected to my work MS account. Is there a way to not run the connect-microsoftteams command - as it is already connected?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,627 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,329 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LiweiTian-MSFT 16,845 Reputation points Microsoft Vendor
    2024-03-15T01:46:35.3633333+00:00

    Hi @Felippe Silvestre

    The Connect-MicrosoftTeams cmdlet connects an authenticated account for use with cmdlets from the MicrosoftTeams module.

    Whenever your user needs to start using the Microsoft Teams PowerShell module, the user needs to use connect-microsoftteams to call cmdlets from the Microsoft Teams module. Even if the user is already logged into your account from another application.

    ********************************************************************************************************* If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. *********************************************************************************************************