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


  • Works for username but not password?
    1 Posts | Last post October 10, 2017
    • Hi,
      
      I work in a school and this script is an absolute dream! 
      
      It works pretty much perfectly however I cannot get it to SSO as it takes the users log in username but requires the password. Is it possible to take AD credentials for both username and password? We use RM Unify, I have had a look through the script and changed to what is necessary for RM Unify but the password is still required.
      
      Any help would be appreciated!
      
      Thanks.
      
  • Script about to fail?
    1 Posts | Last post October 09, 2017
    • Office 365 team is about to decommission legacy authentication system to Office 365. Powershell script mapping solutions likely to fail as a consequence - read more here: http://blog.iamcloud.com/is-your-onedrive-mapping-script-about-to-fail
  • Argument "Navigate" Error
    1 Posts | Last post October 04, 2017
    • Hello!
      It does not connect here anymore. This is error:
      
      INFO | Attempting to detect username at https://login.microsoftonline.com/login.
      srf?msafed=0#, waited for 60 seconds
      Exceção ao chamar "Navigate" com "1" argumento(s): "Exceção de HRESULT: 0x800C0
      00E"
      Em C:\users\albarros\Desktop\OneDriveMapper_v3.10.ps1:3190 caractere:32
      +             $script:ie.navigate <<<< ($baseURL)
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : ComMethodTargetInvocation
      
      INFO | Attempting to detect username at https://login.microsoftonline.com/login.
      srf?msafed=0#, waited 
      
      
      What can it be?
      Thanks
  • Mapping Sharepoint document library
    2 Posts | Last post October 02, 2017
    • Hi
      I am very new to all this sharepoint stuff but have tried using the onedrive mapper script and it doesn't appear to work, but at the same time doesn't appear to be throwing up any errors either. Please can you advise how I should go about debugging what isn't working. Extract from the log is:
      
      09/10/2017 15:33:56 | INFO | -----09/10/2017 15:33:56 OneDriveMapper v3.10 - David on DAVES_LAPTOP starting-----
      09/10/2017 15:33:56 | INFO | Script elevation level: User
      09/10/2017 15:33:56 | INFO | Set TLS protocol version to 1.2
      09/10/2017 15:33:56 | INFO | You are S-1-5-21-48182178-1235712511-133348671-1001 running on Windows 10 with IE 11 and Powershell version 5
      09/10/2017 15:33:56 | INFO | Loading CookieSetter...
      09/10/2017 15:33:56 | INFO | Test cookie set successfully
      09/10/2017 15:33:56 | INFO | NOTICE: HKLM:\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Security HKLM only not found in registry, your zone configuration could be set on both levels
      09/10/2017 15:33:56 | INFO | NOTICE: davidcramp-my.sharepoint.com found in IE Trusted Sites on user level
      09/10/2017 15:33:56 | INFO | NOTICE: davidcramp.sharepoint.com found in IE Trusted Sites on user level
      09/10/2017 15:33:57 | INFO | IE Automatic Proxy Detection is already disabled
      09/10/2017 15:33:57 | INFO | userLookupMode is set to 6
      09/10/2017 15:33:57 | INFO | Retrieved user login from cache C:\Users\David\AppData\Roaming\OneDriveMapper.tmp2
      09/10/2017 15:33:57 | INFO | Retrieved user password from cache C:\Users\David\AppData\Roaming\OneDriveMapper.tmp
      09/10/2017 15:33:57 | INFO | davidcramp@taxassist.co.uk and matching password detected in cache, no need to query user
      09/10/2017 15:33:57 | WARNING | Maximum file upload size is set to 48 MB
      09/10/2017 15:33:57 | INFO | Not mapping O4B because dontMapO4B is set to True
      09/10/2017 15:33:57 | INFO | no unmapped or incorrectly mapped drives detected
      09/10/2017 15:33:58 | INFO | OnedriveMapper has finished running
      
      Thanks
    • you forget maybe  the label ? "https://ogd.sharepoint.com/site1/documentsLibrary,ExampleLabel,Y:"){ the label ?  
  • Some users are experiencing problems accessing Onedrive
    1 Posts | Last post September 07, 2017
    • Hi Jos,
      
      Since several days some users do not see there onedrive-mapping in Explorer. We are working with Citrix and ADFS, users cannot change the trusted site settings. 
      
      In the log in %APPDATA% is see this message: 
      "Script was unable to find browser controls on the login page and cannot continue, please check your safe-sites or verify these elements are present"
      
      As mentioned before, only a couple of users has these issues. I cannot reproduce this problem with my testaccounts and searched the internet for solutions. 
      
      Can you give me a direction to look for?
      Thanks.
      
  • Having problems with the script?
    1 Posts | Last post August 31, 2017
    • It's a great script, but if you're having issues with deployment or reliability then I'd encourage you all to check out: https://www.iamcloud.com/cloud-drive-mapper While there are a few different scripts/solutions to this problem that's pretty much the main one for use in enterprise IT environments. 
  • No longer works on Windows 8.1
    1 Posts | Last post August 30, 2017
    • Jos, we’ve been using your script for sometime now and its great. I was wondering if you could help us with an issue on a few PC’s it just doesn’t work. It seems like it no longer works on our Windows 8.1 machines anymore only windows 10. Did something at MS change again?
      
      08/30/2017 07:56:58 | ERROR | failed to contact U: after mapping it to \\crdistrict-my.sharepoint.com@SSL\DavWWWRoot\personal\24jmullett_cr_k12_ia_us\Documents, check if the URL is valid. Error:
      The network path was not found.
      
      System error 53 has occurred.
      The network path was not found.
  • Error 53 on Servers 2012/2016
    1 Posts | Last post August 24, 2017
    • This script is amazing! It has really helped us out instead of using a locally installed client.
      
      The error we are receiving now is on user's RDP'ing into servers 2012 and 2016. The logs show that the drive was mapped, but then throws that Error 53. The drive never actually maps. Any ideas?
      
      08/24/2017 09:51:42 | INFO | Mapping target: \\*****-my.sharepoint.com@SSL\DavWWWRoot\personal\*******************************\Documents
      08/24/2017 09:51:44 | ERROR | failed to contact O: after mapping it to \\*****-my.sharepoint.com@SSL\DavWWWRoot\personal\******************************\Documents, check if the URL is valid. Error: 
      The network path was not found.
      
       System error 53 has occurred. 
      The network path was not found.
  • SharePoint not mounting
    3 Posts | Last post August 18, 2017
    • Hi Jos,
      
      First of, Great script! OneDrive mounting works awesome. But for some reason SP Libraries wont work. No error, nothing. Am I doing something wrong?
      
      ###THIS ONLY HAS TO BE CONFIGURED IF YOU WANT TO MAP USER SECURITY GROUPS TO SHAREPOINT SITES
      if($lookupUserGroups -and $configurationID -eq "00000000-0000-0000-0000-000000000000"){
          try{
              $groups = ([ADSISEARCHER]"samaccountname=$($env:USERNAME)").Findone().Properties.memberof -replace '^CN=([^,]+).+$','$1'
              log -text "cached user group membership because lookupUserGroups was set to True"
              #####################FOR EACH GROUP YOU WISH TO MAP TO A SHAREPOINT LIBRARY, UNCOMMENT AND REPEAT BELOW EXAMPLE, NOTE: THIS MAY FAIL IF THERE ARE REGEX CHARACTERS IN THE NAME
              #    $group = $groups -contains "DLG_West District School A - Sharepoint"
              #    if($group){
              #       ###REMEMBER, THE BELOW LINE SHOULD CONTAIN 2 COMMA's to distinguish between URL, LABEL and DRIVELETTER
              #       $sharepointMappings += "https://ogd.sharepoint.com/district_west/DocumentLibraryName,West District,Y:"
              #       log -text "adding a sharepoint mapping because the user is a member of $group"
              #    }  
              #####################FOR EACH GROUP YOU WISH TO MAP TO A SHAREPOINT LIBRARY, UNCOMMENT AND REPEAT BELOW EXAMPLE, NOTE: THIS MAY FAIL IF THERE ARE REGEX CHARACTERS IN THE NAME
                  $group = $groups -contains "GG_SP_Administrative Ondersteuning_CPR_Write"
                  if($group){
                     ###REMEMBER, THE BELOW LINE SHOULD CONTAIN 2 COMMA's to distinguish between URL, LABEL and DRIVELETTER
                     $sharepointMappings += "https://vitras.sharepoint.com/sites/teams/03/CPR,CPR,P:"
                     log -text "adding a sharepoint mapping because the user is a member of $group"
                  }   
          }catch{
              log -text "failed to cache user group membership because of: $($Error[0])" -fout
          }
      
      Thanks in advance!
      
      Cheers,
      
      Anne
    • O my bad, Pasted the commented and the new part in one. This is my part:
      
       #####################FOR EACH GROUP YOU WISH TO MAP TO A SHAREPOINT LIBRARY, UNCOMMENT AND REPEAT BELOW EXAMPLE, NOTE: THIS MAY FAIL IF THERE ARE REGEX CHARACTERS IN THE NAME
                  $group = $groups -contains "GG_SP_Administrative Ondersteuning_CPR_Write"
                  if($group){
                     ###REMEMBER, THE BELOW LINE SHOULD CONTAIN 2 COMMA's to distinguish between URL, LABEL and DRIVELETTER
                     $sharepointMappings += "https://vitras.sharepoint.com/sites/teams/03/CPR,CPR,P:"
                     log -text "adding a sharepoint mapping because the user is a member of $group"
                  }   
          }catch{
              log -text "failed to cache user group membership because of: $($Error[0])" -fout
          }
      
    • Jos can you delete my comment? I'm now aware that there is information in the links that should not be there. Ill post it again.
  • Logon failures... works after repeated retries
    5 Posts | Last post August 18, 2017
    • Here is a log Jos - this was working fine until the weekend. Prompts for password, fails twice and works the third time - any idea? - Regards, Andrew
      (I can't fit the log in here... how can I send it?)
      I hooked up with you on LinkedIn yesterday - will try that channel...
      Here is key item from the log. Note same password entered each time:
      08/07/2017 12:27:50 | INFO | Retrieved user password from cache C:\Users\xxxx\AppData\Roaming\OneDriveMapper.tmp
      08/07/2017 12:27:54 | ERROR | There was an issue while trying to log in during attempt 1
      08/07/2017 12:27:54 | INFO | Signin Option persistence selected
      08/07/2017 12:27:54 | INFO | asking user for password
      08/07/2017 12:28:01 | INFO | Stored user's new password to user password cache file C:\Users\xxxx.davidson\AppData\Roaming\OneDriveMapper.tmp
      08/07/2017 12:28:03 | ERROR | There was an issue while trying to log in during attempt 2
      08/07/2017 12:28:03 | INFO | Signin Option persistence was already selected
      08/07/2017 12:28:03 | INFO | asking user for password
      08/07/2017 12:28:07 | INFO | Stored user's new password to user password cache file C:\Users\xxxx.davidson\AppData\Roaming\OneDriveMapper.tmp
      08/07/2017 12:28:09 | ERROR | There was an issue while trying to log in during attempt 3
      08/07/2017 12:28:10 | INFO | detected user logged in Tile in IE
      08/07/2017 12:28:15 | INFO | login detected, login function succeeded, final url: https://www.office.com/
      08/07/2017 12:28:15 | INFO | IE login function succeeded
      08/07/2017 12:28:27 | INFO | Detected user: xxxx_davidson_compxyz_org_au
      08/07/2017 12:28:27 | INFO | Onedrive cookie generated, mapping drive...
      08/07/2017 12:28:28 | INFO | Mapping target: \\compxyz-my.sharepoint.com@SSL\DavWWWRoot\personal\xxxx_davidson_compxyz_org_au\Documents
      08/07/2017 12:28:28 | INFO | A drive label has been specified, attempting to set the label for O:
      08/07/2017 12:28:28 | INFO | Label has been set to Onedrive
      08/07/2017 12:28:28 | INFO | O: mapped successfully
      
    • Jos, I think the reason this is happening now is that the Windows 2012 R2 server is falling back to legacy mode (suddenly) for some reason. Can you please run though for me the checks needed to make sure native mode will work on 2012 R2 server? That would be greatly appreciated... - cheers, Andrew
    • I'm getting the same issue. I notice that if I hard code the password, it works fine. However, retrieving the password from the encrypted .tmp file is not working (the file is in the correct spot and it is found by the script).
      
      Any ideas?
    • I found a fix to my issue of being asked for the password multiple times when using an excrypted file (hard coded pw worked fine).
      
      The login URL seems to have changed. With debugging on, I could see the microsoft login page re-load a second time. I copied the URL (which is quite long) and replaced the current one (https://login.microsoftonline.com/login.srf?msafed=0#) in the script with it (https://login.microsoftonline.com/common/oauth2/authorize?client_id=00000006-0000-0ff1-ce00-0000...). The mapping now works and I'm not asked for a password multiple times.
      
      I will not put the whole URL here as I'm not sure what potential user account info it could contain. You can get the URL yourselves as I did though.
      
      I hope this will help others as well. Do let us know.
    • Dear friends,
      I had the same experience with the OnedriveMapper suddenly not working anymore. This morning we found out that it had to do with the new log-in experience of Microsoft for Internet Explorer. I set my log-in back to the old experience and the program is working as it Always did.
51 - 60 of 190 Items