Resolving Wrong Tenant Credentials Error Even Though We Pass The Correct Credential

Introduction

 
Sometimes, while we work with PowerShell and SharePoint online, we may come across the above error. I will explain in which scenario we’ll get wrong tenant credential error while connecting to SharePoint online thru the PowerShell even though we pass the correct credential and how to fix it.
 

Issue Description

 
Recently, I was working on how to configure the hybrid environment for our tenant. In order to do that I had picked up the Hybrid Picker Wizard, followed the instructions, and started the configuration. At the initial steps, this will validate your on-premises SharePoint credential and SharePoint online credential. I was using the same account for both on-premise and online wherein on-premise SharePoint authentication was successful but authentication in SharePoint Online was failing – the error message was saying that “Wrong tenant credential.” like below.
 
It was strange!!! I had tried to log in to SharePoint online site using the same credential and it was successful, and tried to connect SharePoint online site through the ShareGate migration tool using the same credential, and it was successful. It became ever more strange.
 
In order to do the hybrid configuration as an alternative approach, Microsoft has provided two inbuilt PowerShell Script. I tried to execute those scripts there also but faced the same authentication issue.
 
When Do We Get Wrong Tenant Credential Error Even Though We Pass The Correct Credential
 

Solution

  1. If your account has MFA (multi-factor authentication) enabled in Azure AD, you cannot connect to SharePoint online using PowerShell or Hybrid Picker Wizard as a temporary solution for time being disable the MFA in Azure AD, then after getting your work done enable it back – after MFA disabling you will not face the above issue.
  2. Have a dedicated service kind of admin account without MFA enabled and use this account for all sorts of PowerShell execution with respect to SharePoint online and Hybrid Picker configuration – as per me this is recommended or good choice over the previous one.

Summary

 
Thus, in this tutorial, we have learned the reason for wrong tenant credential error and how to fix it.