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!