The remote server returned an error: (401) Unauthorized SharePoint 2013/2016 CSOM

Hello SharePointers,
When your CSOM scripts in SharePoint 2013 fails with the error message
  “The remote server returned an error: (401) Unauthorized.
The resolution is to add new settings in web.config of your web application.
<appSettings>
AllowAnonymousImpersonation” value=”false” />
</appSettings>

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published.