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
(112)
63,715 times
Add to favorites
Office 365
2/3/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Script didnt work from Sunday onwards
    4 Posts | Last post November 22, 2016
    • This script was working fine till last week but from last Sunday onward it didn't work.
      
      I have the same error Enrio02 have "Failed to find the correct controls at https://" . Why this is not working ? Microsoft made any changes in OneDrive mapping URL ?
      
      Thanks
      Aslam
    • are you also using Okta?
    • And if it is an emergency, posting here is not the quickest way to reach me :)
      http://www.lieben.nu/liebensraum/contact/
      
    • For future readers: Aslam was using RMUnify as SSO solution, so the issue had nothing to do with Microsoft and/or OnedriveMapper but requires slight customization.
  • Windows 10 logon script window not hidden
    3 Posts | Last post November 15, 2016
    • First off, thank you for this script, it is a great tool for us to have.
      
      My issue is that our windows 10 workstations have the script window appear at logon even though the hidden setting is set. Is there something I can adjust to make the window hidden for windows 10?
      
      Windows 7 works fine (window is hidden).
    • Hmm, and the two showconsole settings in the script config are disabled? 
      
      I have done this on w10 machines and did not see this behavior....and it is hard to help if i can't replicatie the issue :)
    • Thanks, that was the issue, I missed one of the showconsole settings.
  • problem about additional mapping
    3 Posts | Last post November 11, 2016
    • Hi Jos,
      I have two questions/issues:
      
      The script works perfectly for OneDrive mapping except asking for password firstime login despite it is we are federated ID (ADFS).   This is a minor issue for us. 
      
      The second one: I need to map additional sharepoint.com document library to a drive letter.  So I added this on line 1542.
      
       $desiredMappings += addMapping -driveletter "Z:" -url "\\mycompany.sharepoint.com@SSL\ITShare" -label "ITShare"
      
      It is not working with initial login.  However after I opened an IE and browsed to the folder, "open it in Windows Explorer", it then worked fine mapping the library to Z:.
      
      I confirmed that mycompany.sharepoint.com is already in trusted site list. 
      
      Do I miss anything here? I am thinking 1) protected mode; 2) IE initial start could be the problem.  
      
      Thank you very much for all you help and time.
      Yong
    • Hi Yong,
      
      Map sharepoint libraries using this part of the script:
      $sharepointMappings    += "https://ogd.sharepoint.com/site1/documentsLibrary,ExampleLabel,Y:"
      simply replace that or add copies of that line below it.
      Doing it in the place you're doing it won't work.
      
      As for ADFS, that could have many reasons, easiest is to test it out in debug mode, try the adfs sso test url (idpinitiatedsignon.aspx), make sure the right uid is used and you're not behind a proxy, etc....
    • Thanks Jos. It works for additional mappings now.   I will follow your tips debugging ADFS problems. 
      
      Yong
  • after a time onedrive disk lost connection
    2 Posts | Last post November 02, 2016
    • So when i run the script on mine laptop it works great,
      but after a time the connection is lost and gives me the follow error:
      
      An error occurred while reconnecting O: to \\tenant-my.sharepoint.com@SSL\DavWWWRoot\personal\user_tenant_nl\documents
      Web Client Network Access Denied Before opening files in this location, you  must first add the website to your trusted sites list, browse to the website and select the options to login automaticaly.
      
      the site is trusted but we have single sign on and adfs so the option login automaticaly is not available for us
    • That is why it is a logon script, it needs to be rerun every now and then. You can also place a shortcut to it on your desktop, see the FAQ on my blog.
  • $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.
121 - 130 of 191 Items