Max Path Length in Sharepoint Online, Onedrive for Business and Teams

Many Office 365 clients (and especially Excel) really don’t like long paths. The older the client, the worse the issues.

To find files over a certain path length in Office 365, I wrote a script a while back. This required manual perusal of the results and manual correction of the issues.

The new version of my script now features fully automatic discovery, a flexible editor and automatic correction of paths based on what you entered into the editor.

Correcting path lengths in Sharepoint Online, Onedrive for Business and Microsoft Teams

You can get the PowerShell script / editor from my git repository here.

Many thanks to CTS in their help me designing and testing this script!

How to use

  1. download the script and save it somewhere
  2. Copy the desired Sharepoint Library into a new Sharepoint Library and/or site
  3. Run the script only for that site or library by specifying the -specificSiteUrls or specificDocumentLibraries parameter
  4. do some corrections, commit them, check the results
  5. If satisfied, set permissions for your admin account on the actual production locations your wish to fix (script for Onedrive Mass Permissions here)
  6. Ensure no users have open files in the library
  7. Remove any non-standard characters from folder names (see script source, example code at the top)
  8. Run

Disclaimer

  • Please make sure you TEST this on a copy of your document library/sites before using the ‘commit’ option.
  • Use at your own risk.
  • I recommend turning on the Universal Audit log before usage.

Azure update management error

For those googling this error in the Update Management console in Azure:

System.Runtime.InteropServices.COMException (0x80240438): Exception from HRESULT: 0x80240438    at Microsoft.EnterpriseManagement.Mom.Modules.ChangeTracking.WUA.IUpdateSearcher2.EndSearch(ISearchJob searchJob)    at Microsoft.EnterpriseManagement.Advisor.PatchManagement.WindowsUpdateHelper.GetUpdateSnapshot(TimeSpan timeout, Boolean onlineSearch, DateTime lastTimeUpdateApplied, IAutomaticUpdates2 automaticUpdates, UpdateModuleState state)

Fix: Exempt the server from group policies (or alternative solutions) that configure Windows Update. GPO’s override Azure Update Management and block the Azure agent from searching for updates.