Caching OneDrive for Business content when Files On-Demand is enabled

This content is 6 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Not surprisingly, given who I work for, I’m a heavy user of Microsoft technologies. I have a Microsoft Surface Pro, running the latest versions of Windows 10 of Office 365 ProPlus, joined to Azure Active Directory and managed with Intune. I use all of the Office 365 Productivity apps. I AM A MICROSOFT POWER USER!

Enough of the drama! Let’s bring this down a level…

…I’m just a guy, using a laptop, trying to get a job done. It’s a tool.

OneDrive icon

Most of my files are stored in OneDrive for Business. There’s lots more space there than the typical SSD has available and so Microsoft introduced a feature called Files On-Demand, whereby you see the whole list of files but it’s only actually downloaded when you try to access it.

That sounds great, unless you travel a lot and work on trains and other places where network connectivity is less than ideal.

In my case, I have around 50GB of data in OneDrive and 90GB of free space on my Surface’s SSD so I have the potential to cache it all locally. I used to do this by turning off Files On-Demand but the latest build I’m running has disabled that capability for me.

It’s not feasible to touch every file and force it to be cached and I thought about asking my admins to reverse the setting to force the use of Files On-Demand but then I found another way around it…

If I right-click on a OneDrive file or folder in Windows Explorer there’s the option to “Always keep on this device”. [Update: Peter Bryant (@PJBryant) has flagged a method using the command line too – it seems there are new attributes P and U for Files On-Demand]

By applying this to one of the top-level folders in my OneDrive, I was able to force the files to be cached – regardless of whether Files On-Demand is enabled or not. Now, I can access all of the files in that folder (and any subfolders), even when I’m not connected to the Internet.

Recovering data after OneDrive for Business “ate” my OneNote notebooks…

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Yesterday, I wrote about troubleshooting OneDrive for Business. What I didn’t write about though was the problems that a simple repair to OneDrive for Business (acting on advice to resolve some sync issues on my client) caused for me…

The OneDrive for Business repair operation works as follows:

  • Disconnects all libraries that were experiencing sync problems.
  • Reconnects these libraries. This means Repair downloads and syncs the current server version of each library, as if you were syncing for the first time.
  • Creates an archive copy of any file that had unsynced changes and places these files in a library folder under C:\users\username\OneDrive for Business archives\.

So, if you are using that full 1TB of storage… you’d better have a good network connection to pull the entire contents of the library from the cloud (which is why the next version of the OneDrive client has selective sync).

In my case, I’m only using a few GB but, because I moved my entire Documents folder to OneDrive a few months ago, my OneNote notebooks were part of the data that was pulled down from the cloud.

I rely heavily on OneNote – I stopped using paper notebooks when I left my last job, as my everyday device is a Surface Pro 3 (which I find ideally suited to note-taking) – and here’s the lesson I learned:

OneNote and OneDrive for Business do not (always) play together nicely.

It should work – there’s even Microsoft advice for moving a OneNote notebook to OneDrive (and the same process works for OneDrive for Business) but it seems the mistake I made was to move all of my files in Windows Explorer. Whilst researching this blog post I’ve found Microsoft’s OneNote syncing best practices (KB2819334) and what I should have done is move the OneNote notebooks from within OneNote…

After the OneDrive for Business repair, I was left with a .ms-one-stub file which Explorer reported as being 1KB in size. 6 months of notes had disappeared – and opening OneNote didn’t follow the stub and magically pick up my notes. I felt physically sick. I thought I had two copies – one on the PC and one in OneDrive for Business. But no, OneDrive for Business was my backup – and it had “eaten” my work.

Luckily, there was another backup copy. It wasn’t current, but it was only a couple of days out of date, rather than starting from scratch. I found that OneNote stores a copy of notes in C:\Users\username\AppData\Local\Microsoft\OneNote\15.0\Backup.

That location has a folder for each notebook. Each folder contains a OneDrive recycle bin (OneNote_RecycleBin) and copies of  my .one files for each section, with a date when the backup was taken – for example project.one (On 22-11-2015).one. I’m not sure when the backup is taken (I’ve made changes to sections today that are still not reflected in the OneNote backup, but losing a couple of days is vastly superior to losing 6 months.

Even with the new information about the correct way to sync OneNote to OneDrive for Business, I’m not sure I completely trust it. From now on I’ll be making a third copy to another location…

 

Troubleshooting OneDrive for Business

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

I’ve written previously about the OneDrive for Business sync client – and I was pretty critical of it too. Since then, I’ve been working with OneDrive for Business every day on my work PC and it generally works well for me.  It’s not all a bed of roses though. I’ve had significant challenges with OneDrive in one customer implementation but part of the issue would appear to be their PC build, compounded by the approach taken to applying Microsoft updates.

It doesn’t help though that some Microsoft updates actually break OneDrive – the 13 October 2015 update for Office 2013 (KB3085566) prevents OneDrive for Business from syncing and needs an additional update from 21 October 2013 (KB2986219). And those are Office updates – separate to the OneDrive for Business client updates (e.g. KB3085509 and KB3101505).

I’m hoping that the new unified OneDrive sync client will improve things further. After all, Microsoft are claiming that:

“First and foremost, we’re delivering a rock-solid new sync experience.”

Great! That’s exactly what’s needed.

The new client (based on the consumer OneDrive client, which I think has its roots in Windows Live Mesh, rather than in Groove) introduces selective sync, removes some previous item count and file size limits and gets away from having two clients for OneDrive and OneDrive for Business. It’s also coming alongside improvements to the browser and mobile experiences, and changing to external sharing options (there’s more information on the OneDrive blog) but, for now, it’s an early preview and unfortunately not available for Windows 8.x.

Trying to fix my customer’s issues has led me to some useful resources for troubleshooting OneDrive for Business though – including an Office Support article on Fixing OneDrive for Business Sync Problems and a OneDrive for Business Sync Issues Troubleshooter. I’m not sure how well-known this second resource is, but it walks through a number of scenarios to help resolve problems, including:

Some of this is good practice, some is standard troubleshooting (clearing caches, reinstalling applications) but hopefully most people won’t need to go much further than the first few items. It’s definitely worth knowing about though…

The impact of Microsoft’s changes to OneDrive storage quotas on Office 365 plans

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Earlier this week, Microsoft announced some changes to its consumer cloud storage product, OneDrive (with more details in this FAQ).

Whilst the changes to OneDrive storage quotas are disappointing for some users, that’s life – you don’t get much that’s genuinely free and Microsoft clearly wasn’t making money on OneDrive.

What I find more disappointing is that Microsoft has created a real mess, after so much positive publicity in the new cloud-first, mobile-first Microsoft that Satya Nadella is leading. And it’s not about the products – the marketing guys are to blame here. First of all, there was nothing on the Office blogs about this – the announcement is on a separate OneDrive blog. Then that announcement refers to “Office 365 consumer subscribers”. So, as one person commented on the Office 365 Yammer network:

“Oh Microsoft what were you thinking with your poorly articulated and conceived change to OneDrive? https://blog.onedrive.com/onedrive_change . What a mess! Now people are emailing me and asking when they will lose space on their OneDrive and I have to explain ‘not that OneDrive this OneDrive’ and ‘not that Office 365 this Office 365′”

As well as two OneDrive products (OneDrive and OneDrive for Business, although sometimes with a unified client) and two Skype products (Skype and Skype for Business, again becoming more integrated but not quite there) we now seem to have the marketing teams talking about two sets of Office 365 subscription plans (Office 365 consumer and Office 365 business).

Anyway… setting aside some dubious product naming decisions, a retrenchment from “unlimited” storage (we all know what unlimited means to marketing departments… and surely it can be managed with an acceptable use policy if it’s being used to extremes) and some mightily annoyed end users who are about to see a drop in their OneDrive storage, what does this actually mean for Office 365 customers? I heard one MVP announce that Microsoft was reducing the amount of storage in Office 365 – and, unless we’re talking about an Office 365 Home, Personal, or University subscriber, that’s simply not the case.

Well, if you have an Office 365 consumer subscription, you still get 1TB of storage (per user – so with my family of 4 users on Office 365 Home, that’s potentially 4TB of storage) and, if you have an Office 365 business subscription, then the unlimited storage was never rolled out (at least not on any tenant I’ve seen) – although at the time of writing it is still on the Office 365 Roadmap as “in development” (I do expect that to change, although I haven’t seen any announcements from Microsoft).

In essence, it seems “unlimited” is a terabyte. Which may not be what the Oxford English Dictionary defines as the meaning of unlimited but is still a huge uplift on any file shares I’ve ever seen provisioned to end users!

Restore the Shared with Everyone folder in OneDrive for Business

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

For a long time now, the default behaviour in OneDrive for Business has been to provide a folder (called “Shared with Everyone”) which is an easy way to share files with everyone in the organisation. By default, the permissions on this allow editing of files in the folder by “Everyone except external users” (and guest links can be provided for others – either on a view-only or an edit basis).

From 1 August 2015, Microsoft changed the default setting for OneDrive for Business so that the Shared with Everyone folder is no longer provisioned.  It can be created manually by a user, or the tenant settings for the entire organisation can be set to provision the folder by default:

Set-SPOTenant –SharingCapability Disabled –ProvisionSharedWithEveryoneFolder $true

It’s also possible to remove users’ ability to use the “Everyone,” “All Users” and “Everyone except external users” groups from the people picker in OneDrive for Business and SharePoint Online with the following commands:

Set-SPOTenant -ShowEveryoneClaim $false
Set-SPOTenant -ShowEveryoneExceptExternalUsersClaim $false
Set-SPOTenant -ShowAllUsersClaim $false

Enabling them is achieved with the equivalent commands but set to $true.

Problems setting storage quotas in OneDrive for Business? Check that site collection storage management is set to manual!

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

A few weeks ago, I wrote a blog post about controlling OneDrive for Business syncing to prevent data copies on non-domain-joined PCs. Since then, I’ve had to add a post script to highlight a known issue with domain joined PCs failing to sync OneDrive for Business, even when added to a safe list, which is fixed by the 12 May 2015 update for OneDrive for Business (see Microsoft knowledge base article 2986244).

I also wrote in that post about problems setting storage quotas in OneDrive for Business using Set-SPOSite -Identity https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_onmicrosoft_com -StorageQuota 2048

Set-SPOSite : Cannot get site https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_onmicrosoft_com.
At line:1 char:1
+ Set-SPOSite -Identity
https://tenantname-my.sharepoint.com/personal/firstname_lastname …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSite

After raising a service request with Microsoft (which took over a week to be escalated after a few days of the initial team failing to resolve it) and then engaging the Microsoft Onboarding Center instead, I finally got to the bottom of the issue. The problem was that Site Collection Storage Management in SharePoint Online was set to Automatic. Once this was changed to Manual, I could successfully apply the quotas to users’ OneDrive for Business sites.

Office 365 (SharePoint Online) Site Collection Storage Management settings

As well as using PowerShell (Get-SPOSite -Identity https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_onmicrosoft_com), you can check the current storage quota in the browser, under Site settings, Storage Metrics:

One Drive for Business storage quota reduced to 2GB

Unfortunately this setting has to be applied on a per-user basis, after the user has already logged on to OneDrive for Business (which provisions the storage).

Control OneDrive for Business syncing to prevent data copies on non-domain-joined PCs

This content is 9 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

One of the recently announced changes to Office 365 is the ability to better control OneDrive for Business. Specifically, it’s now possible to control OneDrive for Business syncing to prevent data from being copied to non-domain-joined PCs, based on a list of approved domains, as well as to change the storage limit for users (perhaps 1TB is just too much data and something more restrained might reduce the impact on your network). There are also some changes around the “Shared with Everyone” folder, which used to be created by default but isn’t anymore.

The full details are in an Office Mechanics video, linked from a Microsoft blog post but I recently had the chance to try them out for real.

Step 1 was to determine the ObjectGuid for each of the domains in my customer’s Active Directory Forest, using Active Directory PowerShell:

$domains = (Get-ADForest).Domains; foreach($d in $domains) {Get-ADDomain -identity $d | Select ObjectGuid}

Step 2 is to connect to Office 365 using PowerShell:

$cred=Get-Credential
connect-sposervice –url https://tenantname-admin.sharepoint.com/ –credential $cred

Step 3 is to take the ObjectGuid from step 1 and use the Set-SPOTenantSyncClientRestriction cmdlet to restrict synchronisation:

Set-SPOTenantSyncClientRestriction -enable -DomainGuids "a0083dbb-e136-4f48-a048-2ec3a4c40cab"

It’s worth noting that, initially, this failed for me – SetSPOTenantSyncClientRestriction wasn’t a valid command in the version of the SharePoint Online Management Shell I had installed. I checked the version with Get-Module -ListAvailable | Format-List version, name and found I had version 15.0.4569.0 of Microsoft.Online.SharePoint.PowerShell. After updating to the latest version, I was at version 16.0.4316.0, which worked a treat:

TenantRestrictionEnabled AllowedDomainList

———————— —————–

True {a0083dbb-e136-4f48-a048-2ec3a4c40cab}

It’s important to understand how the restrictions are enforced though:

  • Not only will OneDrive for Business Sync client requests originating from a domain that is not on the safe recipients list be blocked but all OneDrive for Business Mac Sync client requests will be blocked. This also means that a sync relationship will not be established unless they are joined to an allowed domain.
  • However:
    • Mobile clients are not blocked (there are separate MDM controls for this) and any files that have been previously been synced to the computer will not be deleted.
    • New or existing files added to the client will still be uploaded to the server and will not be blocked.
    • OneDrive for Business sync client prior to version 15.0.4693.1000 will stop syncing existing libraries.

Controlling the storage quota was a little more tricky. I found that I could use Get-SPOSite -Identity https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_onmicrosoft_com to view the properties of a users’ OneDrive for Business site, but attempting to set the quota on the same site presented an error:

Set-SPOSite -Identity https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_onmicrosoft_com -StorageQuota 2048

Set-SPOSite : Cannot get site https://tenantname-my.sharepoint.com/personal/firstname_lastname_tenantname_onmicrosoft_com.
At line:1 char:1
+ Set-SPOSite -Identity
https://tenantname-my.sharepoint.com/personal/firstname_lastname …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSite

I haven’t fixed that yet, so I’ll be returning to the topic again soon, no-doubt…

Post Script

There is a known issue with domain joined PCs failing to sync OneDrive for Business, even when added to a safe list, which is fixed by the 12 May 2015 update for OneDrive for Business (see Microsoft knowledge base article 2986244).