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
77,746 times
Add to favorites
Office 365
E-mail Twitter Digg Facebook
  • AAD-Joined / Workplace Joined?
    2 Posts | Last post April 17, 2017
    • Hi Jos,
      I've just started using the new version in native mode - my PCs are all AAD-Joined.
      It seems to work well - I was just curious to see this in the logs below - note that on my AAD-joined PC, there is no key "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WorkplaceJoin" at all. Is that just one of the modes your script tests for? It seems workplace-join is a 'type' of assocation with AAD, but if your PC is simply AAD-joined and not Workplace joined, it won't have they key. Appreciate your comments. Log snip below:
      04/17/2017 17:44:21 | ERROR | userLookupMode is set to 3, but the registry path HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WorkplaceJoin\AADNGC does not exist! Using method 2
      04/17/2017 17:44:21 | ERROR | userLookupMode is set to 3, but the registry path HKCU:\Software\Classes\Local Settings\Software\Microsoft\SettingSyncHost.exe\WinMSIPC does not exist! Using method 3
      04/17/2017 17:44:21 | INFO | userLookupMode is set to 3, we detected in HKLM:\SOFTWARE\Microsoft\IdentityStore\Cache\S-1-12-1-330043884-1240471707-4094912681-3442871876\IdentityCache\S-1-12-1-330043884-1240471707-4094912681-3442871876
      04/17/2017 17:44:21 | ERROR | ERROR: WebDav File Locking support is enabled, this could cause files to become locked in your OneDrive or Sharepoint site
    • Yeah, don't worry about that error, it's just one of several methods to check
  • GPO logon script not working
    1 Posts | Last post April 14, 2017
    • I've tried everything I can think of and can't figure out why this is not working!  the script executes fine if I run with powershell.  the group policy object is applying without errors  but the script never executes - I have set delay logon scripts to 1 minute and disabled in default domain policy -- no change in behavior - here's my gpo setting 
      Name  powershell.exe 
      Parameters C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ExecutionPolicy ByPass -WindowStyle Hidden -FILE \\rdsmgmt\onedrivelogon\HB1DRIVE.PS1 
      hope you can help!
  • Drive doesn't map at logon?
    1 Posts | Last post April 12, 2017
    • We're having issues getting this to work with GPOs. I've had a look through the Q&As here a bit but no luck so far. Running the script manually works fine for us but it wouldn't map the drive at logon, despite the log looking identical to that when we run it manually (runs as the logged in user etc)
      At first I thought the issue was that we were running it as a Powershell script in the GPO (rather than running powershell.exe as a script and then supplying arguments) but we think that this actually worked for another user here. Changing this to use the script as described on your site still produces the same results - that is, the drive doesn't show when the user logs in (even with restartExplorer set to true, which tells us there're no instances of Explorer running)
      Anything else worth trying? Thanks!
  • 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?
91 - 100 of 197 Items