I run the following PnP command:

Connect-PnPOnline -Url "https://***.sharepoint.com/sites/ApprovalProcess/" -UseWebLogin

Now a dialog will open and login me automatically, and when I try to perform any action I will get access denied.

So seem I am been login using different username. How I can force the above command to ask me for the username and password and without logging me in automatically?

  • Which one is your default browser? Did you save the password of another account in your browser? Nov 17, 2020 at 15:27
  • @GaneshSanap default browser is Edge and i am not login to any account on it...
    – John John
    Nov 17, 2020 at 18:17

2 Answers 2


In fact the dialogue uses the Internet Explorer cache and cookies. If you clear them, the web login should ask again for a user (you need to reopen the PowerShell instance).

Another approach is to use the parameter SPOManagementShell instead of UseWebLogin. This does not allow you to pick from "cached" logins though.



Update your PnP PowerShell modules to latest version and try using below command:

Connect-PnPOnline -Url "https://***.sharepoint.com/sites/ApprovalProcess/" -UseWebLogin -ForceAuthentication

Reference: Twitter post by official PnP PowerShell account

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.