In this article, I’ll explain how we resolve exception “Method not found: ‘Boolean System.Net.WebResponse.get_SupportsHeaders()’.” while calling “ExecuteQuery” method of ClientContext in PowerShell script, while executing against SharePoint online / Office 365. Finally, I’ll also share the software requirements to access/manage/connect Office 365/SharePoint online and few references.
We are writing one PowerShell script and testing in between to verify the result. Following is the sample code snippet, which we executed and ran the script.

The issue is in the PowerShell script, mentioned above; we are getting the exception, mentioned below, on $clientContext.ExecuteQuery()
Exception calling “ExecuteQuery” with “0” argument(s): “Method not found: ‘Boolean System.Net.WebResponse.get_SupportsHeaders()’.”

This exception took us lot of time to solve so I  thought to share 🙂

We are really wondering why suddenly such an error is coming up since PowerShell scripts were running fine before. We already executed lots of scripts without any issues.

We verified UserName, PassWord, SiteURL and everything seems to be fine. We googled a lot but no luck. The only thing which we realized is that my laptop was formatted and the support team installed .NET Framework, client component SDK and the modules, mentioned below that are required for Office 365, SharePoint Online.

    Microsoft Online Service Sign-in Assistant for IT Professionals RTW.
    Windows Azure Active Directory Module for Windows PowerShell (64-bit version).
    SharePoint Online Management Shell.

After looking at the installed software, I realized that there is .NET Framework 4, which is installed but to access/manage/connect to Office 365/SharePoint online we need .NET Framework 4.5.x. We have installed .NET Framework 4.5 and the script is executed successfully without any issue.

Here, I’ll share a complete list of the SWs required for accessing/managing/connecting to Office 365/SharePoint online, using PowerShell.
Windows (64 bit)
Windows 7 with service pack1
Windows 8 or Windows 8.1
Windows server 2008 R2 SP1
Windows server 2012 or Windows server 2012 R2

.NET Framework 4.5.x – Installing the .NET Framework
Windows Management Framework 3.0 or Windows Management Framework 4.0

SharePoint 2013 Hosting Recommendation’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.

hostforlife banner