Forum Discussion
LC-DP
Sep 27, 2022Copper Contributor
Connect-MicrosoftTeams with credential
Hello Community Members, We are currently using the `Connect-MicrosoftTeams -Credential ` to automate our powershell script that signs in with usename and password. We wonder if the basic authent...
VasilMichev
Sep 28, 2022MVP
Using -Credentials still counts as Modern authentication, so you'll be fine even when Teams cuts off basic auth (it's separate from Exchange Online). Of course, if the account is protected by MFA, you cannot use this method.
They just announced preview for application authentication for the Teams module, this is what you should be using for automation needs going forward.
They just announced preview for application authentication for the Teams module, this is what you should be using for automation needs going forward.
- LC-DPSep 29, 2022Copper ContributorHi Vasil, thanks for your reply. Is there any reference as to what counts as Modern authentication and what's not?
- LainRobertsonSep 29, 2022Silver Contributor
So, basic authentication isn't something to do with PowerShell, but rather with the web service that your commandlets (i.e. Teams, Exchange Online, Azure AD, etc.) This means there is no "one rule fits all" answer to that question and you'd have to check each service individually.
For example, Exchange Online was originally published as a web service that made use of the basic authentication type - which you can read about in the first two paragraphs of their deprecation notice:
Teams, on the other hand (at least the newer, native Teams elements, not the previous Skype for Business components) was published without using basic authentication, which is why it's somewhat less of an issue.
But more importantly, in both cases, this has nothing to do with the Credentials parameter. All that does is provide a variable holding credentials. How those credentials are then used over the network to logon onto the service is out of your hands and purely a property of the web service itself.
If you're inclined to dig into the actual traffic using something like Fiddler, you can find your own answers based on the web request's authorisation header, but at least with Microsoft's services, you can usually find an answer on authorisation types for a given service on learn.microsoft.com.
Cheers,
Lain