I'd like to write a PowerShell script which will update Teams members from input list/object. However if I run Connect-MicrosoftTeams command (to authenticate/connect to cloud service) for the first time I am asked to pick an account to use for login. This is an issue since I would like this script to be run as scheduled job. Is there a way how to avoid this when running Connect-MicrosoftTeams command ? Commands I am using:

`$credential = Get-Credential`

`Connect-MicrosoftTeams -Credential $credential`

[![Connect-MicrosoftTeams credentials window](https://i.stack.imgur.com/hXMD7.png)](https://i.stack.imgur.com/hXMD7.png)

I tried to use "-AccountId "email@address.com" but that didn't help. Of course later I will change Get-Credential to username and encrypted password

***EDIT***

If I run `Connect-MicrosoftTeams -Credential $credential` on other computer, where I've never been logged in with my account, instead of "Pick an account" window, I get credential window for username and password:
[![Connect-MicrosoftTeams credentials window](https://i.stack.imgur.com/xm7au.png)](https://i.stack.imgur.com/xm7au.png)