OneDriveMapper automatically map your OneDrive for Business upon login

This script maps your Onedrive / Sharepoint / Teams document libraries to driveletters (or shortcuts). It can be used in any environment (VDI, RemoteApp, w10 etc).

 
 
 
 
 
4.6 Star
(116)
76,916 times
Add to favorites
Office 365
2/3/2019
E-mail Twitter del.icio.us Digg Facebook
  • $domain variable
    4 Posts | Last post November 01, 2016
    • Hi Jos,
      Our AD domain name is different from UPN suffix.  What should I assign to $domain? 
      
      Thanks
      Yong
    • you probably won't need to set it if the user's UPN is the correct login, just use userLookupMode = 1 (the default)
    • Thanks Jos.  It prompted me for password.  Is it expected? 
      
      Otherwise, it works like a charm after I entered the password!
      
      Thanks again for sharing it with us. 
    • if you don't have ADFS or AzureAD WP join, then yes that is normal.
  • Update Notifications
    2 Posts | Last post November 01, 2016
    • Hi Jos, is there a way we can get email notifications when you update your script?
    • I don't think Technet has that feature, my blog has an RSS feed you could use, or you could click my twitter link there, i usually post a message when I update it.
  • Inactivity Disconnects Drive
    2 Posts | Last post October 27, 2016
    • Hi Jos, thank you so much for creating this script.
      
      We are using 2.47 have noticed that when a user has not logged in for a few days, the drive becomes disconnected. The script runs again and the user gets their drive back after about 5 minutes.
      
      Is there any way to configure the "timeout" settings so the drive does not get disconnected?
    • That timeout is set in Sharepoint Online: https://support.office.com/en-us/article/Session-timeouts-for-Office-365-37a5c116-5b07-4f70-8333-5b86fd2c3c40
      
      You could schedule the script to run every day through the task scheduler :)
  • Slight issue
    5 Posts | Last post October 20, 2016
    • Hi Jos this is a great scrip and it has saved one of my schools thousands of pounds.
      
      They are getting a similar intermittent error occasionally to the post below:
      
      An error occurred while connecting P: to \\tennant-my.sharepoint.com@SSL\DavWWWRoot\personal\a_user_tennant_co_uk\Documents
      Web Client Network: Access Denied. Before opening the file location, you must first add the website to the trusted sites list (It is !) browse to the website and select the option to log in automatically.
      
      In the log I get 
      Zone 0 was not yet set, setting it to 3
      Zone 1 was set to 3, setting it to 3
      Zone 2 was not yet set, setting it to 3
      Zone 3 was not yet set, setting it to 3
      Zone 4 was not yet set, setting it to 3
      current URL: https://login.microsoftonline.com/
      Detected running explorer process
      Login attempt at Office 365 signin page
      Failed to find signin element type 1 on Office 365 login page, trying next method. Error details: You cannot call a method on a null-valued expression.
      Failed to find signin element type 2 on Office 365 login page, trying next method. Error details: You cannot call a method on a null-valued expression.
      Found sign in elements type 3 on Office 365 login page, proceeding
      attempting to trigger a redirect to ADFS using method 1
      waited for more than 10 to get redirected to ADFS, attempting normal signin
      asking user for password
      asking user for password
      asking user for password
      Failed to find the correct controls at https://www.office.com/?trysignin=0 to log in by script, check your browser and proxy settings or check for an update of this script. Property 'value' cannot be found on this object; make sure it exists and is settable.
      autoProtectedMode is set to True, reverting to old settings
      
      Any pointers to fix appreciated.
    • I'd have to see a full recording of the script in debug mode, apparently your user is getting redirected somewhere I've not seen before (https://www.office.com/?trysignin=0)
      
      This could mean you've got something new/different, or something is improperly configured. You can send the recording to josliebennu (put the right characters between sl and nn)
    • Thanks Jos.  I'll get the customer to do a recording and send it over.
      Adrian
    • I have just tested and https://www.office.com/?trysignin=0 takes you to the Office 365 advertising page
      https://www.office.com/?trysignin=1 takes you to login.microsoftonline.com
    • that doesn't explain why they end up at the trysignin url at all...I see you're using v2.33, I'll release v2.47 on my blog in a few hours, it'll be best if you get me a clean log with the issue and a recording from that one :)
  • Access Denied Error when running script
    3 Posts | Last post October 02, 2016
    • Hello,
      
      We used the script successfully until a while ago, when mappings started failing with the errors below. We tried a lot of things, but we cannot fix the problem. Do you have any idea as to what the problem could be?
      
      Mapping target: \\xxxx-my.sharepoint.com@SSL\DavWWWRoot\personal\xxx_xxxx_xxx_xxx\Documents
      failed to contact O: after mapping it to \\xxxxx-my.sharepoint.com@SSL\DavWWWRoot\personal\xxx_xxxx_xxx_xxx\Documents, check if the URL is valid. Error: 
      Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.
      
       System error 224 has occurred. 
      Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.
      
      Regards,
      
      Stijn
    • Hi Stijn,
      
      please send the full log and script configuration section to josliebennu, put the right characters between sl and nn.
    • Have you try to manual map the drive? Seems like Microsoft have broke mapping personal OneDrive in Windows 10 atleast. A workaround for now seems to be to turning Protection Mode off in registry. Maybe is best to do it temporarily and turn it on after the personal OneDrive has been mapped.
      
      HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\ProtectionMode=0
      
      Regards,
      
      Tobias
  • All libraies under one Drive
    2 Posts | Last post October 01, 2016
    • Hi
      Thanks for your great script, it's a very good job.
      
      We use it for a RDS server farm with more than 600 user. 
      Each user has access to some sites (groups) libraries. it runs correctly but uses one letter per libray. Isn't it possible to put all the libraries under ONE Letter ? this would be a great enhancement. 
      
      Subsidiary question : how can we handle "Shared with me" folders ? Automatically ?
      
      Chris
      
    • Hi Chris,
      
      you could make 1 library with links to the other libraries and map that perhaps? The script doesn't have this feature, nor is it on the roadmap for now.
      
      Shared with my folders are something I haven't looked into yet, onedrive doesn't sync that folder though, and it looks like it is an in-browser query (view) instead of a document library so I don't think that'll work.
  • Will this work?
    2 Posts | Last post September 26, 2016
    • Hi Jos,
      
      Will your script work for our configuration?
      
      We have about 60 users on four 2012 R2 RDS Servers, and have Office 2016 installed (Office 365 Enterprise E3 license). We are duplicating our RDS environment in Azure, and want to find a way to have user's My Docs accessible via OneDrive in the local RDS Servers and the Azure RDS Servers.
      
      Right now, user's My Docs are stored on UPDs. I'm assuming we will need to migrate those to OneDrive and then re-direct My Docs to the mapped drive?
    • that will work :) and you can use o365migrator to migrate upd user data to onedrive for business
  • I don't have any question (yet)
    7 Posts | Last post September 21, 2016
    • I wanted to say just "THANK YOU Jos"
      You saved me
    • Glad to hear :)
    • But now I have a problem :)
      first of all, sorry for my english :(
      I had tested your script before on windwos 10 and test result was success but now I have tested on windows server version, failed.
      when the user logon to windows embedded 8.1 I'm redirecting him to the RDP connection.
      user is using windows server 2012 R2 standard via RDP on windows embedded version. I need the create map folder on rdp session.
      I hope i could explain.
      here you are the error details what I have
      Possible critical error: microsoft office installaion not detected (actually, office 2016 already installed)
      Failed to find signin element type 3 on office 365 login page, attemting to log in anyway, this may fail. Error details: Method invocation failed because [System.__ComObject] does not contain a method named 'IHTMLDocument3_getElementById'.
      and the another message
      Failed to find the correct controls at https://login.microsotonline.com/.... to login by script, check your browser and proxy settings for an update of this script (i can open the microsoft site, I've tested)
      
      Any help with this will be greatly appreciated :)
      script v2.39
      
    • Hi Erkan,
      
      are you blocking Onedrive through a GPO in Office 2016? This could cause those elements to not work.
      
      a workaround is to do a Search & Replace in the Onedrivemapper.ps1 file, replace "IHTMLDocument3_" with "" (in other words, remove IHTMLDocument3_ from the file, everywhere it can be found).
    • Hi Jos,
      
      Thank you for your quick reply
      There is no any restriction or blocking on OneDrive.
      I've changed the all IHTMLDocument3_ records with "" but no success.
      No error, no message, no window, nothing.
      :(
    • So entries now look like this example? $script:ie.document.getElementById() (no quotes!)
      
      Best double check, and then send me the file and logfile to josliebennu (add the right characters between sl and nn)
    • Hi Jos,
      
      Now I have new error
      When I start the script giving an error. 
      in a small window
      cannot find
      ...//domainname.sharepoint.com@ssl/DavWWWRoot.../site/Document
      Make  sure the path or internet address is correct
      
      I had created map folder on different computer.
      Another issue:
      My onedrive storage size is 1TB but it shows me as much as my local HDD
      
      I will send the log file now, thank you for your help
      
      
  • Office 2010 or higher installer
    3 Posts | Last post September 20, 2016
    • Hi, about the Office 2010 or higher installer part, what if I do not have it ?
      We use office on citrix, but I would like to map the drives also locally on the PCs
      By the way, great job, thank you for your awesome script!
    • You could try doing a search+replace in the script for IHTMLDocument3_, replace it with nothing....and pray it works, it works for me on Windows 10 machines.
    • Thank you it's working!
  • Keep login for user
    1 Posts | Last post September 09, 2016
    • We are using this in Citrix as an application to let user run it. But for users, they are keep logging with no luck. For account with admin permission, there is no issue. I am not sure what's the cause of the issue. Do you have any ideas?
131 - 140 of 197 Items