The lovely error in full
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 https://XXXXX.sharepoint.com -Credential
+ CategoryInfo : NotSpecified: (:) [Connect-SPOService], XmlExcep
+ FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.Online.SharePo int.PowerShell.ConnectSPOService
Diagnosing the problemSo I was fiddling around with my new work laptop from home the other day and came across this error. Obviously my first port of call was the universal error solving service known as Google and this threw up a couple of likely candidates:
- DTD error with Connect-SPOService
- Error: Resolved : Connect-SPOService : For security reasons DTD is prohibited in this XML document.
Both of these point to the person's local ISP being "helpful" by automatically intercepting unresolved URLs and suggesting alternatives. Both of these cases were in the UK and both were for people using Virgin Media so their resolutions weren't going to apply to me as I use the ever delightful BT for my home broadband.
Finding the resolution
The error itself gave me a pathway to finding out what BT's equivalent "Advanced Search Service" (Virgin's delightful name for their routine interception of your web traffic) was. Realising that rather than the expected response, the PowerShell cmdlet was getting back some kind of XML document, and making the wild leap in logic that if it was an ISP search 'helper' page that the "some kind of XML document" might (just might) be a web page, I fired up Fiddler and ran the Connect cmdlet again.
This gave me the actual XML (well, OK, HTML) returned by BT's service, which I then copied into a .htm file and viewed it in the browser. This gave me the web address "http://www.webaddresshelp.bt.com/" which I then imaginatively used to search for "disable bt webaddress help". That took me to this page which has the important link with the following advice:
I used to see search results from Google/Live when I entered a keyword into the address bar. I don't want to see Yahoo! results.
You can still perform a search in the browser search box - this can be set to show results from the major search engines of your choice.
Alternatively you can opt-out of the service at any time. Just turn it off in BT Web Address Help Preferences. (You need to be connected to your home broadband line to access preferences.)
The link above only works if you're connected to your BB router, but once you are you can simply select 'disable' and save and voila! Connect-SPOService now works like a charm.