Others

Fix the DTD Processing Error When Disabling SharePoint Versioning with PowerShell

Bushra ParveenBushra Parveen Nov 13, 2026 868 views

Question details

The user needs to resolve an XML DTD processing error that occurs when a PowerShell script using SharePoint CSOM and SharePointOnlineCredentials calls ExecuteQuery to disable document library versioning in SharePoint Online.

Product
Microsoft SharePoint Online / SharePoint CSOM / PowerShell
Device & OS
not provided
Scenario
Running a PowerShell script with SharePoint CSOM and SharePointOnlineCredentials to disable versioning on a SharePoint document library.
Observed behavior
ExecuteQuery fails with an XML error stating that DTD processing is prohibited.
Before you start

Before troubleshooting, collect the full PowerShell script, the SharePoint CSOM version, the target site and library URL, and the complete error message with stack trace. Also note whether the script uses SharePointOnlineCredentials and whether any proxy, firewall, or XML transform is intercepting the SharePoint response.

Solution 1Recommended

Switch to PnP PowerShell and disable versioning without legacy CSOM XML parsing

Use the PnP PowerShell module as a more reliable replacement for SharePoint CSOM when changing document library versioning; it avoids the fragile XML/DTD path that causes this error.

PnP PowerShell handles SharePoint Online authentication and list settings through cmdlets rather than direct CSOM ExecuteQuery calls, so it does not expose the same DTD parsing failure. This is the fastest workaround when the goal is simply to disable versioning on a document library.

1
Install the PnP PowerShell module

Open PowerShell as an administrator and run Install-Module PnP.PowerShell -Scope CurrentUser -Force.

2
Connect to your SharePoint site

Run Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/yoursite -Interactive and complete the Microsoft 365 login prompt.

3
Disable versioning on the library

Run Set-PnPList -Identity 'Documents' -EnableVersioning $false, replacing 'Documents' with the actual library name.

4
Verify the setting

Run Get-PnPList -Identity 'Documents' | Select-Object Title, EnableVersioning to confirm versioning is disabled.

SharePoint admin rights required: You need SharePoint site owner or admin permissions to change list versioning settings.
Free Microsoft Office alternative

Facing SharePoint CSOM DTD Errors? Use WPS Office as a Free Microsoft Office Alternative

This SharePoint CSOM/DTD issue belongs to Microsoft SharePoint and PowerShell, so WPS Office cannot fix the SharePoint server response. For everyday document work, WPS Office is a free, lightweight Office alternative that opens and saves Word, Excel, and PowerPoint files with Microsoft Office format compatibility, a familiar ribbon interface, and easy migration from Microsoft 365.

  1. 1. Open the WPS Office download page: In a browser, go to https://www.wps.com and select the WPS Office Free download for Windows, macOS, Linux, or mobile.
  2. 2. Install WPS Office: Run the downloaded installer and follow the on-screen prompts to complete the installation.
  3. 3. Open your Microsoft Office files: Launch WPS Office and open existing .docx, .xlsx, or .pptx files from the home screen or File > Open.
Opens, edits, and saves .docx, .xlsx, and .pptx files with Microsoft Office format compatibilityFree alternative to Microsoft 365 with no subscription for core Office featuresFamiliar ribbon UI and tabbed document interface reduce the learning curveLightweight installation that uses fewer system resources than Microsoft OfficeAvoids SharePoint CSOM DTD parsing issues for local document editing tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does SharePoint CSOM throw a 'DTD processing is prohibited' error?

It typically happens when the .NET XML reader encounters a DOCTYPE or DTD while DtdProcessing is set to Prohibit during parsing of a SharePoint CSOM response. This can be caused by a CSOM version mismatch, a proxy/firewall response, or an unexpected XML payload from the SharePoint endpoint.

Can WPS Office fix SharePoint versioning errors?

No. This is a Microsoft SharePoint and PowerShell server-side issue, so WPS Office cannot change SharePoint list or library versioning settings. WPS Office is an Office document alternative, not a SharePoint administration tool.

What is the fastest way to disable SharePoint document library versioning?

Use PnP PowerShell: run Install-Module PnP.PowerShell, connect with Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/yoursite -Interactive, then run Set-PnPList -Identity 'Documents' -EnableVersioning $false.

Do I need SharePoint admin permissions to disable versioning?

Yes. You need at least site owner or admin permissions on the SharePoint site to change document library versioning settings.

Which PowerShell module should I use instead of SharePoint CSOM for list settings?

PnP.PowerShell is the recommended module because it uses modern authentication and cmdlets that avoid direct CSOM ExecuteQuery XML parsing, which can trigger DTD processing errors.