Monday, May 26, 2014

Error: Resolved : Connect-SPOService : For security reasons DTD is prohibited in this XML document.

Today, I could not connect to my tenant admin with PowerShell. When I execute PS command:
Connect-SPOService -Url

 I was getting the following error:
Connect-SPOService : For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.
At line:1 char:1
+ Connect-SPOService -Url

I checked that a latest version of the "SharePoint Online Management Shell" was installed on my local machine. But error was still occurring.

Later, I noticed problem reoccurs only from my home(Virgin Media) network and not when I connect through Azure Virtual machine. 
I also found connection to SharePoint online uses  Microsoft.SharePoint.Client.SharePointOnlineCredentials class. Checking this API I noticed culprit is my local Broadband provider "Advanced Search Service". which was intercepting my request. 
I have to google to stop my ISP to intercept this:: 

Opting out from this ISP Search service sorted the problem and finally managed to connect to SP Online service using Global Admin account.


Anonymous said...

Wow thank you so much. I had this error today and couldn't figure it out at all. I too have a Virgin Media account and when I tried my mobile wifi it worked fine. Switch back to Virgin and I get the error. It was driving me mad.

Thanks again for taking the time to post this article, you're a hero!

Anonymous said...

Just cannot thank you enough!!

No one would suspect the ISP for an unrelated error.

god bless

Anonymous said...

Thank you. Your blog post potentially saved me countless hours of frustration!!

Unknown said...

I faced this same issue and looked into it further. Its essentially a DNS problem on the ISP side. The feature that Virgin is using basically redirects users to a search page instead of giving an http 404 when a site can't be found.

My ISP didn't have an opt out option. I fixed it by setting my primary and secondary DNS to the free google DNS
Primary DNS IP for google is:
Secondary DNS IP for google is:

As soon as I changed my DNS it started working.

Anonymous said...

This is caused by ISP DNS Redirecting to search pages instead of giving 404. To solve use google free DNS

Google DNS IPs

Anonymous said...

I know you wrote this post a while ago, but I have just had the same issue and this fixed it so wanted to express my thanks.


westerdaled said...


This is a very insightful post : a mouse ciick and the issue is solved. Thanks . What I am curious about is how and were you noticed the intercept by Virginmedia?

Pryank Rohilla said...

Hi Westerdaled, Its been very long :)I think I noticed that any incorrect url request was getting redirect to VM Search results page rather default browser search engine, that helped to suspect my ISP is intercepting the traffic :)