Silently Update SharePoint Metadata with PnP PowerShell

Why Bother with Metadata?
Think of metadata as the DNA of your SharePoint content. It tells you who created a document, when it was last touched, and more. This information isn’t just for kicks; it’s vital for audits, compliance, and knowing the lineage of your content.
Keeping Metadata Intact with Updates
Sometimes you need to adjust a document’s details but want to keep the original ‘Modified By’ data. PnP PowerShell is your ally here:
|
|
Understanding Update Types in PnP PowerShell
When you’re updating SharePoint items with PnP PowerShell, you have three update methods at your disposal, each serving a different purpose. Let’s demystify these:
-
Update
This is the standard update command. When you use Update, SharePoint treats the action as if you manually updated the item through the UI. This means:
The “Modified” and “Modified By” fields will be updated to reflect the time of the update and the user who made the change. If versioning is enabled on the list or library, a new version will be created. Use it when you want to make a straightforward update that logs your changes as a new version.
-
SystemUpdate
SystemUpdate is more discreet:
It updates items without changing the “Modified By” and “Modified” fields. A new version is created if versioning is enabled, but it will not show as a new “modified” entry. This method is perfect when you need to make changes that don’t affect the item’s version history as seen by end-users, like during system migrations or bulk updates.
-
UpdateOverwriteVersion
The UpdateOverwriteVersion is the stealth operator:
It updates the item while keeping the “Modified By” and “Modified” fields as they were. It does not create a new version; instead, it overwrites the current version, even if versioning is enabled. This approach is suitable when you want to make a correction to the current version of an item or document without increasing the version count, effectively keeping the update under the radar.
Changing Creator and Creation Dates: Is It Even Possible?
Yes, it is! Adjusting the creator or creation date of a document is sometimes necessary, such as during migrations or clean-ups. Here’s how you can accomplish this:
|
|
Data Integrity Best Practices
To safeguard your SharePoint content during updates, here are some best practices to uphold data integrity:
- Maintain a Change Log: Documenting changes ensures accountability and traceability.
- Secure Approvals: Validate that all updates are authorized and documented.
- Test Before Implementing: Always preview changes in a safe environment to prevent unintended consequences in your live content.
Conclusion
With PnP PowerShell, you have the tools to adjust metadata with precision, ensuring that your SharePoint data tells its true story without unintended revisions. It’s about strategic changes that respect the narrative of your data.
Further Reading
Delve deeper into PnP PowerShell with the official cmdlet documentation for Set-PnPListItem, available here.
Published on:
Learn moreRelated posts
New Editing Options for Image Web Part in SharePoint Online
Adding and Editing Images with the Image Web Part The Image web part simplifies the process of adding visual elements to your SharePoint Onlin...
External User Access Reviews in Office 365
Understanding External User Access Before diving into the reviews, it’s important to understand what external access entails. External u...
Power Automate - How-to Posting on BlueSky and Mastodon
Introduction Do you want to save time and effort by automating your social media posts across different platforms? Do you want to learn how to...
M365 Groups: Set Up a 'No Owner Policy' & why it's Important
Introduction Managing group ownership is crucial for maintaining order and security within an organization in Microsoft 365. A “No Owner...
Social media content creator with AI Promts
Prerequisites For this tutorial you need the following: A premium Power Automate account, e.g. a Power Automate per user plan or an Powerapps...
Change SharePoint group to Security Groups with PowerShell
Automating SharePoint Permissions with PowerShell Managing SharePoint user permissions can be a complex and time-consuming task, especially fo...
Deleting doublettes in SharePoint list with PnP PowerShell
In this blog post, I will break down a PnP PowerShell script that is designed to connect to a SharePoint site, retrieve a list of users from a...
Limit Copilot's access to SharePoint Sites and Content
Why Permissions in Office365 matter for Copilot In the ever changing digital landscape, managing permissions and ensuring data security are pa...
Microsoft Teams Channel Types: How to Choose the Right One
Introduction Microsoft Teams is a powerful collaboration tool that allows you to communicate, share, and work with your team members in a secu...
Getting Started with Power Platform dev environment
Power Platform is a suite of low-code/no-code tools that enable you to build PowerApps, Power Automate workflows, and analyze data PowerBI. Th...