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

  • save documents on X;drive
    1 Posts | Last post April 27, 2017
    • Hello!
      We have deployed your scripts and The students cant save their document. They are asked for log in and after they write password, suddenly the save button is been disable.
      Any hints?
  • Map SharePoint online only
    2 Posts | Last post April 27, 2017
    • Hi Jos,
      First of all thanks for this script. works great!
      We want to use your script to map the SharePoint Online to a drive letter in our Windows 7 PC. We only want to map SharePoint Online; OneDrive is not require to map. Could you please kindly advise which parameters should I set? Thanks in advance.
    • If you want the script to ignore Onedrive set $dontMapO4B to $True
      if you want SharePoint to not be AD group specific set $lookupUserGroups to $False, other wise set to true comment the FIRST "$sharepointMappings    += " with a # and scroll down to edit with your company information
      if($lookupUserGroups -and $configurationID -eq "00000000-0000-0000-0000-000000000000"){
              $groups = ([ADSISEARCHER]"samaccountname=$($env:USERNAME)").Findone().Properties.memberof -replace '^CN=([^,]+).+$','$1'
              log -text "cached user group membership because lookupUserGroups was set to True"
                  $group = $groups -contains "RIO_IT_LG_M"
                     ###REMEMBER, THE BELOW LINE SHOULD CONTAIN 2 COMMA's to distinguish between URL, LABEL and DRIVELETTER
                     #$sharepointMappings += ",West District,Y:" # Exemplo
  • Attempting to detect username
    2 Posts | Last post April 24, 2017
    • I am having an issue. This script works great for almost everyone in our office. However there a few users where it fails on attempting to detect username, it prompts for their O365 passwords a few times, then fails after trying many attempts. I think all the users are setup the same, the only difference is they are newer employees as of this month. They all have access to our Sharepoint site. I am at a loss on where to look for a difference. They all have E3 licenses and mailboxes in O365. Same access rights in Sharepoint (they can create documents, etc.) I saw an earlier post it may have to do with their URl being different for Sharepoint, but it looks the same. Any advice on where to look on this? 
    • It could be that the script is failing to automatically provision their Onedrive for Business....I can't say for sure without the full log, but you could verify by trying this on a new user, if it fails, log in as that user and browse to onedrive, then try again.
  • Cannot map folders with space in the name
    1 Posts | Last post April 19, 2017
    • Hi!
      First of all, thanks for the script, it's really great!
      Second I'm having a problem trying to map $sharepointMappings += " Documents/,DepTecnico,Y:", already tryed $sharepointMappings += ",DepTecnico,Y:" and $sharepointMappings += "^%20Documents/,DepTecnico,Y:" but it doesn't works.
      I can map a drive just fine using: $sharepointMappings += ",DepTecnico,Y:"
  • Folder permissions
    3 Posts | Last post April 18, 2017
    • Hi jos,
      Firstly thank you for this, as it is exactly what my customers wanted!
      Now to the question, am I missing something or doing wrong as I'm mapping the drive through GPO and everything is fine, drive maps etc, yet users without permissions can delete "root" folders to which they dont have actual permissions?
    has many folders and many folders under them, I have added only read rights to sharepoint users and when mapped they can delete all of them as they wish, is there a solution I am missing?
      Thank you in advance,
    • Are you sure those rights aren't being inherited somehow? Or perhaps not mapping the root could also be helpful.
      If you are 100% sure those rights should not be there, then this is a very serious security breach in Sharepoint Online and I urge you to submit a support request with Microsoft, as this should absolutely not be possible. 
    • Hey, 
      apparently Microsoft has pushed out some updates which basicly screwed up all of my previous settings aka. disabling inheritance etc. so now users had Modify rights to the "root"
      After fixing these I tried with user rights and no, I cannot delete the "root" folder, but instead it will continue to delete everything under the root folder to which the user has Modify rights, no errors pop up. I was expecting an error directly when trying to delete a folder to which I dont have rights, but no. So this is a microsoft / sharepoint "problem"
      Thanks for your reply,
  • 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 ...
81 - 90 of 192 Items