I seem to have figured it out using my version of PnP PowerShell. I went into windows Settings > Accounts > Email & accounts and added my other work accounts there.
How to sign out of SSO on PnP PowerShell for SP Online?
When I use PnP PowerShell, I use this to connect
Connect-PnPOnline -Url "https://xxxxxxxxx.sharepoint.com/sites/xxxxxxxxxx" -UseWebLogin
And normally this will give me a box to pick an account. However I reformatted my machine recently and now it's bypassing the option to pick a new account and just trying to sign in with some default account that won't have access and then throws an error. I'm looking for a way to sign out of that default account and let me enter in a new account.
I did some research and they say to first sign out using
Connect-PnPOnline -Url "https://xxxxxxxxxxx.sharepoint.com" -SPOManagementShell -ClearTokenCache;
I did this, but when I use the weblogin again, it again just tries to sign in with that same account.
I also opened IE and deleted all the cache and cookies. I went on that site manually and signed out there, but nothing worked.
I am on SharePointPnPPowerShellOnline 3.29.2101.0.
How can this be resolved?
2 additional answers
Sort by: Most helpful
-
Echo Du_MSFT 17,216 Reputation points
2021-03-02T09:24:44.76+00:00 Hello @Ryan ,
You can execute the following command:
Connect-PnPOnline -Url "https://contoson.sharepoint.com/sites/echo" -Interactive
More information, please refer to this article.
Thanks,
Echo Du====================
Updated Answer ===================Hi @Ryan ,
It is recommended that you better use the latest version of the PnP PowerShell Module.
#Uninstall any edition of PnP PowerShell Uninstall-Module -Name "SharePointPnPPowerShellOnline" -AllVersions -Force #Install the new module: Install-Module -Name "PnP.PowerShell"
Thanks,
Echo Du====================
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Ryan 191 Reputation points
2021-03-02T14:56:30.177+00:00 I tried that, but that flag doesn't exist in the pnp powershell version I have
SharePointPnPPowerShellOnline 3.29.2101.0
I am on the legacy one still as I cannot run the new one due to permissions not granted. I would like to resolve it using this version for now.