TechShizz | All posts tagged 'One Drive for Business'

One Drive character limit | PowerShell to find file path character length | File Path Character Limit

Problem

One Drive will not sync files with more than 400 charactes in the file path

Cause

Limitation

Solution

Use this script and execute to create a list of all files and their number of characters. Address by shortening folder and file names. 

 $pathToScan = "C:\APP1-Data\SharePointData\MW\MW - Documents" # The path to scan and the the lengths for (sub-directories will be scanned as well).
$outputFilePath = "C:\temp\PathLengths.txt" # This must be a file in a directory that exists and does not require admin rights to write to.
$writeToConsoleAsWell = $true # Writing to the console will be much slower.

# Open a new file stream (nice and fast) and write all the paths and their lengths to it.
$outputFileDirectory = Split-Path $outputFilePath -Parent
if (!(Test-Path $outputFileDirectory)) { New-Item $outputFileDirectory -ItemType Directory }
$stream = New-Object System.IO.StreamWriter($outputFilePath, $false)
Get-ChildItem -Path $pathToScan -Recurse -Force | Select-Object -Property FullName, @{Name="FullNameLength";Expression={($_.FullName.Length)}} | Sort-Object -Property FullNameLength -Descending | ForEach-Object {
$filePath = $_.FullName
$length = $_.FullNameLength
$string = "$length : $filePath"

# Write to the Console.
if ($writeToConsoleAsWell) { Write-Host $string }

#Write to the file.
$stream.WriteLine($string)
}
$stream.Close()


One Drive character limit | PowerShell to find file path character length | File Path Character Limit

Problem

One Drive will not sync files with more than 400 charactes in the file path

Cause

Limitation

Solution

Use this script and execute to create a list of all files and their number of characters. Address by shortening folder and file names. 

 $pathToScan = "C:\APP1-Data\SharePointData\MW\MW - Documents" # The path to scan and the the lengths for (sub-directories will be scanned as well).
$outputFilePath = "C:\temp\PathLengths.txt" # This must be a file in a directory that exists and does not require admin rights to write to.
$writeToConsoleAsWell = $true # Writing to the console will be much slower.

# Open a new file stream (nice and fast) and write all the paths and their lengths to it.
$outputFileDirectory = Split-Path $outputFilePath -Parent
if (!(Test-Path $outputFileDirectory)) { New-Item $outputFileDirectory -ItemType Directory }
$stream = New-Object System.IO.StreamWriter($outputFilePath, $false)
Get-ChildItem -Path $pathToScan -Recurse -Force | Select-Object -Property FullName, @{Name="FullNameLength";Expression={($_.FullName.Length)}} | Sort-Object -Property FullNameLength -Descending | ForEach-Object {
$filePath = $_.FullName
$length = $_.FullNameLength
$string = "$length : $filePath"

# Write to the Console.
if ($writeToConsoleAsWell) { Write-Host $string }

#Write to the file.
$stream.WriteLine($string)
}
$stream.Close()


Sync icons (green ticks) are missing from OneDrive for Business synced items

To update the registry, follow these steps:

  1. Open registry editor.
  2. Move to the following folder, and then expand it:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers
    
  3. Rename the following registry keys

    Old folder name New folder name
    SkyDrivePro1 (ErrorConflict) <space><space>SkyDrivePro1 (ErrorConflict)
    SkyDrivePro2 (SyncInProgress) <space><space>SkyDrivePro2 (SyncInProgress)
    SkyDrivePro3 (InSync) <space><space>SkyDrivePro3 (InSync)

    On the View menu, click Refresh to verify that the renamed keys now appear at the top of the list.
  4. Exit Registry Editor, and then restart your computer.
  5. Uninstall any other applications that use icon overlays such as DROPBOX

 

 

https://support.microsoft.com/en-gb/kb/3079213

 

Fix OneDrive for Business with SharePoint Sync Problems

This problem occurs randomly and you can see there are files to be synced but they never do unless you stop and restart the whole folder sync again, but the problem then re-occurs.

Microsoft Engineer advised this is the resolution. 

Stop the folder sync
Terminate groove.exe and mqsvc.exe

C:\Users\%username%\AppData\Local\Microsoft\Office\16.0
Go to AppData/Locla/Microsoft/Office
Delete OfficeFileCache
+ spw

For the 16.0 and 15.0 folders.
Repeat for
C:\Users\%username%\AppData\Local\Microsoft\Office\15.0

In
C:\Users\%username%\AppData\Local\Microsoft\Office\
Delete "Spw"

Then go to Microsoft Credential Manager and clear all Microsoft Office entries.

=========================================================
Restart the One Drive For Business Sync Client and re-sync to sharepoint

OneDrive for Business Sync Issues

We have found that many sync issues for One Drive for Business can be resolved by Upgrading Office to 2016 and install the full E3/E5 suite and then install the new OneDrive for Business sync client.

Users must be on this licences version of Office 365 for this resolve to work. 

https://support.office.com/en-gb/article/Get-started-with-the-new-OneDrive-sync-client-in-Windows-615391c4-2bd3-4aae-a42a-858262e42a49?ui=en-US&rs=en-GB&ad=GB

https://support.office.com/en-gb/article/Get-started-with-the-new-OneDrive-sync-client-in-Windows-615391c4-2bd3-4aae-a42a-858262e42a49?ui=en-US&rs=en-GB&ad=GB