Forum Discussion
Aim Zaab
Oct 05, 2018Brass Contributor
PowerShell cannot connect with stored credential when legacy auth is disabled
If I disable legacy auth, I don't seem to be able to connect to SharePoint with stored credentials. Connect-SPOService -Url <adminUrl>-Credential $UserCredential The cmdlet above is not worki...
VasilMichev
Oct 05, 2018MVP
Using the -Credentials switch for the Connect-SPOService forces it to switch to legacy auth, thus you are getting blocked by the CA policy. You either need to use the interactive login, or configure client secret/cert if you want to do automation. Or exclude the account in question from the CA policy.
Aim Zaab
Oct 06, 2018Brass Contributor
OK, I see. And it seems to be the same for PnP PowerShell.
It's a bit of a shame, as it's working for Azure AD and Teams, I guess it could work for SharePoint too.
It's a bit of a shame, as it's working for Azure AD and Teams, I guess it could work for SharePoint too.