When connecting to online site we have Microsoft authentication call to our phones and we will enter our pin for authenticating.Then only we can access the site.
But in csom code when conencting to site I am getting the error:
"Exception calling "ExecuteQuery" with "0" argument(s): "The sign-in name or password does not match one in the Microsoft account system.".
Here is my code:
$ctx=New-Object Microsoft.Sharepoint.Client.ClientContext($siteCollUrl) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $securePassword) $web=$ctx.Web $ctx.Load($web) $ctx.ExecuteQuery() How can I access the site if MFA is enabled through csom pwoershell. please suggest.
