OneDrive question

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Morning everyone.

I have a question for tech folks familiar with One Drive.

Our company has recently gone away from PC Backup and is moving entirely to One Drive for storage purposes.

We needed folders to automatically sync to OneDrive, but didn't want to actually point the folders to OneDrive, so we've been using /mklink /j to make a junction between their desktop, favorites and documents folders. Our users are very spoiled and are not expected to do anything themselves, so trying to explain to them they will need to periodically copy their files into OD didn't go over well.

In small tests, this has worked well on our machines, but we're having some debate between us on how functional this would be in the case of a crash/HD needing to be wiped, etc.

I did a test where I created a file in one of my junctioned folders, forced a sync and verified the file was mirrored into OneDrive. I then removed the file from the folder on my local machine and verified it was still in the one drive web app. I then forced a sync and the file was removed.

My team member is arguing that if the HD were to crash/need to be wiped/reimaged, the mklink would be broken and the files would be removed from One Drive.

My thought is that it is the act of syncing that removes/adds the files to OD in this junction situation and that if the machine were to crash, OD won't sync since there's no connection for it to be able to do so.

I haven't really found any concrete answers on this anywhere since it seems like most of the things I've read suggests actually pointing the folder location to OneDrive instead of creating a junction.

Any ideas?
 

Lonewolfe2015

Rom Com Male Lead
Sponsor
Dec 2, 2007
17,275
2,233
If your users aren't going to put files on OneDrive themselves (seems silly, I use Google Drive at work all the time and just save my files there naturally), then why don't you redirect their local documents, videos, etc to OneDrive?

Just change the location in the properties menu and set up a mirror on OneDrive. They'll never know they're actually saving to OneDrive and not their own computer.
 

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Our higher ups do not want the actual location of the folders to be modified in any way. Moving the folder location is what we did originally but when we ran it through for approval it was denied and we were told to find another way.

Trust me, I know it's silly. Our company has an entire help desk team for resetting passwords in AD, but we still get people coming up to our desks all day begging for resets because they don't like to call the phone number.
 

Osprey

Registered User
Feb 18, 2005
27,302
9,789
Junctions link two folders on the same system (they can't connect folders on different systems), so you must be junctioning the user folders with the OneDrive folder that is in each profile. For example you're junctioning C:\Users\Test\Documents with C:\Users\Test\OneDrive\Documents, right? OneDrive syncs its contents with the latter. What you're doing by creating the junction is simply making it so that, when user Test opens or save a document, instead of the program reading from or saving to C:\Users\Test\Documents, it reads from or saves to C:\Users\Test\OneDrive\Documents, the folder that OneDrive syncs with.

By breaking the junction, you're not actually breaking the sync or even changing it. OneDrive will continue to sync its remote folders with C:\Users\Test\OneDrive, just as it always does. That's unavoidable unless you turn syncing/OneDrive off. It's just that, without the junction, when user Test saves his documents, they'll be saved in C:\Users\Test\Documents, rather than in C:\Users\Test\OneDrive\Documents, and, so, they won't be synced.

Now, what happens if user Test logs onto a new copy of Windows and there are no files in his new profile in either C:\Users\Test\Documents or C:\Users\Test\OneDrive\Documents? Will OneDrive delete all of the files on its remote servers, since they don't exist locally? No, that's not how synchronization works. When you log onto a new computer and sync with OneDrive, the remote files are downloaded to the new computer. If, instead, the files were immediately deleted from the remote server, it would make it virtually impossible to use OneDrive with multiple computers and would defeat the entire purpose of cloud backup. If files are missing from either side of the sync, they're added to the other, not deleted from the side that contains them. For a file to be deleted by OneDrive, you have to actually initiate a deletion of the file, which creates an alert for OneDrive to "delete this file at the next sync." If a file just suddenly goes missing (ex. your HD dies and you log onto another computer), that alert isn't created and the file is not deleted.

What this all boils down to is that you shouldn't need to worry about OneDrive files being deleted in the cloud because of a local HD/profile wipe. What you do need to worry about, though, is that you always have the junctions set or else files may go "missing" in other ways. You can't have users ever logging on without the junctions or else, when they try to open their documents, they won't be there (because Windows will be looking in, for example, C:\Users\Test\Documents, not C:\Users\Test\OneDrive\Documents), and, when they save new ones, they'll be saved to the wrong place (ex. C:\Users\Test\Documents) and, thus, won't be synced with OneDrive. You should make it so that all of the junctions are automatically created whenever a new profile is created, no matter where it's created. If Bill in HR sits down at Alice in Accounting's computer and logs in there as himself for the first time, the junctions need to created or he'll have the problems just described. You can use %USERPROFILE% in your mklink commands (ex. mklink /j %USERPROFILE%\Documents %USERPROFILE%\OneDrive\Documents) to accomplish that, and do that in a batch script that runs when the profile is created (or maybe even each time that the user logs on).
 
Last edited:

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Yeah, I've made the batch file with %userprofile% in hopes of just sending the file to the account upon approval, having them run it and being done.

Luckly, our company policy strictly prohibits users using other machines, so every individual in the office has their own machine and do not use shared machines, so the issue of multiple profiles doesn't pose a potential problem for us.

I really appreciate the feedback. I really don't think this is a great solution for backup, but I'm just a low guy on the totem pole.

This is actually what I'm using for the batch. We've only tested this on a handful of machines and everything seems to be successful so far:

Mklink /J "c:\Users\%USERNAME%\Onedrive - Company\Favorites" "c:\users\%USERNAME%\favorites"
Mklink /J "c:\Users\%USERNAME%\Onedrive - Company\My Documents" "c:\users\%USERNAME%\documents"
Mklink /J "c:\Users\%USERNAME%\Onedrive - Company\Desktop" "c:\users\%USERNAME%\desktop"
 

Osprey

Registered User
Feb 18, 2005
27,302
9,789
Oh, so you're doing the reverse of what I speculated: you're making the user folders the targets. That seems like a better solution, since the presence or absence of the junctions doesn't change where the files are stored.

Yeah, I don't think that it's a great solution, either. You're trusting multiple 3rd parties (your internet provider and Microsoft's OneDrive service) with your company's backups. That'd be perfectly fine for small businesses, but those big enough to have their own IT departments should probably have their own infrastructures that utilize their networks for backups. That would be more secure, more efficient, faster performing and would also allow for recovering old versions of files more reliably. If they won't let you implement that, though, what can you do?
 
Last edited:

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Oh, so you're doing the reverse of what I speculated: you're making the user folders the targets. That seems like a better solution, since the presence or absence of the junctions doesn't change where the files are stored.

Yeah, I don't think that it's a great solution, either. You're trusting multiple 3rd parties (your internet provider and Microsoft's OneDrive service) with your company's backups. That'd be perfectly fine for small businesses, but those big enough to have an IT department should probably have their own infrastructure that utilizes their own networks for backups. If they won't let you implement that, though, what can you do?

Oddly enough, we had a great backup solution in place, but I'm guessing the money was too much and they pretty abruptly said we're doing away with the backup and going to OneDrive. So now we've got hundreds of people losing their mind about their backups.

:banghead:

Thanks for your replies, I appreciate the insight!
 

Ad

Upcoming events

Ad

Ad