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
68,763 times
Add to favorites
Office 365
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Internet Explorer pop-up leave or stay
    1 Posts | Last post April 11, 2017
    • Hi Jos,
        I am having an issue with the script after it gives the log "IE login function succeeded", when it tries to open the new URL a pop-up from IE appers asking if I want to leave or stay in the webpage. Do you know an easy way to fix it, so it always leaves the page.
  • map second driveletter
    6 Posts | Last post April 06, 2017
    • Hi Jos,
      first of all thanks for this script. works great !
      second: i want to connect 2 drivemappings on the office machines, first (X) is the personal drivemapping to the onedrive business /documents folder. Second i want to map the (Y) drive to the shared folder on someone else onedrive business folder (of course i've got the full rights on that)
      how can i fix that in maybe one script ?
    • haven't tried that before, but adding it as a sharepoint url with the correct library name in the url will probably work fine :)
    • hi there, gonna try .. let you know 
    • jos, works all fine
      ... only the amount of total space / free space is not correct on my drives
      any idea about that ?
    • thanks for letting me know. My blog's FAQ tells you about the diskspace thing, it's a webdav client feature.
    • excuse,
      i read it's an webdav issue, and there is at this moment no fix available !
      thats terrible
      waiting time ...
  • Mapping to a different user/path
    3 Posts | Last post April 06, 2017
    • Hi,
      I want to be able to map a drive for all users to a specific/shared Onedrive for Business drive. If this possible as I cannot see how to do this?
      We already map H: home drives which works fine, so I was thinking to run a second script to do this if possible, or ideally merge in to the one.
    • You could probably just define that as a sharepoint site / path...should be sufficient, but haven't personally tried.
    • Hi thanks for the response. I tried this and it seemed to map the drive with no issues, although I get access Denied when trying to open it..saying about trusted sites etc, although the paths are already loaded in for the H: drive mapping. Guessing this must be permissions but Ive added a securoty group to the site permissions for this user so not sure why it still will not open... was a cry for help before I contact MS. Thanks
  • Proxy Authentication Required
    2 Posts | Last post April 04, 2017
    • I seem to be getting the above error when running this script. Wondering if anyone else has?
    • That basically means your proxy doesn't support the script, either use IE auth mode or disable your proxy.
  • Reconnectiong on logon
    3 Posts | Last post April 03, 2017
    • Hello,
      We're having issue with the drivemap not being reconnected on logon, it waits for the script to run again before connecting. Are we missing anything specific except $true on PersistentMapping? Do we have to sync some specific files with our Citrix UPM? Are we missing any specific GPO that are needed for it?
      Everything are working perfectly fine after the script is run (which takes like 5min after logon, I guess this is intended inside the script), just that we have some users that wants to have the folder ASAP after their first run with the script. I was first trying to get this done with the 2.57 version, but also just tried with the newer 3.06 version, but having no luck with the reconnect.
      Thanks alot!
    • You might want to sync the cookies folder, could help.
      In addition, the script should take <10 seconds to run if you use native auth mode in V3.06. If it takes longer, there might be another issue to fix :)
    • I found the reason why the script wasn't running immediately on logon, but still having issues with the reconnection part even though cookies are currently following my profiles. 
      Oh well, I can live with the script running directly after logon at least. I will try to get it set up for another customer and see if I will have better luck there with the same script then I can at least look for differences in the environments.
      Thanks anyways!
  • Cannot get past error failed to contact drive - any ideas?
    1 Posts | Last post March 30, 2017
    • I can run the script but get stuck at contacting X: and I cannot figure it out.  I can map a network drive so it is not permissions.  Any ideas?
  • SharepointMapping URL
    2 Posts | Last post March 29, 2017
    • I'm new to using this powershell and i think it's failing on the SharepointMapping.  Do I have the URL configured right on below ?
      $sharepointMappings    += ",ExampleLabel,Y:"
    • Doesn't look right to me :) site1? documentsLibrary? Examplelabel?
  • How to avoid password prompt
    6 Posts | Last post March 22, 2017
    • We are using Azure AD Connect to synchronize AD accounts to Office 365. This is for use in a computer lab at a school. The user profile gets wiped at logoff. I am trying to use your wonderful script, but I get a password prompt every time.  Is there a way to avoid the password prompt, or do I have to wait until we move to ADFS?
    • Hi,
      Well, I guess two options. Office 365 can only do integrated authentication if you have STS (like ADFS), or if you use AzureAD PassThrough. The latter is not yet supported as Microsoft hasn't been very forthcoming in helping me there.
      ADFS gives you single signon, and thus no need for a password.
      Until you have ADFS, the script really needs the user's password. Normally, it caches that in %APPDATA%, if you choose a different location that doesn't get wiped (homedrive for example), the script wouldn't have to keep prompting (unless the password was changed). The cache location can be configured in the script's configuration section.
    • Ok. It looks like I will have to convince our network engineer to go to ADFS for this. 
      Thank you very much for taking the time to answer, and for answering so quickly.
    • Interesting concept to add password file to home drive,we are using this but the issue we have is anytime the users accesses a different workstation it still prompts as it state password file is not valid !!
      so I am assuming we will need to wait till AzureAD passthrough is working ?
    • Hmm, the password file is encrypted using a local encryption secret, this means it can only be accessed from the same workstation I'm afraid.
    • Any chance of adding the option for clear password, so then this would work?
  • change the script to "sign in persistence"?
    6 Posts | Last post March 19, 2017
    • HI Jos
      I have mapping failure, during the ps run I saw following message:
      "Detected an url that indicates we've been signed in automatically:, but we did not select sign in persistence, this may cause an error when mapping"
      How can we change the script to "sign in persistence"?
    • Is it mapping correctly, or not? Did you do the userlookupmode change I suggested earlier?
    • 1. the mapping is correct
      2. yes I change the userlookupmode as you suggest (-eq instead of -le)
    • so there is no issue then ;)
    • sorry but I misguide you
      first I receive following:
      ERROR | Detected an url that indicates we've been signed in automatically: _com/_layouts/15/onedrive.aspx, but we did not select sign in persistence, this may cause an error when mapping.
      than I receive: 
      INFO | Mapping target:\\\DavWWWRoot\personal\user_domain_com\Documents
      ERROR: detected string error 224 in return code of net use command, this usually means your trusted sites are misconfigured or KB2846960 is missing
      ERROR | failed to contact O: after mapping it to \\\DavWWWRoot\personal\user_domain_com\Documents, check if the URL is valid. Error: 
       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.
      BTW the trusted site is properly configured
    • Please take this to my blog, my contact info is there and I'd need the full log
  • Onedrive for business on-prem
    2 Posts | Last post March 19, 2017
    • Hey
      Does it work on on-prem? (Onedrive for business)?
      Thanks in advance
    • Hi Mike,
      not out of the box, it was designed for office 365, but it can certainly be modified for onprem.
91 - 100 of 194 Items