Out of the box, if you upload a document to SharePoint and tag metadata to it, that data is attached to the document properties. This is the case for most all column types you create in a library, and on random occasions, Document IDs are copied.
If you are working with SharePoint on-prem you can disable this functionality at the SPWeb level, but that’s not the case with SharePoint Online.
on-prem code example:$web = $ctx.Web
$web.ParserEnabled=$false
$web.Update()
Example of what I was seeing in my sample library:
Create a new library titled DocLib
Added a text column titled TacoFiller
Uploaded an Excel file, then populate TacoFiller with the word Beans
Downloaded the file and look at the properties.
File –> Info –> All Properties (Excel o365)
Notice that property TacoFiller is set to Beans.
Create a local copy of the file, then upload it to DocLib.
SharePoint has read the TacoFiller property from the Excel file and applied the data to the column in the library.
Short of doing a document migration, I have NO idea why you’d want this enabled out of the box. If anything, this should be disabled, then allow admins to enable as needed. /rant
TL;DR / how-to disable this functionality:
First, you can only disable this at the library level!
#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Code\DLL\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Code\DLL\Microsoft.SharePoint.Client.Runtime.dll"
#Config Parameters
$SiteURL= "https://YourSite.sharepoint.com/sites/spdev/testsite"
$ListName="DocLib"
#Get Credentials to connect
$Cred = Get-Credential
Try {
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
#get list sharepoint online powershell
$List=$Ctx.Web.Lists.GetByTitle($ListName)
$Ctx.Load($List)
$Ctx.ExecuteQuery()
Write-host "Parser Disabled value " $List.ParserDisabled
$List.ParserDisabled = $true
$List.Update()
$ctx.ExecuteQuery()
}
Catch {
write-host -f Red "Error:" $_.Exception.Message
}
A couple of notes about the script.
You can download the SharePoint DLLs from Microsoft: link
In my tenant, using Get-Credential requires that I use my company email address and an App Password. This may/not be the case with your tenant. App Password info: link
And… after running the script, upload another copy of the Excel file to the library.
The TacoFiller property is no longer being extracted from the Excel file!
I’d like to thank Abhijit Rajurkar for helping with this!
Thanks Ian! You saved us a lot of headaches with this fix. All the Microsoft forums and uservoice suggested changing the ParserDisabled property was not possible on SharePoint Online, so it was a relief to come across your article with a solution.
This is the most underrated webpage in all of SharePoint. Our company wouldn’t have migrated our data to SharePoint if I hadn’t found this information here. Thank you so much, and good work!
Microsoft really needs to create a function for users to easily turn this on or off. The fact that SharePoint modifies files on its own essentially rules it out for anyone who cares about data integrity.
Thank you sooooo much for this! We have an approval workflow running on procedures. The approved ones are converted to pdf, until then they are .docx types. Applying new templates caused loss of important metadata concerning the approval process and history. Coming from on premise first did not know what hit us…
Wow thank you so much for this. This has really been doing my head in about SharePoint how it tampers with the binary contents of the file of a doc/docx/xlsx etc. https://docs.microsoft.com/en-us/sharepoint/technical-reference/default-crawled-file-name-extensions-and-parsed-file-types
It makes things tricky when you need to run a tool to verify that the file has copied across correctly without corruption or you need to re-migrate a portion of it and need to figure out what has changed or not.
In the end I couldn’t find the DLLs from the download, but eventually I did find them in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI but then I couldn’t get past the MFA login and couldn’t be bothered to set up an App password, so I found a different way of doing it using the CLI for Microsoft 365.
I documented the process I took here:
https://github.com/29039/29039s-useful-stuff/blob/main/m365-sharepoint-online-set-parserdisabled.md
Thank you so much for this! It really helped to remove a show stopper for me!
I tried below code for MFA enabled site and it worked. P.S. u need to uninstall PnP powershell module “Uninstall-Module -Name pnp.powershell” and install SharePoint PnP PowerShell module before “Install-Module -Name SharePointPnPPowerShellOnline -Force”. As I searched SharePoint Online PowerShell Modules don’t work well with Dlls, so you might need to uninstall them as well.
Here’s the script:
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
Add-Type -Path “C:\Program Files\WindowsPowerShell\Modules\SharePointPnPPowerShellOnline\3.29.2101.0\OfficeDevPnP.Core.dll”
$SiteURL= ” ”
$ListName=” ”
try {
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$AuthenticationManager = new-object OfficeDevPnP.Core.AuthenticationManager
$ctx = $AuthenticationManager.GetWebLoginClientContext($siteURL)
$ctx.Load($ctx.Web)
$ctx.ExecuteQuery()
$List=$Ctx.Web.Lists.GetByTitle(” “)
$Ctx.Load($List)
$Ctx.ExecuteQuery()
Write-host “Parser Disabled value prev ” $List.ParserDisabled
$List.ParserDisabled = $true
$List.Update()
Write-host “Parser Disabled value new ” $List.ParserDisabled
$ctx.ExecuteQuery()
}
Catch {
write-host -f Red “Error:” $_.Exception.Message
}
Fill the site and library details and check if it works!