Hi everyone,
I’m seeking assistance with constructing a PowerShell script to manage document versions and space on multiple SharePoint sites. My goal is to:
- Connect to various SharePoint sites.
- Delete older major versioning copies of documents to free up space.
- Update version history settings to ensure future document control.
- Pull the list of SharePoint sites from a CSV file to handle multiple sites at once.
- Produce a log at the end of the script execution.
I’ve encountered challenges with consistent authentication methods, having tried PnP PowerShell and SharePoint REST API. I would appreciate guidance on the best approach for handling credentials and login within this type of script.
How would you approach it out of interest ?
Any advice or examples would be greatly appreciated!
Thank you in advance for your help.