Hi guys,
I have a simple runbook and it has a PowerShell script which prints out all our SharePoint sites information.
The script works with an account that does not have MFA but I need to use an account with MFA. Than I run the script with MFA account than I got an error:
Connect-SPOService : The partner returned a bad sign-in name or password error. For more information, see Federation
Error-handling Scenarios.
At line:6 char:2
+ Connect-SPOService -Url $SPOAdminSiteUrl -Credential $PSCred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-SPOService], IdcrlException
+ FullyQualifiedErrorId :
Microsoft.SharePoint.Client.IdcrlException,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService
Get-SPOSite : No connection available. Use Connect-SPOService before running this CmdLet.
At line:7 char:2
+ Get-SPOSite -Limit all | ForEach-Object { Write-Output ("Site: " + $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SPOSite], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.Online.SharePoint.PowerShell.GetSite
My question is that how can I run a script with an account that has MFA ?
thank you,