#SharePointProblems | Koskila.net

Solutions are worthless unless shared! Antti K. Koskela's Personal Professional Blog

Another fix to the "Connect-PnPOnline : The sign-in name or password does not match one in the Microsoft account system." error.

koskila
Reading Time 3 min
Word Count 370 words
Comments 2 comments
Rating 2.5 (2 votes)
View

This post describes a simple way to get around the following error while running Connect-PnPOnline: "The sign-in name or password does not match one in the Microsoft account system." Truthfully, this one is kind of simple and stupid - but as I've seen before, it's surely worth documenting anyway!

Below is an example of such an error.

PS C:\> Connect-PnPOnline https://contoso.sharepoint.com/sites/CommunicationSite/
Connect-PnPOnline : The sign-in name or password does not match one in the Microsoft account system.
At line:1 char:1
+ Connect-PnPOnline https://contoso.sharepoint.com/sites/CommunicationS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-PnPOnline], IdcrlException
    + FullyQualifiedErrorId : Microsoft.SharePoint.Client.IdcrlException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline

In my case, I had saved my credentials in a password manager, yet in a script, I was developing I ran into this error time and time again. I didn't remember encountering it before, so my natural first guess was that the password had expired.

However, I could log in with the account, so the password and username I was using were correct. Then what causes this?

Solution

Are you sure you have entered your username and password correctly? You are? Good.

Have you disabled the credential caching (see below)? Great.

https://www.koskila.net/oh-no-powershell-cached-my-azure-credentials-and-i-messed-up-wrong-customers-environment/

If you've avoided all the abovementioned pitfalls, you might've run into the same issue I did, and feel as stupid as me after reading the next sentence.

Quotes. You need quotes around the URL, even if it doesn't contain a space. This issue might manifest if you are pasting values in the PowerShell - which is exactly what I did.

Without the quotes, the cmdlet returns this error. While the error might not be the most informative at first sight, it actually makes sense: since the cmdlet is not able to figure out where it's trying to login with your credentials - technically, your sign-in name and password do not match the ones Microsoft supposedly has for whatever null tenant they're trying to authenticate you against.

So, make sure to try and authenticate against an URL that makes sense. One, that has quotes around it :)

Another thing to verify, as Faisal points out in the comments -section below, is that you're using -UseWebLogin switches if your user account has MFA turned on. Worth trying out in any case :)

Comments

Interactive comments not implemented yet. Showing legacy comments migrated from WordPress.
Faisal
2020-06-02 14:43:07)
In my case, it was down to MFA which was the cause of the issue, by running the following cmd I was able to connect without the sign-in name or password does not match error. Connect-PnPOnline "https://contoso.sharepoint.com/sites/CommunicationSite/" -UseWebLogin
Antti K. Koskela
2020-06-04 11:57:41

Hi Faisal,


Thanks for your comment! I've never seen this being caused by MFA, but it doesn't really sounds all that surprising, if I'm honest with you.. :D I'll add a mention to the article as well.


Thanks for your contribution!

Whitewater Magpie Ltd.
© 2025
Static Site Generation timestamp: 2025-08-21T07:25:14Z