I searched and the only thread that came up was MS Teams using Managed Identity
I am trying to Connect-MicrosoftTeams from a PSU script with a service account. On the PSU server, I can connect via Powershell terminal using the service account credentials, but I can’t seem to get it to work within a script. (I need to connect to configure numerous attributes that are not accessible via Graph API.)
I’ve created a Secret variable, teams_svc_acct, with the username and password. Snippet of script:
Import-Module MicrosoftTeams
Connect-MicrosoftTeams -Credential $Secret:teams_svc_acct
And this results in:
Error executing job: Failed to login user (1385). System.ComponentModel.Win32Exception (1385): Logon failure: the user has not been granted the requested logon type at this computer.
Appreciate any suggestions.
Product: PowerShell Universal
Version: 3.5.5