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


  • Error
    2 Posts | Last post September 19, 2018
    • Hi Jos,
      
      Hope you are doing well.
      I am trying an old version of your script.
      It is picking up the onedrive correctly but failing with following error.
      Can you help me on identifying whats the issue
      
      current URL: https://login.microsoftonline.com/b4986ceb-2bea-4972-9802-e93f42ed6f6d/oauth2/authorize?client_id=00000003-0000-0ff1-ce00-000000000000&response_mode=form_post&response_type=code%20id_token&resource=00000003-0000-0ff1-ce00-000000000000&scope=openid&nonce=EBFCB47D78BC6C0EA5390FB371D8ECF3DAF616F79F3E8007-CB1D878A52278AADC5CC065C1B48B4125A778F4C55EF64054E97E1AF99D6039E&redirect_uri=https:%2F%2Fstaidansacademy-my.sharepoint.com%2F_forms%2Fdefault.aspx&wsucxt=1&cobrandid=11bd8083-87e0-41b5-bb78-0bc43c8a8e8a&client-request-id=85a47c9e-60f8-6000-12f2-1a0b1ca5913b
      Detected running explorer process
      Login attempt at Office 365 signin page
      attempting to trigger a redirect to ADFS
      Failed to find the correct controls at https://login.microsoftonline.com/b4986ceb-2bea-4972-9802-e93f42ed6f6d/oauth2/authorize?client_id=00000003-0000-0ff1-ce00-000000000000&response_mode=form_post&response_type=code%20id_token&resource=00000003-0000-0ff1-ce00-000000000000&scope=openid&nonce=EBFCB47D78BC6C0EA5390FB371D8ECF3DAF616F79F3E8007-CB1D878A52278AADC5CC065C1B48B4125A778F4C55EF64054E97E1AF99D6039E&redirect_uri=https:%2F%2Fstaidansacademy-my.sharepoint.com%2F_forms%2Fdefault.aspx&wsucxt=1&cobrandid=11bd8083-87e0-41b5-bb78-0bc43c8a8e8a&client-request-id=85a47c9e-60f8-6000-12f2-1a0b1ca5913b to log in by script, check your browser and proxy settings or check for an update of this script
      
      autoProtectedMode is set to True, reverting to old settings
      Setting zone 1 back to 3
      Setting zone 2 back to 3
      Setting zone 3 back to 3
    • I am also experiencing the same issue.  Did you find a solution.  We've been using this script for over a year now however just recently it stopped working with the same error messages along with this one:
      
      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
      
      Any guidance on what to look at would be appreciated.
  • mapping with seamless SSO
    2 Posts | Last post September 07, 2018
    • Hi, 
      
      we are trying to use the script to map, drives.
      Ad-connect is used with seamless SSO.
      We ste the AzureAADConnectSSO to True.
      with authmethod to IE
      in the mog we see that onedrive cookie is generated
      
      but we always encounter error 224 , Access refused
      
      What could be wrong ?
    • 09/07/2018 09:53:54 | INFO | attempting to trigger a redirect to SSO Provider using method 1
      09/07/2018 09:53:57 | INFO | KMSI prompt detected
      09/07/2018 09:53:57 | INFO | Waited 0 of 1 seconds for SSO redirect. While looking for userNameInput at https://login.microsoftonline.com/login.srf?msafed=0. If you're not using SSO this message is expected.
      09/07/2018 09:53:58 | INFO | KMSI prompt detected
      09/07/2018 09:53:58 | INFO | Waited 0.5 of 1 seconds for SSO redirect. While looking for userNameInput at https://login.microsoftonline.com/login.srf?msafed=0. If you're not using SSO this message is expected.
      09/07/2018 09:53:58 | INFO | waited for more than 1 to get redirected by SSO provider, attempting normal signin
      09/07/2018 09:53:58 | WARNING | Failed to force sign in persistence
      09/07/2018 09:53:58 | INFO | Retrieved user password from cache C:\Users\testsf\AppData\Roaming\OneDriveMapper.tmp
      09/07/2018 09:54:04 | WARNING | no KMSI prompt even though we expected one
      09/07/2018 09:54:05 | INFO | login detected, login function succeeded, final url: https://www.office.com/?auth=2&home=1
      09/07/2018 09:54:05 | INFO | IE login function succeeded
      09/07/2018 09:54:12 | INFO | Detected user: testsf_inowai_com
      09/07/2018 09:54:12 | INFO | Onedrive cookie generated
      09/07/2018 09:54:12 | INFO | Mapping target: \\inowai-my.sharepoint.com@SSL\DavWWWRoot\personal\testsf_inowai_com\Documents
      09/07/2018 09:54:13 | ERROR | failed to contact x: after mapping it to \\inowai-my.sharepoint.com@SSL\DavWWWRoot\personal\testsf_inowai_com\Documents, check if the URL is valid. Error: 
       L'erreur systŠme 224 s'est produite. 
       AccŠs refus‚. Avant d'ouvrir des fichiers de cet emplacement, vous devez d'abord ajouter le site Web … votre liste de sites approuv‚s, acc‚der au site Web, puis s‚lectionner l'option de connexion automatique.
      
  • Error - ... does not contain a method named 'Replace'.
    2 Posts | Last post August 29, 2018
    • Dear Jos, thanks for the fab script! We have been using it for a while now without any problems.
      Since this morning we are getting a error when executing the script.
      
      Method invocation failed because [System.Int32] does not contain a method named 'Replace'.
      At C:\software\teams.ps1:3271 char:9
      +         $payLoad = (returnEnclosedFormValue -res $res -searchString " ...
      +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : MethodNotFound
      
      Would you be able to help?
      
      Regards,Steven
      
      
    • Change $autoMapFavoriteSites  = $False   
      Had the same problem
      good luck
      
  • Does this work with App Passwords?
    4 Posts | Last post August 28, 2018
    • Does Onedrivemapper work with app passwords on MFA-enabled accounts? I can't seem to get it to work. I am able to get it working with MFA but then it prompts for authentication at each login. 
    • i don't think app passwords will work, haven't tested it but that should probably use a different endpoint.
    • Hi Bertram, hi Jos, may I ask how to manage to get the OneDriveMapper working with MFA? We configured 0365 MFA for our users. Since then OneDriverMapper stucks a while and close then without mapping a drive. For MFA disabled users is the OneDriveMapper still working fine.
    • Please consult the FAQ on my blog Patrick, it'll show you where to send log files 'n such
  • Map Multiple OneDrives
    2 Posts | Last post August 16, 2018
    • I will preface with saying that this script is amazing and very well done, kudos to Jos Lieben.
      
      My organization is moving two file servers, one for company share drive and one for personal share drive(V: and U:), to Onedrive for business. Bad idea, I know, but I don't make the decisions I just make things happen. The company share drive will be all moving to one account. As for everyones personal share drive...they will be moving their own files to their own ODfB account. I want to map both the company share and each users personal share as the same drive letters we are currently using. I am able to map both just fine, however not at the same time. When I map the 2nd one the 1st one disappears. I have VERY little experience with power shell so I am not able to analyze the script very well. Can anyone tell me what I could change in the script to map both drives? Or maybe i'm doing something wrong entirely?
    • I figured it out. Towards the bottom of the script you'll find "#clean up any existing mappings". I just made this whole section comments and BAM! I did this for the 2nd script. 1st script maps company share and I left this section as it was for the 1st script. Then commented out the 2nd script and ran it and both drives are now mapped.
  • MFA isn't working at all
    2 Posts | Last post August 03, 2018
    • I am using ADFS 2016 with Azure MFA and script doesn't act like it tests for MFA. It seems as though the script looks for an Office 365 URL then checks for MFA but my MFA is being preformed with an ADFS URL. Anyone have any suggestion or a better understanding of how the script check if MFA is happening?
      
      Being able to use an app password would be great as an alternative.
    • I've exact same issue. ADFS 2016 in combination with MFA (app notification) is not working.
      Disabling MFA will great, but is't an option for us.
      
      Hope there will be a solution.
  • path lenght limitation to 255 characters
    2 Posts | Last post July 11, 2018
    • We are using the onedrivemapper.ps1 script and it works great !
      We have one issue with the length of a filename, if it exceeds 256 the directory in which the file exist is shown empty (no files) using onedrivemapper. We can see the file in sharepoint (which I think has 400 characters as limitation). Is there a way to solve this issue in onedrivemapper ? Thanks!
    • No, there is no solution for that because WebDAV doesn't support it
  • I'm getting error message 53
    2 Posts | Last post July 11, 2018
    • This is the error message that i'm getting.
      
      06/12/2018 10:24:36 | ERROR | failed to contact X: after mapping it to \\company-my.sharepoint.com@SSL\DavWWWRoot\personal\chris_v_sterlingsolutions_com\Documents, check if the URL is valid. Error: 
       System error 53 has occurred. 
       The network path was not found.
    • Please check the FAQ on my blog
  • Issue with federation
    1 Posts | Last post May 18, 2018
    • We currently have one of our domains federated, @domain.com (not federated), @student.domain.com (federated).  When user@domain.com logs onto login.microsoftonline.com no issues there, when a user@student.domain.com logs on they get redirected and on the new redirected page they need to enter samaccountname only and no @student.domain.com.  Where can I make the change to allow that samaccountname on the new redirected page along with passing over the username and password to the proper fields?  Hope you can help.
  • why it doesn't work "waited for xx sec for o4b auto provisioning
    1 Posts | Last post May 15, 2018
    • 05/15/2018 10:58:24 | INFO | KMSI prompt detected
      05/15/2018 10:58:24 | INFO | sending cookie persistence request
      05/15/2018 10:58:24 | INFO | Redirect detected...
      05/15/2018 10:58:24 | INFO | Detected a redirect to Office.com, following...
      05/15/2018 10:58:25 | INFO | Logged into Office 365!
      05/15/2018 10:58:25 | INFO | Retrieving Onedrive for Business cookie step 1...
      05/15/2018 10:58:27 | INFO | Retrieving Onedrive for Business cookie step 2 at https://onedrivemapper-my.sharepoint.com/_forms/default.aspx
      05/15/2018 10:58:29 | INFO | Waited for 0 seconds for O4b auto provisioning...
      05/15/2018 10:58:40 | INFO | Waited for 10 seconds for O4b auto provisioning...
      05/15/2018 11:01:37 | INFO | Waited for 20 seconds for O4b auto provisioning...
      05/15/2018 11:01:50 | INFO | Waited for 30 seconds for O4b auto provisioning...
      05/15/2018 11:02:03 | INFO | Waited for 40 seconds for O4b auto provisioning...
      05/15/2018 11:02:15 | INFO | Waited for 50 seconds for O4b auto provisioning...
      05/15/2018 11:02:29 | INFO | Waited for 60 seconds for O4b auto provisioning...
      05/15/2018 11:02:55 | INFO | Waited for 70 seconds for O4b auto provisioning...
      05/15/2018 11:09:01 | INFO | Waited for 80 seconds for O4b auto provisioning...
      etc
      
      can you please help me? thank you
21 - 30 of 194 Items