How to Force Prompt for Sign-In with Connect-MgGraph?

March 22, 2026 2 answers
Asked by TechieTraveler92
I'm using the Connect-MgGraph command with my Client ID and Tenant ID for authentication, but I've run into an issue. After the first time I logged in, it doesn't prompt me for my credentials anymore and automatically logs me in every time I run the command. I want it to ask for my email and password each time I connect. I know that using Disconnect-MgGraph will prompt me for a username if the session is active, but if I close the shell session and reopen it, I can still connect without any authentication. How can I make it prompt me to sign in every time?

Answers

PowershellPenguin77
You could just use Connect-MgGraph without any extra options. But given that you're using both ClientId and TenantId, it seems like you're connecting to a different tenant than your logged-in user, so this might not work for your situation.
Reply to this answer
CommandGuruX
Try using the command Connect-MgGraph -ContextScope Process. This will help you bypass the Windows Authentication Manager (WAM), which is caching your credentials. This is great if you're juggling multiple sessions or clients. You can also set this as the default with PSDefaultParameters.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions