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


  • WebDAV Mapping
    6 Posts | Last post February 01, 2018
    • Hi Jos,
      
      This script used to work really well before Microsoft updated their sign-in page. I've just downloaded the new script, but I'm unfortunately running into issues. Specifically, I'm trying to map SharePoint as a WebDav folder, and because I set $authMethod to "ie", it now gets stuck on the Delve.office.com page and refreshes it multiple times, saying: "Attempting to detect username at https://gbr.delve.office.com..., waited for 26 seconds". After 60 seconds, it then fails saying it could not detect a username or password. 
      I have tried to change $authMethod to "native", but then I get the following:
      
      "INFO | Waited for 180 seconds for O4b auto provisioning...
      ERROR | Failed to auto provision onedrive and/or retrieve username from the response URL. Is this user licensed?
      INFO | Will attempt to use auto-guessed value of \\companyname-my.sharepoint.com@SSL\DavWWWRoot\personal\user_companyname_co_uk\"
      
      It then tried to map that personal URL, whereas it should be mapping only the company name (i.e. https://companyname.sharepoint.com). 
      Any help with this would be greatly appreciated!
    • that sounds like the user doesn't have Onedrive, otherwise it shouldn't end up at the Delve page...
    • I having the issue as above:
      
      "INFO | Waited for 180 seconds for O4b auto provisioning...
      ERROR | Failed to auto provision onedrive and/or retrieve username from the response URL. Is this user licensed?
      INFO | Will attempt to use auto-guessed value of \\companyname-my.sharepoint.com@SSL\DavWWWRoot\personal\user_companyname_co_uk\"
      
      It's my account and use OneDrive and fully licenced, any ideas? We are using Azure Simple SSO which is working great!
      
      TIA
    • You'll have to contact me @ my blog (http://www.lieben.nu/liebensraum/contact) with logs and probably a VM so I can reproduce your issue for you.
    • Same here, unable to map drive X: after 180 seconds...
      
    • We are ok now. This was tested and running properly under Horizon View 7.3 as well!, nice script, well done!
  • Does this work on an account with MFA?
    2 Posts | Last post January 26, 2018
    • Does this work on an account with Azure AD Premium MFA enabled?
    • There is a bit of basic support for that in IE auth mode, native doesn't support it
  • System Error 53
    2 Posts | Last post January 26, 2018
    • Hi Jos,
      
      Does it work with SSO via AD Connect (Synchronized Identity)? 
      We ran the script and we're getting the error below.
      ERROR |Failed to contact X: after mapping it to \\onedrivemapper-my....
      
      System error 53 has occurred.
      The network path was not found.
      
      Regards,
      Ted
      
      
    • Yes, it does, 53 usually has something to do with the webdav client, check my blog/FAQ
  • v3.13 ADFS, Workgroup computer
    3 Posts | Last post January 26, 2018
    • Hi guys,
      
      I'm trying to use onedrivemapper on a workgroup computer and I'm getting (401) every time.
      This doesn't happen on domain joined PCs.
      Is there any way to use workgroup PCs with ADFS login?
      
      Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (401) Unauthorized."
      At C:\Users\Administrator\Desktop\onedrive-adfs.ps1:364 char:13
    • I've unchecked "Windows Authentication" under global authentication policy - primary authentication and everything is working just fine. Thank you Jos, you're the greatest hero known to technet community!!
      
      Regards,
      Marko
    • thanks! :)
  • Trusted Sites Error
    3 Posts | Last post January 05, 2018
    • I'm using 3.12 and getting this error, even though trusted sites is populated:
      
      (replaced domain with with mydomain for PII concerns)
      
      ERROR | 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 X: after mapping it to \\mydomain-my.sharepoint.com@SSL\DavWWWRoot\personal\s_kelly4_snhu_edu\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.
    • I am getting the same error with 3.13. Were you able to fix it?
    • I found if I login to office365 first then it works.
  • Unable to run it via scheduled task or logon script for non-admins
    3 Posts | Last post December 19, 2017
    • SO... if I'm a local admin whether I kick of the script via scheduled task at logon or via GPO, it works just fine. If I'm non-admin it doesn't map any drives, however, if I run it manually (or interactively as scheduled task) it works fine. Any ideas?
      Thank you
    • Probably a UAC setting, what does the log say? what happens if you just restart explorer.exe?
    • Jos, the log did not say anything, it actually says that it mapped the drive successfully. The explorer gets restarted by your script.
      When I disabled UAC, it mapped fine and I was able to see it, now, just need to figure out how to make it work with UAC turned on :-)
      THank you
  • Version 3.13
    3 Posts | Last post December 08, 2017
    • Hi Jos
      
      I think I have the same issue as Kami2082.
      It appears the Microsoft "new sign in experience" has killed the script from working.
      It's been working for months otherwise.
      
      Is V 3.13 the fix for this and if so could you please send me a link
      
      cheers
    • Hi Jos
      
      OK v3.10 is 3.13 
      Also I can report, that if you do not choose to sign in with the new Microsoft user experience the script still works. It's only an issue if you choos
      
       
    • Hi Jos
      
      V3.11 definately works for me !
      
      Your script rocks ! 
  • No longer works
    3 Posts | Last post December 02, 2017
    • 3.12 worked for few days, now gives:
      Unable to find user realm due to Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (400) Bad Request."
    • And again, update to 3.13 made it work!
      Thank you Jos
    • hi,
      I have the same issue. From where I can download version 3.13?
  • Please help.
    1 Posts | Last post November 30, 2017
    • Could you please help me? I downloaded your script and attempted to run it after I set all of the variables such as drive letter, customer tenant name etc, but every time I attempt to run it, it never prompts me for username and password, but rather just fails with an error message of Mapping can not continue because we could not log into office 365. It finds my UPN correctly, and even lists it in the powershell using user@domain.com for login etc, however, never prompts me for a password. what am I doing wrong?
      
  • v2.22 and v3.10 not working
    2 Posts | Last post November 21, 2017
    • We don't have ADFS, before using v2.22 working very well over one year. Since last Friday, suddenly don't work, no login windows popup. Does Microsoft OneDrive change something in their backend?
      11/17/2017 16:08:27 | ERROR | ERROR: WebDav File Locking support is enabled, this could cause files to become locked in your OneDrive or Sharepoint site
      11/17/2017 16:08:27 | WARNING | Maximum file upload size is set to 48 MB
      11/17/2017 16:08:27 | INFO | Adding to mapping list: K: (\\domain-my.sharepoint.com@SSL\DavWWWRoot\personal\)
      11/17/2017 16:08:27 | INFO | K: is not yet mapped
      11/17/2017 16:08:27 | INFO | Base URL: https://domain-my.sharepoint.com/_layouts/15/MySite.aspx?MySiteRedirect=AllDocuments 
      11/17/2017 16:08:36 | ERROR | Failed to find signin element type 3 at https://login.microsoftonline.com/login.srf?msafed=0. You may have to upgrade to a later Powershell version or Install Office. Attempting to log in anyway, this will likely fail. Error details: The element cred_keep_me_signed_in_checkbox was not found (2) or had no tagName
      11/17/2017 16:08:36 | INFO | Will use maverick.luk@domain.com as login
      11/17/2017 16:08:36 | INFO | attempting to trigger a redirect to SSO Provider using method 1
      11/17/2017 16:08:36 | ERROR | Failed to find the correct controls at https://login.microsoftonline.com/login.srf?msafed=0 to log in by script, check your browser and proxy settings or check for an update of this script. The element cred_keep_me_signed_in_checkbox was not found (2) or had no tagName
      11/17/2017 16:08:36 | ERROR | fallback mode is enabled, and login failed. Attempting native auth mode...
    • Used v3.12 some users work fine. But Some users fail mount one drive.
      Log:
      11/21/2017 15:34:31 | WARNING | no KMSI prompt even though we expected one
      I guess it is due to can’t Keep Me Sign In. Microsoft changed to new sign in method. Problem users login in browser, no KMSI windows popup.
      Do you know how to fix it?
41 - 50 of 194 Items