Just recently I cannot connect to my tenant admin with PowerShell. When I call

Connect-SPOService -Url https://<tenant>-admin.sharepoint.com

I get 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 https://-admin.sharepoint.com -Creden ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ + CategoryInfo : NotSpecified: (:) [Connect-SPOService], XmlExcep tion + FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.Online.SharePo int.PowerShell.ConnectSPOService

I noticed a new version of the SharePoint Online Management Shell was released on 27th March, and I have installed that but I still get the same error.

This was working a week ago but now doesn't and I have tried on a couple of machines, in case my main machine is somehow corrupt, and with a couple of tenants.

Does anyone have any ideas?



2 Answers 2


I know this is an old thread but it was high in the search results so I thought I would get the word out. The error is typically caused by your ISP's DNS failure and then you being redirected to an HTML page instead of just a good ol' 404 error. Try this: Go to your network adapter and edit your IPv4 properties. Add Google's DNS server as your DNS instead of using your ISPs by entering and as your primary and secondary DNS. The error magically goes away.

  • This is old but thank you! This fixed my issue.
    – Kentgrav
    Sep 26, 2019 at 1:24

May be this will help Connect-SPOService -Url https://-admin.sharepoint.com -UseWebLogin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.