wanting to move my user folders to google drive

goodcooper

[H]F Junkie
Joined
Nov 4, 2005
Messages
9,771
we've got around 400 users and like most places are pretty understaffed for IT personnel (especially considering how much custom work we do)

i count it as a blessing pretty much every day that we outsourced our email to google... it's made my job so much easier it's ridiculous, i NEVER have to worry about email

anyway, i was looking at more ways i can reduce our workload by outsourcing some high maintenance stuff, and i was thinking about cloud storage... at first i was looking into dropbox, then realized, duh.... we already have google accounts, why not switch our user drives (set up as U: on workstations) to google drive and just push the google drive .msi out... gives us one less thing to worry about, as far as access/backup/etc/etc and they get cool features like access on multiple computers (everyone's familiar with the 'ol complaint about how slow SMB is over VPN on work laptops from home) as well as neat things like mobile apps for IOS and android... the included 5GB should be enough for 98% of our users, and additional storage is REALLY reasonable...

no brainer for us really... we integrate and have an SSO in the works to unify our domain and google apps so all is right in the world...

but then i realized, how am i going to do scanning? the way we do scanning right now is that the scanners (various devices ranging from copiers, to MFCs, etc) scan to the server at each location via SMB which has a folder in the user drive... that way whenever a person scans, it immediately shows up in their Scans folder on their U:

since the user drive will now be with google, how do i get the scans to it?

obvious solution #1 would be to share the folder on the user's PC, put the PC's share into the copier.... which is a terrible idea that would be a huge hassle to manage and would break hardcore if 2 users started sharing the same pc... also people have become accustomed to scanning items for users that are offsite (we have DFS and file replications across the sites) which they think is really neat/useful.... would totally break that....

solution #2 would be to just begin to use the scan to email feature on these devices instead, but our users are used to the way things are now, and that would just be too much of a change than i'd like... adds a huge hassle w/ the flow of paperwork, have to go in to your email, save the attachment as a scan... THEN you can get to it on your PC to manipulate... it's just a pain...

solution #3 is that i set up a single google account for scans and manually share a folder for each individual user out to each user... share that on a server and send the scans to that via smb... although this is fairly simple and would work, it would be a huge management cost... we'd have to manually create folders for each user (could be scripted initially, but still) and then we'd have to share those out in google drive... just sounds gross....

solution #4 is my best solution so far, but it's the most work for me, i would create an email account on our domain called [email protected].... in the copymachines/mfcs, i would set the scans up for a user John Doe to scan to email to [email protected]..... in [email protected]'s account i'd have a google apps script scanning the emails, then taking the email and filing the attachment into the perspective user's Scans folder in their google drive.... this would take the most setup time for me but would be very simple to manage (i'd just have the script send me an alert if a username was invalid, which means we typed it into the copier wrong or set up a person for scanning before we created their account, which should never happen) PLUS i think i'd have to individually go into every google account and allow that script access to their google drives.... to allow the security...


anybody else have any better ideas?
 
Last edited:
option #5 is a take on option #4 only without the hokey middleman account...

setup the copiers to scan to email to [email protected] and then just have a google apps script that will monitor YOUR email for scans, if it finds one then it autofiles the attachment (and deletes or auto-archives the mail) into your Scans folder in your google drive...

that way i can set it up via scan to email, and if they dislike the fact that they have to open the emails and etc, i can point them to the script and voila...

best yet i think, especially if i have to do something similiar to allow access with solution #4 anyway.....

i need to look into google apps script...... i would use a service like ifttt but the 15 minute lag time on the processing wouldn't be reasonable in this case, plus i'm not setting up an ifttt account for every user in my domain
 
Last edited:
update to this.... actually the email would have been [email protected].... had the alias stuff backwards on there...

also, this is the code i put in my script, it started out pretty simple but i had to start adding some more stuff in there because every time i got a new message from my MFC it would pull the whole thread out of the trash.... annoying...

seems to work good though...

Code:
function scanToDrive() {
  
  var folder = DocsList.getFolder('Scans');
  var label = GmailApp.getUserLabelByName("Scans");
  var threads = label.getThreads();
  for (var i=0; i<threads.length; i++) {
    if(!threads[i].isInTrash()) {
      var messages = threads[i].getMessages();
      for (var j=0; j<messages.length; j++) {
        if(!messages[j].isInTrash()) {
          var attachments = messages[j].getAttachments();
          for (var k=0; k<attachments.length; k++) {
            folder.createFile(attachments[k].copyBlob());
          }
        }
        messages[j].moveToTrash();
      }
      threads[i].removeLabel(label);
    }
  }
  GmailApp.moveThreadsToTrash(threads);
  label.removeFromThreads(threads);
  GmailApp.refreshThreads(threads);
}

have this running once a minute... i would like to see if i can find a trigger that only triggers it on a new mail receipt, but i don't think they have those...

this assumes you already have the "Scans" filter and label set up and that you have a "Scans" folder in your google drive.... so next i'll probably make a "setup" script that creates all that stuff for you.... shouldn't be too bad....
 
Last edited:
Back
Top